Skip to main content
POST
Create a survey

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.

Body

application/json
definition
Definition · object
required

The survey's questions and pages: the SurveyJS JSON the app's survey builder saves (https://help.statisfy.com/rest-api/survey_definition). Elements sit in pages[].elements (or top-level elements) and in panels' elements; panels nest at most 10 deep. An element's type is one of boolean, checkbox, comment, dropdown, expression, file, html, image, imagepicker, matrix, matrixdropdown, matrixdynamic, multipletext, panel, paneldynamic, radiogroup, ranking, rating, signaturepad, tagbox, text. A question's name is the key its answers carry, so every question needs one and names must be unique. At most 1,000,000 characters as JSON. HTML in it (html elements, completedHtml) is stored as sent and cleaned where the survey renders

Example:
title
string
required
Required string length: 1 - 255
creator
string | null

The email of a current member of your workspace, credited as the creator of the survey and its email; left out, a person's own key credits that person, and any other key (an org key, a digital worker, a Statisfy staff grant) is credited as itself

Required string length: 3 - 320
Pattern: ^[^@\s]+@[^@\s]+$
description
string | null
Maximum string length: 2000
email
EmailBody · object | null

The email a survey campaign sends, replaced whole. The app opens it in its HTML editor; a design made in its simple form or visual editor is replaced

theme
Theme · object | null

The SurveyJS theme JSON the app's survey builder saves (https://help.statisfy.com/rest-api/survey_definition#theme)

type
enum<string>
default:CUSTOM

NPS, CSAT, CES or CUSTOM. NPS and CSAT surveys feed account health

Available options:
NPS,
CSAT,
CES,
CUSTOM

Response

201 - application/json

Successful Response

created_at
string<date-time>
required
definition
Definition · object
required

The survey's questions and pages: the SurveyJS JSON the app's survey builder saves (https://help.statisfy.com/rest-api/survey_definition). Elements sit in pages[].elements (or top-level elements) and in panels' elements; panels nest at most 10 deep. An element's type is one of boolean, checkbox, comment, dropdown, expression, file, html, image, imagepicker, matrix, matrixdropdown, matrixdynamic, multipletext, panel, paneldynamic, radiogroup, ranking, rating, signaturepad, tagbox, text. A question's name is the key its answers carry, so every question needs one and names must be unique. At most 1,000,000 characters as JSON. HTML in it (html elements, completedHtml) is stored as sent and cleaned where the survey renders

description
string | null
required
email
SurveyEmail · object | null
required

The email a survey campaign sends; null until one is set

id
string
required
state
enum<string>
required

draft or published. Only a published survey can be sent in a campaign, and a published survey is locked: it can't be changed or deleted, only duplicated

Available options:
draft,
published
theme
Theme · object | null
required

The SurveyJS theme JSON the app's survey builder saves (https://help.statisfy.com/rest-api/survey_definition#theme)

title
string
required
type
string
required

NPS, CSAT, CES or CUSTOM. NPS and CSAT surveys feed account health

updated_at
string<date-time> | null
required