Update Survey Template
URL |
Required Values |
HTTP Methods |
|---|---|---|
Template ID |
PATCH |
Partially updates a survey template. Only provided fields are changed. Supports both multipart/form-data and application/json.
Replace <id> with the template ID.
Scenario A — Update name only
Sample Input:
{
"name": "Updated Survey Name"
}
Sample Response (200 OK):
{
"id": 3,
"name": "Updated Survey Name",
"voice": {
"id": 5,
"voice_display_name": "Rijan",
"voice_internal_name": "np_rijan",
"is_premium": false,
"is_beta": false
},
"length_factor": "1.00",
"content": [
{
"order": 0,
"content_type": "say",
"response_type": "dtmf",
"input_name": "rating",
"audio_file": null
}
],
"created_at": "2026-06-02T12:00:00Z"
}
Scenario B — Replace all steps and upload new audio
Sample Request (multipart/form-data):
PATCH /api/v1/survey-templates/3/
Content-Type: multipart/form-data
content=[{"order":0,"content_type":"play","response_type":"raw_record","input_name":"q1"},{"order":1,"content_type":"say","response_type":"dtmf","input_name":"q2"}]
step_0_audio_file=<binary MP3 for step 0>
step_1_audio_file=<binary MP3 for step 1>
Scenario C — Change voice
Sample Input:
{
"voice": { "voice_internal_name": "np_anita" }
}
Note
Voice language must match the user’s account language. Sending a voice from a different language returns 400.
Error Response — Voice language mismatch (400 Bad Request):
{
"voice": "This voice belongs to the 'si' language but your account language is 'np'. Please select a voice that matches your language."
}