curl -sS -X POST "$BMA_BASE_URL/v1/sessions/ses_agray4o575ytrcguudsrm73sbq/bma_executor_revocation" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"session_id": "ses_agray4o575ytrcguudsrm73sbq",
"revoked": true
}{
"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>"
}Revoke an archived session's executor
Confirms that the executor of an archived session that ran on a fixed machine (an mch_ environment) has stopped. The first call records a revocation request, which the platform delivers to the machine’s executor in the background, retrying about every minute until the executor confirms its fence and stop. Until then the answer is 409 executor_revocation_pending; it is also the answer for a session that is not archived, that does not run on a fixed machine, or whose bma_placement pins another machine. Once confirmed, every call answers revoked: true. Idempotent: calling again never records a second request.
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 the workspace named by bma-workspace-id (or anthropic-workspace-id; when both are sent they must agree), else the credential’s default workspace, else the only workspace the credential can use. The caller’s workspace role must be admin, developer or operator (viewer is refused); 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 write 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 | 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. |
| 403 | permission_error | permission_denied | The caller’s workspace role is viewer, which may read sessions but not change them. | Use a credential with the required role or access; retrying with the same credential will not help. |
| 409 | conflict_error | executor_revocation_pending | The executor has not confirmed its stop yet, or the session is not archived, does not run on a fixed machine, or pins another machine. | Archive the session first; then retry later until the answer is 200. |
curl -sS -X POST "$BMA_BASE_URL/v1/sessions/ses_agray4o575ytrcguudsrm73sbq/bma_executor_revocation" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID"{
"session_id": "ses_agray4o575ytrcguudsrm73sbq",
"revoked": true
}{
"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>"
}