v49

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-261319281.7 MB

List Message 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

get/v1/messages/batches

Query parameters

before_idstring

ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

after_idstring

ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

limitinteger

Number of items to return per page.

Defaults to 20. Ranges from 1 to 1000.

Number of items to return per page.

Defaults to 20. Ranges from 1 to 1000.

Headers

anthropic-versionstring

The version of the Claude API you want to use.

Read more about versioning and our version history here.

The version of the Claude API you want to use.

Read more about versioning and our version history here.

x-api-keystring

Your unique API key for authentication.

This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the Console. Each key is scoped to a Workspace.

Your unique API key for authentication.

This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the Console. Each key is scoped to a Workspace.

Response

Successful Response

first_idstring nullable required

First ID in the data list. Can be used as the before_id for the previous page.

has_moreboolean required

Indicates if there are more results in the requested page direction.

last_idstring nullable required

Last ID in the data list. Can be used as the after_id for the next page.

Example response

{
  "data": [
    {
      "archived_at": "2024-08-20T18:37:24.100435Z",
      "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
      "created_at": "2024-08-20T18:37:24.100435Z",
      "ended_at": "2024-08-20T18:37:24.100435Z",
      "expires_at": "2024-08-20T18:37:24.100435Z",
      "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
      "processing_status": "in_progress",
      "request_counts": {
        "canceled": 10,
        "errored": 30,
        "expired": 10,
        "processing": 100,
        "succeeded": 50
      },
      "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results"
    }
  ]
}