List Message Batches
api/beta/messages/batches/list
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/beta/messages/batches/list Changed · +33 / -16 lines
# List Message Batches ## Query parameters ## Headers ## Returns ## Example ### Response (200) ## List Message Batches ### Query Parameters ### Header Parameters ### Returns ### Example #### Response
---- -title: List Message Batches -url: https://platform.claude.com/docs/en/api/beta/messages/batches/list ---- +# List Message Batches -## List Message Batches +**GET** `/v1/messages/batches` -**get** `/v1/messages/batches` - List all Message Batches within a Workspace. Most recently created batches are returned first. Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing) -### Query Parameters +## Query parameters - `after_id: optional string`
Defaults to `20`. Ranges from `1` to `1000`. -### Header Parameters + default: 20, maximum: 1000, minimum: 1 +## Headers + - `"anthropic-beta": optional array of AnthropicBeta` Optional header to specify the beta version(s) you want to use.
- `"mid-conversation-tool-changes-2026-07-01"` -### Returns +## Returns - `data: array of BetaMessageBatch`
RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable. + format: date-time + - `cancel_initiated_at: string or null` RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated. + format: date-time + - `created_at: string` RFC 3339 datetime string representing the time at which the Message Batch was created. + format: date-time + - `ended_at: string or null` RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.
Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired. + format: date-time + - `expires_at: string` RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation. + format: date-time + - `processing_status: "in_progress" or "canceling" or "ended"` Processing status of the Message Batch.
This is zero until processing of the entire Message Batch has ended. + default: 0 + - `errored: number` Number of requests in the Message Batch that encountered an error.
This is zero until processing of the entire Message Batch has ended. + default: 0 + - `expired: number` Number of requests in the Message Batch that have expired.
This is zero until processing of the entire Message Batch has ended. + default: 0 + - `processing: number` Number of requests in the Message Batch that are processing. + default: 0 + - `succeeded: number` Number of requests in the Message Batch that have completed successfully.
This is zero until processing of the entire Message Batch has ended. + default: 0 + - `results_url: string or null` URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.
For Message Batches, this is always `"message_batch"`. - - `"message_batch"` + default: message_batch - `first_id: string or null`
Last ID in the `data` list. Can be used as the `after_id` for the next page. -### Example +## Example -```http +```bash curl https://api.anthropic.com/v1/messages/batches \ -H 'anthropic-version: 2023-06-01' \ -H 'anthropic-beta: message-batches-2024-09-24' \
-H "X-Api-Key: $ANTHROPIC_API_KEY" ``` -#### Response +### Response (200) ```json {