Export survey responses
HTTP status codes and JSON examples for Export surveys via API (POST /api/v1/collectors/api/{collector_uuid}/export).
1. HTTP status codes
| Code | When | Typical message |
|---|---|---|
| 200 | Request processed -some recipients may be accepted and others rejected in the same response | Export completed. |
| 401 | Missing or invalid X-External-Access-Token | External access token is invalid or missing. |
| 403 | Valid token but no survey access | You do not have access to this API collector. |
| 404 | Unknown collector_uuid | Distribution channel not found. |
| 422 | Validation failed (e.g. missing or empty recipients) | The given data was invalid. |
| 409 | Entire request fails -inactive collector or unpublished survey only | Varies by cause |
TIP
Difference from send: Export returns 200 with accepted_count / rejected_count and a per-recipient result (status: accepted or rejected). Email/phone conflicts or duplicates appear as rejected for that row only, not as 409 for the whole call.
For response field descriptions, see the success examples in section 2 below.
2. Example responses
200 -All accepted
{
"success": true,
"message": "Export completed.",
"data": {
"accepted_count": 2,
"rejected_count": 0,
"recipients": [
{
"email": "john1@example.com",
"phone": "+966501234567",
"first_name": "John",
"last_name": "Doe",
"survey_link": "https://cxm.akwad.sa/w/9mtmcor2?h=SdMZx57tsDc",
"status": "accepted"
},
{
"email": "jane2@example.com",
"phone": "+966509876543",
"first_name": null,
"last_name": null,
"survey_link": "https://cxm.akwad.sa/w/9mtmcor2?h=Xk2pQ9mN1wR",
"status": "accepted"
}
]
}
}200 -Mixed (accepted + rejected duplicate)
{
"success": true,
"message": "Export completed.",
"data": {
"accepted_count": 0,
"rejected_count": 2,
"recipients": [
{
"email": "john1@example.com",
"phone": "+966501234567",
"first_name": "John",
"last_name": "Doe",
"survey_link": null,
"status": "rejected",
"error": "Recipient already has an active invite."
},
{
"email": "john1@example.com",
"phone": "+966501234567",
"first_name": "John",
"last_name": "Doe",
"survey_link": null,
"status": "rejected",
"error": "Recipient already has an active invite."
}
]
}
}200 -Same email, different phone (rejected)
{
"success": true,
"message": "Export completed.",
"data": {
"accepted_count": 0,
"rejected_count": 1,
"recipients": [
{
"email": "john1@example.com",
"phone": "+966509999999",
"first_name": "John",
"last_name": "Doe",
"survey_link": null,
"status": "rejected",
"error": "This email is already linked to a different phone number on this collector."
}
]
}
}200 -Same phone, different email (rejected)
{
"success": true,
"message": "Export completed.",
"data": {
"accepted_count": 0,
"rejected_count": 1,
"recipients": [
{
"email": "other@example.com",
"phone": "+966501234567",
"first_name": null,
"last_name": null,
"survey_link": null,
"status": "rejected",
"error": "This phone number is already linked to a different email on this collector."
}
]
}
}200 -Invalid recipient (rejected)
{
"success": true,
"message": "Export completed.",
"data": {
"accepted_count": 1,
"rejected_count": 1,
"recipients": [
{
"email": "bad@example.com",
"phone": null,
"first_name": null,
"last_name": null,
"survey_link": null,
"status": "rejected",
"error": "Recipient must include a valid email and phone number."
},
{
"email": "jane2@example.com",
"phone": "+966509876543",
"first_name": null,
"last_name": null,
"survey_link": "https://cxm.akwad.sa/w/9mtmcor2?h=Xk2pQ9mN1wR",
"status": "accepted"
}
]
}
}409 -Inactive collector
{
"success": false,
"message": "This API collector is inactive."
}422 -Missing recipients
{
"success": false,
"message": "The given data was invalid.",
"errors": {
"recipients": [
"The recipients field is required."
]
}
}INFO
Common per-recipient error values when status is rejected: Recipient already has an active invite. · This email is already linked to a different phone number on this collector. · This phone number is already linked to a different email on this collector. · Recipient must include a valid email and phone number.