curl -sS "$BMA_BASE_URL/v1/sessions?limit=50&page=ZGVzYzpuZXh0OnNlc19hZ3JheTRvNTc1eXk1ZzR5MnpqbXVhbzQ1aQ&agent_id=aprf_agray4o575yzni6unfhge6obhm&agent_version=3&created_at[gt]=2026-11-01T00:00:00Z&created_at[gte]=2026-11-01T00:00:00Z&created_at[lt]=2026-12-01T00:00:00Z&created_at[lte]=2026-12-01T00:00:00Z&include_archived=true&memory_store_id=memstore_agray4o575y4zckecjdn4hdbsy&order=asc" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"data": [
{
"type": "session",
"id": "ses_agray4o575ytrcguudsrm73sbq",
"agent": {
"type": "agent",
"id": "aprf_agray4o575yzni6unfhge6obhm",
"version": 3,
"name": "Report writer",
"description": "Drafts quarterly reports from uploaded data.",
"system": "You write concise business reports. Cite the data files you used.",
"model": {
"id": "claude-sonnet-4-5",
"effort": {
"type": "medium"
}
},
"tools": [
{
"type": "agent_toolset_20260401",
"configs": [],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
}
}
],
"mcp_servers": [],
"skills": [
{
"type": "custom",
"skill_id": "skl_agray4o575y4tdjvgdeqmbgziq",
"version": "skr_agray4o575y4vasjf3qab2luki",
"id": "skl_agray4o575y4tdjvgdeqmbgziq"
}
],
"multiagent": null,
"execution_identity": {
"type": "service_account"
}
},
"environment_id": "env_agray4o575yzvcl662kzmeilr4",
"title": "Q3 revenue report",
"status": "idle",
"metadata": {
"ticket": "OPS-1423"
},
"resources": [
{
"type": "file",
"id": "sesrsc_agray4o575y2tf6tmq6q5dsobq",
"file_id": "file_agray4o575y2dgcykoagz7tdfy",
"mount_path": "/mnt/session/uploads/data/q3.csv",
"created_at": "2026-11-24T07:12:03.418211Z",
"updated_at": "2026-11-24T07:12:03.418211Z"
}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_read_input_tokens": 0,
"cache_creation": {
"ephemeral_5m_input_tokens": 0,
"ephemeral_1h_input_tokens": 0
},
"list_cost": {
"amount": "0",
"currency": "USD"
},
"server_tool_use": {
"web_search_requests": 0,
"web_fetch_requests": 0
},
"active_seconds": 0
},
"stats": {
"active_seconds": 0,
"duration_seconds": 12.5
},
"vault_ids": [
"vlt_agray4o575yz5pfpymedzfznb4"
],
"budget": null,
"outcome_evaluations": [],
"deployment_id": null,
"created_at": "2026-11-24T07:12:03.418211Z",
"updated_at": "2026-11-24T07:12:03.418211Z",
"archived_at": null
}
],
"next_page": "ZGVzYzpuZXh0OnNlc19hZ3JheTRvNTc1eXk1ZzR5MnpqbXVhbzQ1aQ",
"prev_page": null
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}List Sessions
Lists the sessions of the workspace, newest first by default (order=asc for oldest first), ordered by created_at and then by ID. Archived sessions are left out unless include_archived=true; deleted sessions never appear. The filters combine: agent_id (narrowed further by agent_version), deployment_id, memory_store_id (sessions that mount that memory store), statuses, the created_at bounds, and repeated metadata=key:value (or metadata[]=key:value) exact key-value containment filters (only sessions whose metadata contains every pair). A page holds up to limit sessions; next_page is set when more sessions follow, prev_page on a page reached with a cursor, and either is passed back as page with the same order. List items leave out the bma_model_override extension: retrieve a session to read it. Read-only.
Authorization: Organization API key (x-api-key: bma_org_v1_…), personal access token (Authorization: Bearer bma_pat_v1_…), OAuth access token or signed-in dashboard session; a user credential names its organization with bma-organization-id. The request acts in one workspace: the one named by bma-workspace-id (or anthropic-workspace-id; when both are sent they must agree), else the credential’s default workspace (an API key’s own workspace, else its organization’s Default workspace), else the only workspace the credential can use. Every workspace role may call it (viewer included); organization owners and admins act as workspace admins in every workspace of their organization.
Limits:
limit: default 20, maximum 100 sessions per page.metadatafilter: at most 16 pairs, keys 1-64 characters without NUL, values at most 512 characters without NUL.- Rate limit: one request of the organization’s read budget (Rate limits).
Errors (besides the common errors (401 authentication, 429 rate_limited, 500)):
| Status | error.type | error.code | Cause | Fix |
|---|---|---|---|---|
| 400 | invalid_request_error | organization_required | A user credential (personal access token, OAuth token, dashboard session) names no organization. | Name the organization with the bma-organization-id header. |
| 400 | invalid_request_error | project_required | The credential can use several workspaces and the request names none. | Name the workspace with the bma-workspace-id header. |
| 400 | invalid_request_error | unsupported | memory_store_id is sent with an empty value. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 400 | invalid_request_error | workspace_id_conflict | bma-workspace-id and anthropic-workspace-id name different workspaces. | Correct the request as the message describes and send it again; the same request will keep failing. |
curl -sS "$BMA_BASE_URL/v1/sessions?limit=50&page=ZGVzYzpuZXh0OnNlc19hZ3JheTRvNTc1eXk1ZzR5MnpqbXVhbzQ1aQ&agent_id=aprf_agray4o575yzni6unfhge6obhm&agent_version=3&created_at[gt]=2026-11-01T00:00:00Z&created_at[gte]=2026-11-01T00:00:00Z&created_at[lt]=2026-12-01T00:00:00Z&created_at[lte]=2026-12-01T00:00:00Z&include_archived=true&memory_store_id=memstore_agray4o575y4zckecjdn4hdbsy&order=asc" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"data": [
{
"type": "session",
"id": "ses_agray4o575ytrcguudsrm73sbq",
"agent": {
"type": "agent",
"id": "aprf_agray4o575yzni6unfhge6obhm",
"version": 3,
"name": "Report writer",
"description": "Drafts quarterly reports from uploaded data.",
"system": "You write concise business reports. Cite the data files you used.",
"model": {
"id": "claude-sonnet-4-5",
"effort": {
"type": "medium"
}
},
"tools": [
{
"type": "agent_toolset_20260401",
"configs": [],
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
}
}
],
"mcp_servers": [],
"skills": [
{
"type": "custom",
"skill_id": "skl_agray4o575y4tdjvgdeqmbgziq",
"version": "skr_agray4o575y4vasjf3qab2luki",
"id": "skl_agray4o575y4tdjvgdeqmbgziq"
}
],
"multiagent": null,
"execution_identity": {
"type": "service_account"
}
},
"environment_id": "env_agray4o575yzvcl662kzmeilr4",
"title": "Q3 revenue report",
"status": "idle",
"metadata": {
"ticket": "OPS-1423"
},
"resources": [
{
"type": "file",
"id": "sesrsc_agray4o575y2tf6tmq6q5dsobq",
"file_id": "file_agray4o575y2dgcykoagz7tdfy",
"mount_path": "/mnt/session/uploads/data/q3.csv",
"created_at": "2026-11-24T07:12:03.418211Z",
"updated_at": "2026-11-24T07:12:03.418211Z"
}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_read_input_tokens": 0,
"cache_creation": {
"ephemeral_5m_input_tokens": 0,
"ephemeral_1h_input_tokens": 0
},
"list_cost": {
"amount": "0",
"currency": "USD"
},
"server_tool_use": {
"web_search_requests": 0,
"web_fetch_requests": 0
},
"active_seconds": 0
},
"stats": {
"active_seconds": 0,
"duration_seconds": 12.5
},
"vault_ids": [
"vlt_agray4o575yz5pfpymedzfznb4"
],
"budget": null,
"outcome_evaluations": [],
"deployment_id": null,
"created_at": "2026-11-24T07:12:03.418211Z",
"updated_at": "2026-11-24T07:12:03.418211Z",
"archived_at": null
}
],
"next_page": "ZGVzYzpuZXh0OnNlc19hZ3JheTRvNTc1eXk1ZzR5MnpqbXVhbzQ1aQ",
"prev_page": null
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}Query Parameters
Keep the sessions in any of these statuses. Repeat the parameter (statuses=idle&statuses=running), use statuses[], or separate values with commas. rescheduling is accepted but never matches: BMA sessions are idle, running or terminated. An unknown value is refused with 400.
rescheduling, running, idle, terminated Response
Success.