Survey
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
GET | |
GET | |
POST | |
GET | |
GET | |
GET |
List all surveys
Required API key scopes
survey:read
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- limitinteger
Number of results to return per page.
- offsetinteger
The initial index from which to return the results.
- searchstring
A search term.
Response
Example request
GET
/api /projects /:project_id /surveys
Example response
Status 200
Create surveys
Required API key scopes
survey:write
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request parameters
- namestring
- descriptionstring
- type
- schedulestring
- linked_flag_idinteger
- targeting_flag_idinteger
- targeting_flag_filters
- remove_targeting_flagboolean
- questions
The `array` of questions included in the survey. Each question must conform to one of the defined question types: Basic, Link, Rating, or Multiple Choice. Basic (open-ended question) - `id`: The question ID - `type`: `open` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `branching`: Branching logic for the question. See branching types below for details. Link (a question with a link) - `id`: The question ID - `type`: `link` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `link`: The URL associated with the question. - `branching`: Branching logic for the question. See branching types below for details. Rating (a question with a rating scale) - `id`: The question ID - `type`: `rating` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `display`: Display style of the rating (`number` or `emoji`). - `scale`: The scale of the rating (`number`). - `lowerBoundLabel`: Label for the lower bound of the scale. - `upperBoundLabel`: Label for the upper bound of the scale. - `branching`: Branching logic for the question. See branching types below for details. Multiple choice - `id`: The question ID - `type`: `single_choice` or `multiple_choice` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `choices`: An array of choices for the question. - `shuffleOptions`: Whether to shuffle the order of the choices (`boolean`). - `hasOpenChoice`: Whether the question allows an open-ended response (`boolean`). - `branching`: Branching logic for the question. See branching types below for details. Branching logic can be one of the following types: Next question: Proceeds to the next question ```json { "type": "next_question" } ``` End: Ends the survey, optionally displaying a confirmation message. ```json { "type": "end" } ``` Response-based: Branches based on the response values. Available for the `rating` and `single_choice` question types. ```json { "type": "response_based", "responseValues": { "responseKey": "value" } } ``` Specific question: Proceeds to a specific question by index. ```json { "type": "specific_question", "index": 2 } ```
- conditions
- appearance
- start_datestring
- end_datestring
- archivedboolean
- responses_limitinteger
- iteration_countinteger
- iteration_frequency_daysinteger
- iteration_start_datesarray
- current_iterationinteger
- current_iteration_start_datestring
- response_sampling_start_datestring
- response_sampling_interval_type
- response_sampling_intervalinteger
- response_sampling_limitinteger
- response_sampling_daily_limits
- enable_partial_responsesboolean
- _create_in_folderstring
Response
Example request
POST
/api /projects /:project_id /surveys
Example response
Status 201
Retrieve surveys
Required API key scopes
survey:read
Path parameters
- idstring
A UUID string identifying this survey.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Response
Example request
GET
/api /projects /:project_id /surveys /:id
Example response
Status 200
Update surveys
Required API key scopes
survey:write
Path parameters
- idstring
A UUID string identifying this survey.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request parameters
- namestring
- descriptionstring
- type
- schedulestring
- linked_flag_idinteger
- targeting_flag_idinteger
- targeting_flag_filters
- remove_targeting_flagboolean
- questions
The `array` of questions included in the survey. Each question must conform to one of the defined question types: Basic, Link, Rating, or Multiple Choice. Basic (open-ended question) - `id`: The question ID - `type`: `open` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `branching`: Branching logic for the question. See branching types below for details. Link (a question with a link) - `id`: The question ID - `type`: `link` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `link`: The URL associated with the question. - `branching`: Branching logic for the question. See branching types below for details. Rating (a question with a rating scale) - `id`: The question ID - `type`: `rating` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `display`: Display style of the rating (`number` or `emoji`). - `scale`: The scale of the rating (`number`). - `lowerBoundLabel`: Label for the lower bound of the scale. - `upperBoundLabel`: Label for the upper bound of the scale. - `branching`: Branching logic for the question. See branching types below for details. Multiple choice - `id`: The question ID - `type`: `single_choice` or `multiple_choice` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `choices`: An array of choices for the question. - `shuffleOptions`: Whether to shuffle the order of the choices (`boolean`). - `hasOpenChoice`: Whether the question allows an open-ended response (`boolean`). - `branching`: Branching logic for the question. See branching types below for details. Branching logic can be one of the following types: Next question: Proceeds to the next question ```json { "type": "next_question" } ``` End: Ends the survey, optionally displaying a confirmation message. ```json { "type": "end" } ``` Response-based: Branches based on the response values. Available for the `rating` and `single_choice` question types. ```json { "type": "response_based", "responseValues": { "responseKey": "value" } } ``` Specific question: Proceeds to a specific question by index. ```json { "type": "specific_question", "index": 2 } ```
- conditions
- appearance
- start_datestring
- end_datestring
- archivedboolean
- responses_limitinteger
- iteration_countinteger
- iteration_frequency_daysinteger
- iteration_start_datesarray
- current_iterationinteger
- current_iteration_start_datestring
- response_sampling_start_datestring
- response_sampling_interval_type
- response_sampling_intervalinteger
- response_sampling_limitinteger
- response_sampling_daily_limits
- enable_partial_responsesboolean
- _create_in_folderstring
Response
Example request
PATCH
/api /projects /:project_id /surveys /:id
Example response
Status 200
Delete surveys
Required API key scopes
survey:write
Path parameters
- idstring
A UUID string identifying this survey.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Example request
DELETE
/api /projects /:project_id /surveys /:id
Example response
Status 204 No response body
Retrieve surveys activity retrieve
Required API key scopes
activity_log:read
Path parameters
- idstring
A UUID string identifying this survey.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Example request
GET
/api /projects /:project_id /surveys /:id /activity
Example response
Status 200 No response body
Retrieve surveys stats retrieve
Get survey response statistics for a specific survey.
Args: date_from: Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z) date_to: Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)
Returns: Survey statistics including event counts, unique respondents, and conversion rates
Required API key scopes
survey:read
Path parameters
- idstring
A UUID string identifying this survey.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Example request
GET
/api /projects /:project_id /surveys /:id /stats
Example response
Status 200 No response body
Create surveys summarize responses
Required API key scopes
survey:read
Path parameters
- idstring
A UUID string identifying this survey.
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request parameters
- namestring
- descriptionstring
- type
- schedulestring
- linked_flag_idinteger
- targeting_flag_idinteger
- targeting_flag_filters
- remove_targeting_flagboolean
- questions
The `array` of questions included in the survey. Each question must conform to one of the defined question types: Basic, Link, Rating, or Multiple Choice. Basic (open-ended question) - `id`: The question ID - `type`: `open` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `branching`: Branching logic for the question. See branching types below for details. Link (a question with a link) - `id`: The question ID - `type`: `link` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `link`: The URL associated with the question. - `branching`: Branching logic for the question. See branching types below for details. Rating (a question with a rating scale) - `id`: The question ID - `type`: `rating` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `display`: Display style of the rating (`number` or `emoji`). - `scale`: The scale of the rating (`number`). - `lowerBoundLabel`: Label for the lower bound of the scale. - `upperBoundLabel`: Label for the upper bound of the scale. - `branching`: Branching logic for the question. See branching types below for details. Multiple choice - `id`: The question ID - `type`: `single_choice` or `multiple_choice` - `question`: The text of the question. - `description`: Optional description of the question. - `descriptionContentType`: Content type of the description (`html` or `text`). - `optional`: Whether the question is optional (`boolean`). - `buttonText`: Text displayed on the submit button. - `choices`: An array of choices for the question. - `shuffleOptions`: Whether to shuffle the order of the choices (`boolean`). - `hasOpenChoice`: Whether the question allows an open-ended response (`boolean`). - `branching`: Branching logic for the question. See branching types below for details. Branching logic can be one of the following types: Next question: Proceeds to the next question ```json { "type": "next_question" } ``` End: Ends the survey, optionally displaying a confirmation message. ```json { "type": "end" } ``` Response-based: Branches based on the response values. Available for the `rating` and `single_choice` question types. ```json { "type": "response_based", "responseValues": { "responseKey": "value" } } ``` Specific question: Proceeds to a specific question by index. ```json { "type": "specific_question", "index": 2 } ```
- conditions
- appearance
- start_datestring
- end_datestring
- archivedboolean
- responses_limitinteger
- iteration_countinteger
- iteration_frequency_daysinteger
- iteration_start_datesarray
- current_iterationinteger
- current_iteration_start_datestring
- response_sampling_start_datestring
- response_sampling_interval_type
- response_sampling_intervalinteger
- response_sampling_limitinteger
- response_sampling_daily_limits
- enable_partial_responsesboolean
- _create_in_folderstring
Example request
POST
/api /projects /:project_id /surveys /:id /summarize_responses
Example response
Status 200 No response body
Retrieve surveys activity
Required API key scopes
activity_log:read
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Example request
GET
/api /projects /:project_id /surveys /activity
Example response
Status 200 No response body
Retrieve surveys responses count
Required API key scopes
survey:read
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Example request
GET
/api /projects /:project_id /surveys /responses_count
Example response
Status 200 No response body
Retrieve surveys stats
Get aggregated response statistics across all surveys.
Args: date_from: Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z) date_to: Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)
Returns: Aggregated statistics across all surveys including total counts and rates
Required API key scopes
survey:read
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Example request
GET
/api /projects /:project_id /surveys /stats