Create a batch operation
/operations/batchesCreates an asynchronous batch operation. All items in the batch are processed with the same operation type, which also determines the structure of each item's payload.
The operation is accepted with a Location header pointing to it and processed asynchronously. Poll the retrieve operation to track its progress.
In addition to operations.manage, the credential must have the permission required by the selected operation type. Repeating the request with the same Idempotency-Key returns the same operation instead of creating a new one.
The request is rejected with operation_type_unknown for an unsupported type, duplicate_item_key when item keys are not unique, too_many_items when the batch exceeds the maximum number of items for the type, and operation_backlog_exceeded when the account has too many unfinished operations.
Autonomous mode: the API credential secret, sent as a bearer token. Credential secrets are identified by a fixed prefix.
In: header
Header Parameters
Client-generated key that makes the request safe to retry. Must be 1 to 128 characters from [A-Za-z0-9._:-]. Required by this operation: a missing key returns idempotency_key_required, and a malformed key returns idempotency_key_invalid. Repeating the request with the same key and the same body returns the stored result with Idempotent-Replayed: true.
Optional client-generated identifier of the request, up to 64 characters from [A-Za-z0-9._-]. Echoed back in the response and recorded in the request log; it never replaces the server-generated X-Request-Id.
length <= 64Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/operations/batches" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "items": [ { "key": "string", "payload": {} } ], "type": "string" }'{ "data": { "attempt": { "number": 0, "status": "running" }, "cancellation_requested": true, "created_at": "2019-08-24T14:15:22Z", "error": { "code": "worker_error", "field": "string", "message": "string", "reason": "string", "resource_id": "string" }, "expires_at": "2019-08-24T14:15:22Z", "finished_at": "2019-08-24T14:15:22Z", "id": "string", "items_url": "string", "object": "operation", "progress": { "done": 0, "failed": 0, "total": 0 }, "result_url": "string", "started_at": "2019-08-24T14:15:22Z", "status": "queued", "type": "string" }}List operations GET
Lists the asynchronous operations of the current account, using cursor-based pagination. The collection can be filtered by status and type and sorted by creation date.
Retrieve an operation GET
Retrieves the status and progress of an asynchronous operation. Poll this endpoint until the operation reaches a terminal status: `succeeded`, `partially_succeeded`, `failed`, or `canceled`.