Batches
Bulk submission from an uploaded manifest.
POST /v1/batches
Register a batch and get the manifest upload
Reserves a batch and returns a presigned request to upload the manifest
(CSV or JSONL). Upload it, then call POST /v1/batches/{batchId}/start.
Every row goes through the same flow as POST /v1/messages.
- Authentication: API key in the
Authorization: Bearerheader - Scopes: at least one of
batches:write,messages:write - operationId:
createBatch
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | Yes | Client-generated key, scoped to the tenant. Repeating a request with the same key and the same body returns the original response with Idempotent-Replayed: true; the same key with a different body is rejected with 422 idempotency_key_reused. |
Request body (application/json)
| Field | Type | Required | Description |
|---|---|---|---|
format | string (CSV or JSONL) | Yes | JSONL: one SubmitMessageRequest per line. CSV: header row with a required to column; lists use ;. |
bytes | integer | Yes | Exact size of the manifest; the upload is rejected if it differs. |
sha256 | Sha256 | Yes | SHA-256 digest, lowercase hexadecimal. |
name | string | No | Name of the batch, repeated in reports and in the batch.completed event (1 to 128 characters). |
priority | string (BULK or TRANSACTIONAL) | No | Dispatch lane of the rows that do not set options.priority. |
defaults | object | No | Values applied to every row unless the row sets them (options and metadata are merged). Accepts from, replyTo, subject, html, text, attachments, options and metadata. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Replay of an earlier request with the same Idempotency-Key. | CreateBatchResponse |
201 | Batch created. | CreateBatchResponse |
400 | The request is malformed. The body is not valid JSON or not a JSON object, a field is invalid (errors lists each one), a header or query parameter is invalid, or the Content-Type is not application/json where a JSON body is expected (unsupported_media on the control plane). | Problem |
401 | Missing or invalid API key. | Problem |
403 | The API key is not allowed to perform this operation. | Problem |
413 | Manifest larger than the allowed size (manifest_too_large). | Problem |
422 | The request is well formed but cannot be accepted. | Problem |
429 | Rate limit or quota exceeded. | Problem |
503 | A dependency (storage, ledger, vault, renderer or mail service) is temporarily unavailable. Retry after the number of seconds in Retry-After when present. | Problem |
POST /v1/batches/{batchId}/start
Start processing an uploaded manifest
Checks that the uploaded manifest matches the declared size and SHA-256 and
starts processing. Starting a running batch answers 200.
- Authentication: API key in the
Authorization: Bearerheader - Scopes: at least one of
batches:write,messages:write - operationId:
startBatch
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batchId | path | BatchId | Yes | Identifier of the batch. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Already running. | Batch |
202 | Processing started. | Batch |
401 | Missing or invalid API key. | Problem |
403 | The API key is not allowed to perform this operation. | Problem |
404 | The resource does not exist or belongs to another tenant. | Problem |
409 | The batch is finished (batch_not_startable). | Problem |
422 | Manifest missing or different from the declaration (manifest_not_uploaded, manifest_mismatch). | Problem |
429 | Rate limit or quota exceeded. | Problem |
503 | A dependency (storage, ledger, vault, renderer or mail service) is temporarily unavailable. Retry after the number of seconds in Retry-After when present. | Problem |
POST /v1/batches/{batchId}/cancel
Cancel a batch
Stops the execution; no row is processed after the cancellation is recorded.
Canceling a canceled batch answers 200.
- Authentication: API key in the
Authorization: Bearerheader - Scopes: at least one of
batches:write,messages:write - operationId:
cancelBatch
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batchId | path | BatchId | Yes | Identifier of the batch. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Already canceled. | Batch |
202 | Canceled. | Batch |
401 | Missing or invalid API key. | Problem |
403 | The API key is not allowed to perform this operation. | Problem |
404 | The resource does not exist or belongs to another tenant. | Problem |
409 | The batch is finished (batch_not_cancelable). | Problem |
429 | Rate limit or quota exceeded. | Problem |
503 | A dependency (storage, ledger, vault, renderer or mail service) is temporarily unavailable. Retry after the number of seconds in Retry-After when present. | Problem |
GET /v1/batches/{batchId}
Read the state and progress of a batch
Status, counters and progress. When the batch has finished, downloads
carries presigned links to the report and the rejected rows.
- Authentication: API key in the
Authorization: Bearerheader - Scopes: at least one of
batches:read,messages:read - operationId:
getBatch
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batchId | path | BatchId | Yes | Identifier of the batch. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | The batch. | Batch |
401 | Missing or invalid API key. | Problem |
403 | The API key is not allowed to perform this operation. | Problem |
404 | The resource does not exist or belongs to another tenant. | Problem |
429 | Rate limit or quota exceeded. | Problem |
503 | A dependency (storage, ledger, vault, renderer or mail service) is temporarily unavailable. Retry after the number of seconds in Retry-After when present. | Problem |
GET /v1/batches/{batchId}/items
List the outcome of each row
Rows in manifest order, with cursor paging.
- Authentication: API key in the
Authorization: Bearerheader - Scopes: at least one of
batches:read,messages:read - operationId:
listBatchItems
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
batchId | path | BatchId | Yes | Identifier of the batch. |
status | query | string (ACCEPTED or REJECTED) | No | Only rows with this outcome. |
cursor | query | Cursor | No | Opaque pagination token. Do not parse or build it. |
limit | query | integer | No | Maximum number of rows per page, from 1 to 1000 (default 100). |
Responses
| Code | Description | Schema |
|---|---|---|
200 | A page of rows. | BatchItemList |
400 | The request is malformed. The body is not valid JSON or not a JSON object, a field is invalid (errors lists each one), a header or query parameter is invalid, or the Content-Type is not application/json where a JSON body is expected (unsupported_media on the control plane). | Problem |
401 | Missing or invalid API key. | Problem |
403 | The API key is not allowed to perform this operation. | Problem |
404 | The resource does not exist or belongs to another tenant. | Problem |
429 | Rate limit or quota exceeded. | Problem |
503 | A dependency (storage, ledger, vault, renderer or mail service) is temporarily unavailable. Retry after the number of seconds in Retry-After when present. | Problem |