Operations
An Operation resource tracks the status of an asynchronous request, such as generating a snapshot or updating or deleting a cohort. When you send a request that Cohorts processes asynchronously, the API returns HTTP 202 Accepted and includes an Operation resource that you can poll to monitor progress.
1curl -X GET 'https://audiences.twilio.com/preview/CohortOperations/cmp_operation_01h9d8r0vte3hz8tykdj329t7r' \2-u $TWILIO_API_KEY:$TWILIO_API_SECRET
Sample response:
1{2"operationId": "cmp_operation_01h9d8r0vte3hz8tykdj329t7r",3"status": "COMPLETED",4"statusUrl": "/preview/CohortOperations/cmp_operation_01h9d8r0vte3hz8tykdj329t7r",5"createdAt": "2026-01-15T10:00:00Z",6"completedAt": "2026-01-15T10:00:04Z",7"resultUrl": "/preview/CohortSnapshots/cmp_cohortsnapshot_01h9d8r0vte3hz8tykdj329t7r",8"result": {9"cohortSnapshotId": "cmp_cohortsnapshot_01h9d8r0vte3hz8tykdj329t7r",10"profileCount": 1542011}12}
| Status | Description |
|---|---|
PENDING | The request is queued for processing. |
RUNNING | Twilio is actively processing the request. |
COMPLETED | The request finished successfully. result and, if applicable, resultUrl are populated. |
FAILED | The request failed. Check the error field for details. |
CANCELLED | The request was cancelled. |
Poll the operation until its status is COMPLETED, FAILED, or CANCELLED. Poll with exponential back-off rather than at a fixed, high-frequency interval.
- Learn about Snapshots.
- See the Cohorts API reference.