curl -sS "$BMA_BASE_URL/v1/sessions/ses_agray3h7xf3w5ihioo7wojxbd4/tool_grants" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"data": [
{
"type": "tool_grant",
"id": "tgr_3f9a1c7e5b2d4086a1e9c3b7",
"session_id": "ses_agray3h7xf3w5ihioo7wojxbd4",
"tool_name": "bash",
"input_pattern": "npm:*",
"granted_at": "2026-11-24T07:12:03.418211Z",
"granted_by": "0193f0b2-6c1d-7a4e-9b2f-5d8e3a1c7f40",
"tool_use_id": "sevt_agray3h7xf3xvh3ikvm2dxwz6u",
"revoked_at": null,
"revoked_by": null
},
{
"type": "tool_grant",
"id": "tgr_8d2e6b4a0c9f17e35b8a2d6c",
"session_id": "ses_agray3h7xf3w5ihioo7wojxbd4",
"tool_name": "web_fetch",
"input_pattern": "",
"granted_at": "2026-11-24T07:20:41.902556Z",
"granted_by": "0193f0b2-6c1d-7a4e-9b2f-5d8e3a1c7f40",
"tool_use_id": "sevt_agray3h7xf3x3lryoqtyfltwou",
"revoked_at": "2026-11-24T08:02:17.115034Z",
"revoked_by": "0193f0b2-6c1d-7a4e-9b2f-5d8e3a1c7f40"
}
],
"next_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 a session's tool grants
Lists the tool grants of a session. A grant is made when a user answers a permission request with a user.tool_confirmation event whose result is allow and bma_scope is session. While a grant is active, the platform itself answers allow to every later permission request of the same session that the grant covers (see tool_name and input_pattern): that user.tool_confirmation carries bma_responder: "platform" and the grant’s ID in bma_tool_grant_id, and the turn does not stop at requires_action. Revoked grants stay in the list with revoked_at set. The answer holds every grant of the session in one page, oldest first (by granted_at, then id); the endpoint takes no limit or cursor parameter and next_page is always null. An archived session’s grants are listed as well. Read-only: it changes nothing and is naturally idempotent. A session that does not exist, was deleted or belongs to another workspace answers 404 not_found_error without an error.code.
Authorization: An organization API key (x-api-key: bma_org_v1_…), a personal access token (Authorization: Bearer bma_pat_v1_…), an OAuth access token or a signed-in dashboard user; a user credential names its organization with the bma-organization-id header. The request acts in one workspace: the one named by bma-workspace-id (or anthropic-workspace-id), otherwise the credential’s default workspace, otherwise its only workspace. The session must belong to that workspace. Every workspace role may list (viewer, operator, developer, admin); organization owners and admins act as workspace admins in every workspace of their organization.
Limits:
- No limits specific to this endpoint.
- 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 user) names no organization. | Send the bma-organization-id header. |
| 400 | invalid_request_error | project_required | No usable workspace could be selected: the request names none, and the credential has no default workspace it may use and more than one workspace. | Send the bma-workspace-id header with the session’s workspace. |
| 400 | invalid_request_error | workspace_id_conflict | bma-workspace-id and anthropic-workspace-id are both sent and 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/ses_agray3h7xf3w5ihioo7wojxbd4/tool_grants" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"data": [
{
"type": "tool_grant",
"id": "tgr_3f9a1c7e5b2d4086a1e9c3b7",
"session_id": "ses_agray3h7xf3w5ihioo7wojxbd4",
"tool_name": "bash",
"input_pattern": "npm:*",
"granted_at": "2026-11-24T07:12:03.418211Z",
"granted_by": "0193f0b2-6c1d-7a4e-9b2f-5d8e3a1c7f40",
"tool_use_id": "sevt_agray3h7xf3xvh3ikvm2dxwz6u",
"revoked_at": null,
"revoked_by": null
},
{
"type": "tool_grant",
"id": "tgr_8d2e6b4a0c9f17e35b8a2d6c",
"session_id": "ses_agray3h7xf3w5ihioo7wojxbd4",
"tool_name": "web_fetch",
"input_pattern": "",
"granted_at": "2026-11-24T07:20:41.902556Z",
"granted_by": "0193f0b2-6c1d-7a4e-9b2f-5d8e3a1c7f40",
"tool_use_id": "sevt_agray3h7xf3x3lryoqtyfltwou",
"revoked_at": "2026-11-24T08:02:17.115034Z",
"revoked_by": "0193f0b2-6c1d-7a4e-9b2f-5d8e3a1c7f40"
}
],
"next_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>"
}Path Parameters
Response
Every grant of the session, oldest first, in one page.