POST

Authorizations

x-api-key
string
header
required

Path Parameters

session_id
string
required

The ID of the session (ses_ followed by 26 lowercase base32 characters) that holds the grant, in the workspace the request acts in. Archived sessions are accepted.

grant_id
string
required

The ID of the grant (tgr_ followed by 24 lowercase hexadecimal characters), as listed by GET /v1/sessions/{session_id}/tool_grants. It must be a grant of this session.

Response

The grant after revocation (or as it was, when it was already revoked).

A standing allow of one tool rule for the rest of a session, made by a user.tool_confirmation with result: "allow" and bma_scope: "session". While revoked_at is null, the platform answers allow to every permission request of the session whose call matches tool_name and input_pattern.

type
string
required

Always tool_grant.

Allowed value: "tool_grant"
id
string
required

The grant ID: tgr_ followed by 24 lowercase hexadecimal characters. It is derived from the session and the allowed call, so the same confirmation always names the same grant.

session_id
string
required

The ID of the session (ses_…) the grant belongs to; it covers calls of this session only.

tool_name
string
required

The name of the tool the grant covers, as in the name of the agent.tool_use or agent.mcp_tool_use event that was allowed (for example bash, web_fetch). Calls are matched by this name only.

input_pattern
string
required

Which inputs of the tool the grant covers. An empty string for every tool except bash: any input. For bash, <program>:* when the allowed command was one program with plain arguments (no ;, &, |, $, backquotes, <, >, *, ?, parentheses, brackets, braces, ~, backslash or line break, no variable assignment or quotes in the program, and a program that does not run another one, such as sudo, env, xargs, sh, bash or ssh): it covers every such simple command of that program. Otherwise the exact command, without its leading and trailing whitespace, and only that command is covered; an allowed bash call with an empty or missing command gives an empty string, which then covers only an empty command.

granted_at
string<date-time>
required

When the confirmation that made the grant was accepted (RFC 3339, UTC).

granted_by
string | null
required

The ID of the user or organization API key whose user.tool_confirmation made the grant. Always set on BMA.

tool_use_id
string
required

The ID of the tool call event (sevt_…, an agent.tool_use or agent.mcp_tool_use) whose confirmation made the grant.

revoked_at
string<date-time> | null
required

When the grant was revoked (RFC 3339, UTC); null while it is active. A later revocation keeps the first time.

revoked_by
string | null
required

The ID of the user or organization API key that revoked the grant; null while it is active.