CreateSurvey creates a new survey with an initial draft question set.
POST/api/v1/surveys
The survey starts in draft status. Questions are stored as draft
questions until the survey is published with PublishSurvey, which
snapshots them into an immutable SurveyVersion. Draft surveys cannot
be assigned to campaigns.
Parameters
- name: Required, 1-255 characters, survey title (e.g. "Post-call CSAT").
- description: Optional long-form description shown to authors.
- settings: Optional free-form JSON object for UI/runtime hints such as
{"intro_message": "Thanks for your time", "max_duration_seconds": 120}. - questions: Required, at least one question. Each question must specify
a valid
question_typeand, for choice-type questions, a list of options.
Example
{
"name": "Post-call CSAT",
"description": "Customer satisfaction survey delivered after support calls",
"questions": [
{
"question_type": "rating",
"question_text": "How would you rate your experience?",
"required": true,
"position": 1,
"validation_rules": {"min": 1, "max": 5}
},
{
"question_type": "open_text",
"question_text": "Any additional feedback?",
"required": false,
"position": 2
}
]
}
Response
Returns the created survey with its draft question set.
Errors
- INVALID_ARGUMENT: Missing required fields, invalid question_type, or choice question without options.
- PERMISSION_DENIED: Caller lacks
survey:createpermission.
Request
Responses
- 200
- default
A successful response.
An unexpected error response.