Get loyalty points export status
Check whether an export has completed and read its row count and file size.
- Method
- GET
- Path
https://api.returning.ai / v1/ loyalty-exports/ {exportId} - Permission
- customerSuccess
- Retries
- Read-only; poll with a growing delay.
When to use this
- Poll after requesting an export.
- Check whether a failed or expired report needs a new request.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- customerSuccessShown in the dashboard as Customer Success.
Use a Community API key with customerSuccess, shown as Customer Success in the dashboard. Keep the key on your backend and send Authorization: Bearer <API_KEY>. The key selects the community; do not send a community ID. Personal API keys are not supported.
All three calls use https://api.returning.ai and return Cache-Control: no-store. They accept no query parameters. A valid community key with the required permission can read that community's export jobs, including jobs created by another key in the same community.
Successful responses contain meta, message and data. Read job state from data.status. An HTTP 200 means the status request succeeded, even when the job is failed. Errors put their machine-readable code in meta.code; do not branch on message.
Behaviour#
data.status | What to do |
|---|---|
queued | Wait for processing. |
processing | Continue polling with backoff. |
completed | Read total_rows and file_size_bytes, then request a download link. |
failed | Read data.error. Contact support or correct the cause before deliberately creating another job. |
cancelled | No file is available. There is no public cancellation endpoint in this family. |
expired | Create a new export if you still need the file. |
Polling and recovery
Poll one known ID with increasing delays rather than creating another export. A client may choose a time budget and resume later using the saved ID. Reaching your own time budget does not cancel the job.
| Situation | Action |
|---|---|
Still queued or processing | Wait and poll with backoff. If unusually long, contact support with the export ID and meta.requestId. |
HTTP 200 with failed | The status lookup succeeded, but the export failed. Read data.error; investigate the input or contact support before deliberately requesting a new job. |
cancelled | Stop polling; this family provides no public cancel or restart operation. |
expired | Start a deliberately new export if the file is still needed. Replaying the original create does not refresh it. |
| HTTP 404 | Check the saved ID and the key's community. A malformed ID and an inaccessible ID both use EXPORT_NOT_FOUND. |
| HTTP 401 or 403 | Correct the Community API key or its Customer Success permission before retrying. |
| Network error or HTTP 5xx | Retry the same GET with backoff. Do not create a replacement export merely because a status read failed. |
Request#
Path parameters#
Rule24 hex characters
Eg66f000000000000000000701
Headers#
RuleBearer <API_KEY>
curl --request GET \
--url https://api.returning.ai/v1/loyalty-exports/66f000000000000000000701 \
--header 'Authorization: Bearer <API_KEY>'
Response#
export_id, status, dataset, format, created_at and coverage are always present. Only completed jobs include total_rows and file_size_bytes. A failed job adds error: {"code":"EXPORT_FAILED","message":"The export could not be completed."}. Other states omit these optional fields.
A completed empty export has total_rows: 0, a header-only CSV or an empty JSON array. It is not a list of customers with zero balances. No progress percentage, checksum, expiry timestamp, original filters or detailed failure reason is returned by this status endpoint.
Unknown IDs, malformed IDs and exports outside the authenticated community return 404 EXPORT_NOT_FOUND. Failed and expired jobs that still exist return HTTP 200 with their job state.
Eg{ ... }
Rulesuccess
Eg200
Eg"example-request"
Eg"Loyalty export status success."
Eg{ ... }
Eg"66f000000000000000000701"
Rulequeued, processing, completed, failed, cancelled or expired
Eg"completed"
Rulepoints_transactions
Rulecsv or json
Eg"csv"
Eg"2026-09-03T01:00:00.000Z"
Ruleobserved_history_only
Eg4
Eg640
{
"meta": {
"status": "success",
"statusCode": 200,
"requestId": "example-request"
},
"message": "Loyalty export status success.",
"data": {
"export_id": "66f000000000000000000701",
"status": "completed",
"dataset": "points_transactions",
"format": "csv",
"created_at": "2026-09-03T01:00:00.000Z",
"coverage": "observed_history_only",
"total_rows": 4,
"file_size_bytes": 640
}
}
Errors#
Fix the request07
VALIDATION_ERRORFix the requestAUTHENTICATION_REQUIREDFix the requestAPI_KEY_PERMISSION_DENIEDFix the requestCOMMUNITY_ACCESS_DENIEDFix the requestFix the data03
COMMUNITY_NOT_FOUNDFix the dataEXPORT_NOT_FOUNDFix the dataRetry with backoff03
EXPORTS_UNAVAILABLERetry with backoffAUTHENTICATION_FAILEDRetry with backoff{
"meta": {
"status": "error",
"statusCode": 400,
"code": "VALIDATION_ERROR",
"requestId": "req_example"
},
"message": "Loyalty export request error.",
"detail": "Invalid request or unsupported query parameters."
}