List Message Batches

Changed on

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

Request

  • Base URL
    https://api.anthropic.com
  • Auth
    none declared

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.

after_idstring

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.

Headers

anthropic-versionstring

The version of the Claude API you want to use.

Read more about versioning and our version history here.

anthropic-workspace-idstring

Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).

Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that 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"
    }
  ]
}

Changes

    • warning

      deleted the header request parameter x-api-key

    • breaking

      the response's property type changed from no type to object for status

    • info

      added the optional property / to the response with the status

    • info

      removed discriminator from response property for the response status

    • info

      removed from the response property oneOf list for the response status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status