Skip to content

Request a response data export

POST
/surveys/{surveyId}/exports
curl --request POST \
--url https://app.surveyrock.com/api/v1/surveys/example/exports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "format": "csv", "filters": {}, "options": {}, "pii_level": "anonymized" }'

Initiates a response data export. For small datasets (≤1000 responses), returns immediately with status ‘ready’. For larger datasets, queues the export and returns status ‘queued’.

surveyId
required
string

Survey ID to export responses from

Media typeapplication/json
object
format
required

Export file format

string
Allowed values: csv xlsx spss docx pptx
filters

Filter criteria for response subset

object
options

Format-specific export options

object
pii_level

PII inclusion level. ‘full’ triggers confirmation gate.

string
nullable
Allowed values: anonymized full

Export completed synchronously (small dataset)

Media typeapplication/json
object
success
boolean
data
object
export_id
string
status
string
format
string
download_url
string
nullable
created_at
string format: date-time
completed_at
string format: date-time
meta

Standard response metadata

object
timestamp

Response timestamp in ISO 8601 format

string format: date-time
version

API version

string
requestId

Unique request identifier

string
Example
{
"success": true,
"data": {
"status": "ready"
},
"meta": {
"version": "3.0"
}
}

Export queued for async processing

Media typeapplication/json
object
success
boolean
data
object
export_id
string
status
string
meta

Standard response metadata

object
timestamp

Response timestamp in ISO 8601 format

string format: date-time
version

API version

string
requestId

Unique request identifier

string
Example
{
"success": true,
"data": {
"status": "queued"
},
"meta": {
"version": "3.0"
}
}

Invalid request

Media typeapplication/json

Standard error response format

object
success
boolean
error
object
code

Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException

string
message

Human-readable error message

string
suggestion

Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS

string
retryable

Whether retrying the identical request might succeed without any change on the caller’s end

boolean
details

Additional, code-specific error details

object
meta

Standard response metadata

object
timestamp

Response timestamp in ISO 8601 format

string format: date-time
version

API version

string
requestId

Unique request identifier

string
Example
{
"success": false,
"error": {
"code": "survey_not_found"
},
"meta": {
"version": "3.0"
}
}

Survey not found

Media typeapplication/json

Standard error response format

object
success
boolean
error
object
code

Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException

string
message

Human-readable error message

string
suggestion

Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS

string
retryable

Whether retrying the identical request might succeed without any change on the caller’s end

boolean
details

Additional, code-specific error details

object
meta

Standard response metadata

object
timestamp

Response timestamp in ISO 8601 format

string format: date-time
version

API version

string
requestId

Unique request identifier

string
Example
{
"success": false,
"error": {
"code": "survey_not_found"
},
"meta": {
"version": "3.0"
}
}

Confirmation required (full PII export)

Media typeapplication/json

Standard error response format

object
success
boolean
error
object
code

Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException

string
message

Human-readable error message

string
suggestion

Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS

string
retryable

Whether retrying the identical request might succeed without any change on the caller’s end

boolean
details

Additional, code-specific error details

object
meta

Standard response metadata

object
timestamp

Response timestamp in ISO 8601 format

string format: date-time
version

API version

string
requestId

Unique request identifier

string
Example
{
"success": false,
"error": {
"code": "survey_not_found"
},
"meta": {
"version": "3.0"
}
}