List Sessions
List Sessions within the workspace of your API key.
/anthropic/v1/sessions◐ PartialOfficial Claude documentation ↗
Request parameters
agent_idstring可选query: Filter results by agent ID.
agent_versionnumber可选query: Filter by agent version; only applies when agent_id is also set.
created_at[gt]string可选query: Return records created strictly after this time.
created_at[gte]string可选query: Return records created at or after this time.
created_at[lt]string可选query: Return records created strictly before this time.
created_at[lte]string可选query: Return records created at or before this time.
deployment_idstring可选query: Deployment ID (path or query parameter).
include_archivedboolean可选query: Whether to include archived records.
memory_store_idstring可选query: Memory store ID (path or query parameter).
orderstring可选query: Order by creation time: asc oldest first, desc newest first (default).
▸ 更多参数(3)
statusesarray可选query: Filter by session status; repeat the parameter to match several.
limitnumber可选query: Maximum number of items per page.
pagestring可选query: Pagination cursor taken from the previous response's next_page.
Returns
200
Supports limit, page and agent_id. agent_version, time ranges, deployment_id, memory_store_id, include_archived, order and statuses are not supported and return 400.
Errors follow the Claude Managed Agents format — see error codes
Response
HTTP 200
Successful response
application/json
| Name | Type | Description |
|---|---|---|
| data | array<object> | |
| data[].id | string | |
| data[].agent | object | Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].environment_id | string | |
| data[].metadata | object | |
| data[].outcome_evaluations | array<object> | Per-outcome evaluation state. One entry per `define_outcome` event sent to the session. |
| data[].resources | array<object> | |
| data[].stats | object | Timing statistics for a session. |
| data[].status | string | SessionStatus enum - `rescheduling` - Transient error occurred, retrying automatically. - `running` - Agent is actively executing. - `idle` - Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle. - `terminated` - Session has ended, either due to an error or completion. |
| data[].title | null | string | |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].usage | object | Cumulative token usage for a session across all turns. |
| data[].vault_ids | array<string> | Vault IDs attached to the session at creation. Empty when no vaults were supplied. |
| data[].deployment_id | null | string | Deployment ID when the session was created from a deployment reference. Null otherwise. |
| next_page | string | null |