Request a response data export
const url = 'https://app.surveyrock.com/api/v1/surveys/example/exports';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"format":"csv","filters":{},"options":{},"pii_level":"anonymized"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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’.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Survey ID to export responses from
Request Bodyrequired
Section titled “Request Bodyrequired”object
Export file format
Filter criteria for response subset
object
Format-specific export options
object
PII inclusion level. ‘full’ triggers confirmation gate.
Responses
Section titled “Responses”Export completed synchronously (small dataset)
object
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": true, "data": { "status": "ready" }, "meta": { "version": "3.0" }}Export queued for async processing
object
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": true, "data": { "status": "queued" }, "meta": { "version": "3.0" }}Invalid request
Standard error response format
object
object
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
Human-readable error message
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
Whether retrying the identical request might succeed without any change on the caller’s end
Additional, code-specific error details
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}Survey not found
Standard error response format
object
object
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
Human-readable error message
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
Whether retrying the identical request might succeed without any change on the caller’s end
Additional, code-specific error details
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}Confirmation required (full PII export)
Standard error response format
object
object
Stable, snake_case domain code – see ApiErrorHandler::EXCEPTION_MAP and DomainException
Human-readable error message
Imperative recovery hint for this domain code – see ApiErrorHandler::DOMAIN_CODE_SUGGESTIONS
Whether retrying the identical request might succeed without any change on the caller’s end
Additional, code-specific error details
object
Standard response metadata
object
Response timestamp in ISO 8601 format
API version
Unique request identifier
Example
{ "success": false, "error": { "code": "survey_not_found" }, "meta": { "version": "3.0" }}