Skip to content

Upload responses (JSON array)

POST
/v2/projects/{projectId}/questions/{questionId}/upload/json
curl --request POST \
--url https://api.surveycoder.io/v2/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/questions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/upload/json \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "responses": [ { "id": "example", "text": "example" } ] }'
projectId
required
string format: uuid
questionId
required
string format: uuid
Media type application/json
object
responses
required
Array<object>
object
id
required
string
text
required
string
Example generated
{
"responses": [
{
"id": "example",
"text": "example"
}
]
}

Responses uploaded

Request body failed validation.

Media type application/json

Standard error envelope.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code. See the error reference for the full list.

string
message
required

Human-readable explanation of what went wrong.

string
request_id

Echo of the X-Request-Id header, when provided.

string format: uuid
doc_url

Link to documentation for this specific error code.

string format: uri
Example
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "responses array is required and must not be empty",
"doc_url": "https://docs.surveycoder.io/errors/validation-error"
}
}