Skip to content

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

CodeWhenTypical message
200Request processed -some recipients may be accepted and others rejected in the same responseExport completed.
401Missing or invalid X-External-Access-TokenExternal access token is invalid or missing.
403Valid token but no survey accessYou do not have access to this API collector.
404Unknown collector_uuidDistribution channel not found.
422Validation failed (e.g. missing or empty recipients)The given data was invalid.
409Entire request fails -inactive collector or unpublished survey onlyVaries 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

HTTP 200
{
  "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)

HTTP 200 -duplicate active invite
{
  "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)

HTTP 200 -email / phone conflict
{
  "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)

HTTP 200 -phone / email conflict
{
  "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)

HTTP 200 -invalid recipient
{
  "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

HTTP 409
{
  "success": false,
  "message": "This API collector is inactive."
}

422 -Missing recipients

HTTP 422
{
  "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.


← Export request fields · JavaScript & PHP examples →

AKWAD CXM - help center