Admin/Create Survey
POST /v1/admin/surveys

Create Survey

Base URL https://api.{cluster}.{platform}.voiger.io
Request · cURL
curl -X POST https://api.{cluster}.{platform}.voiger.io/v1/admin/surveys \
  -H "Cookie: sid=$VOIGER_SESSION" \
  -H "x-workspace-code: your-workspace-code" \
  -H "x-csrf-token: $CSRF_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "survey": {
         "name": "Post-Call Support Survey",
         "status": "active",
         "config": {
           "repeat_key": "*",
           "termination_key": "#",
           "timeout": 8,
           "max_attempts": 1
         },
         "messages": {
           "invalid": {
             "mode": "tts",
             "tts": {
               "text": "Sorry, that was not a valid choice.",
               "language": "en"
             }
           },
           "repeat": {
             "mode": "tts",
             "tts": {
               "text": "Press star to repeat this question.",
               "language": "en"
             }
           },
           "thank_you": {
             "mode": "tts",
             "tts": {
               "text": "Thank you for your feedback.",
               "language": "en"
             }
           },
           "timeout": {
             "mode": "audio",
             "audio": {
               "id": "8a8c0f4e-1234-4abc-9de0-001122334455"
             }
           }
         },
         "outbound_enabled": true,
         "questions": [
           {
             "sequence": 1,
             "title": "Overall experience",
             "type": "csat",
             "mode": "tts",
             "tts": {
               "text": "Rate your experience from 1 to 5.",
               "language": "en"
             },
             "opt_for_agent_performance": true
           },
           {
             "sequence": 2,
             "title": "Issue resolved?",
             "type": "binary",
             "mode": "audio",
             "audio": {
               "id": "8a8c0f4e-1234-4abc-9de0-001122334455"
             }
           },
           {
             "sequence": 3,
             "title": "Recommendation",
             "type": "custom",
             "mode": "tts",
             "tts": {
               "text": "Rate from 1 to 10.",
               "language": "en"
             },
             "scale_min": 1,
             "scale_max": 10,
             "classification": [
               {
                 "label": "Poor",
                 "from": 1,
                 "to": 4,
                 "sentiment": "negative"
               },
               {
                 "label": "Average",
                 "from": 5,
                 "to": 7,
                 "sentiment": "neutral"
               },
               {
                 "label": "Excellent",
                 "from": 8,
                 "to": 10,
                 "sentiment": "positive"
               }
             ]
           },
           {
             "sequence": 4,
             "title": "Anything we could improve?",
             "type": "voice",
             "mode": "tts",
             "tts": {
               "text": "Tell us what we could improve. Record after the beep.",
               "language": "en"
             }
           }
         ]
       }
     }'

Parameters

x-workspace-code string required in header
x-csrf-token string required in header

Response

survey▾
object
id
string
name
string
status
string
config▾
object
repeat_key
string
termination_key
string
timeout
integer
max_attempts
integer
messages▾
object
invalid▾
object
mode
string
tts▾
object
text
string
language
string
audio▾
object
id
string Audio attachment UUID. Use the dedicated stream route to fetch the audio bytes.
repeat▾
object
mode
string
tts▾
object
text
string
language
string
audio▾
object
id
string Audio attachment UUID. Use the dedicated stream route to fetch the audio bytes.
thank_you▾
object
mode
string
tts▾
object
text
string
language
string
audio▾
object
id
string Audio attachment UUID. Use the dedicated stream route to fetch the audio bytes.
timeout▾
object
mode
string
tts▾
object
text
string
language
string
audio▾
object
id
string Audio attachment UUID. Use the dedicated stream route to fetch the audio bytes.
outbound_enabled
boolean
questions▾
array
id
string
sequence
integer
title
string
type
string
mode
string
tts▾
object
text
string
language
string
audio▾
object
id
string Audio attachment UUID. Use the dedicated stream route to fetch the audio bytes.
scale_min
null | integer
scale_max
null | integer
classification▾
null | array
label
string
from
integer
to
integer
sentiment
string
opt_for_agent_performance
boolean Only ever true for `type = "csat"` questions; always false for other types.
created_at
string
updated_at
string