Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

List Batches

get/v1/messages/batches

List all batch runs.

Query ParametersExpand Collapse
after: optional string

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

before: optional string

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

limit: optional number

Maximum number of jobs to return

order: optional "asc" or "desc"

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

Accepts one of the following:
"asc"
"desc"
order_by: optional "created_at"

Field to sort by

Accepts one of the following:
"created_at"
ReturnsExpand Collapse
id: string

The human-friendly ID of the Job

agent_id: optional string

The agent associated with this job/run.

background: optional boolean

Whether the job was created in background mode.

callback_error: optional string

Optional error message from attempting to POST the callback endpoint.

callback_sent_at: optional string

Timestamp when the callback was last attempted.

formatdate-time
callback_status_code: optional number

HTTP status code returned by the callback endpoint.

callback_url: optional string

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

completed_at: optional string

The unix timestamp of when the job was completed.

formatdate-time
created_at: optional string

The unix timestamp of when the job was created.

formatdate-time
created_by_id: optional string

The id of the user that made this object.

job_type: optional JobType
Accepts one of the following:
"job"
"run"
"batch"
last_updated_by_id: optional string

The id of the user that made this object.

metadata: optional map[unknown]

The metadata of the job.

status: optional JobStatus

The status of the job.

Accepts one of the following:
"created"
"running"
"completed"
"failed"
"pending"
"cancelled"
"expired"
stop_reason: optional StopReasonType

The reason why the job was stopped.

Accepts one of the following:
"end_turn"
"error"
"llm_api_error"
"invalid_llm_response"
"invalid_tool_call"
"max_steps"
"no_tool_call"
"tool_rule"
"cancelled"
"requires_approval"
total_duration_ns: optional number

Total run duration in nanoseconds

ttft_ns: optional number

Time to first token for a run in nanoseconds

updated_at: optional string

The timestamp when the object was last updated.

formatdate-time
List Batches
curl https://api.letta.com/v1/messages/batches \
    -H "Authorization: Bearer $LETTA_API_KEY"
[
  {
    "id": "job-123e4567-e89b-12d3-a456-426614174000",
    "agent_id": "agent_id",
    "background": true,
    "callback_error": "callback_error",
    "callback_sent_at": "2019-12-27T18:11:19.117Z",
    "callback_status_code": 0,
    "callback_url": "callback_url",
    "completed_at": "2019-12-27T18:11:19.117Z",
    "created_at": "2019-12-27T18:11:19.117Z",
    "created_by_id": "created_by_id",
    "job_type": "job",
    "last_updated_by_id": "last_updated_by_id",
    "metadata": {
      "foo": "bar"
    },
    "status": "created",
    "stop_reason": "end_turn",
    "total_duration_ns": 0,
    "ttft_ns": 0,
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]
Returns Examples
[
  {
    "id": "job-123e4567-e89b-12d3-a456-426614174000",
    "agent_id": "agent_id",
    "background": true,
    "callback_error": "callback_error",
    "callback_sent_at": "2019-12-27T18:11:19.117Z",
    "callback_status_code": 0,
    "callback_url": "callback_url",
    "completed_at": "2019-12-27T18:11:19.117Z",
    "created_at": "2019-12-27T18:11:19.117Z",
    "created_by_id": "created_by_id",
    "job_type": "job",
    "last_updated_by_id": "last_updated_by_id",
    "metadata": {
      "foo": "bar"
    },
    "status": "created",
    "stop_reason": "end_turn",
    "total_duration_ns": 0,
    "ttft_ns": 0,
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]