v36

latestOpenAPI 3.1.0raw.githubusercontent.com2025-10-091882241.2 MB
messages

List Batches

List all batch runs.

get/v1/messages/batches

Query parameters

beforestring nullable

Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order

Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order

afterstring nullable

Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order

Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order

limitinteger nullable

Maximum number of jobs to return

Maximum number of jobs to return

order'asc' | 'desc'

Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first

Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first

order_by'created_at'

Field to sort by

Field to sort by

Response

Successful Response

created_by_idstring nullable

The id of the user that made this object.

last_updated_by_idstring nullable

The id of the user that made this object.

created_atstring date-time

The unix timestamp of when the job was created.

updated_atstring date-time nullable

The timestamp when the object was last updated.

status'created' | 'running' | 'completed' | 'failed' | 'pending' | 'cancelled' | 'expired'

Status of the job.

completed_atstring date-time nullable

The unix timestamp of when the job was completed.

stop_reason'end_turn' | 'error' | 'llm_api_error' | 'invalid_llm_response' | 'invalid_tool_call' | 'max_steps' | 'no_tool_call' | 'tool_rule' | 'cancelled' | 'requires_approval'
metadataobject nullable

The metadata of the job.

job_type'job' | 'run' | 'batch'
backgroundboolean nullable

Whether the job was created in background mode.

agent_idstring nullable

The agent associated with this job/run.

callback_urlstring nullable

If set, POST to this URL when the job completes.

callback_sent_atstring date-time nullable

Timestamp when the callback was last attempted.

callback_status_codeinteger nullable

HTTP status code returned by the callback endpoint.

callback_errorstring nullable

Optional error message from attempting to POST the callback endpoint.

ttft_nsinteger nullable

Time to first token for a run in nanoseconds

total_duration_nsinteger nullable

Total run duration in nanoseconds

idstring

The human-friendly ID of the Job

Example response

[
  {
    "id": "job-123e4567-e89b-12d3-a456-426614174000"
  }
]