Skip to main content
PATCH
Change or publish 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.

Path Parameters

survey_id
string
required

The survey's id, from GET /v1/surveys

Body

application/json
creator
string

With email, on a survey no one owns: the email of a current member of your workspace, who owns the survey's email. A survey with an owner gives its email to them

Required string length: 3 - 320
Pattern: ^[^@\s]+@[^@\s]+$
definition
Definition · object

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:
description
string

"" clears it

Maximum string length: 2000
email
Email · object

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

state
string

published publishes it, once it has an email and a question; publishing can't be undone. Changes sent with it are written first

Allowed value: "published"
theme
Theme · object

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

title
string
Required string length: 1 - 255
type
enum<string>

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

Available options:
NPS,
CSAT,
CES,
CUSTOM

Response

200 - 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