Role binding and temporary grant API

Role binding and temporary grant API

Bind principals to scopes and authorize bounded administrative elevation.

Access endpoints assign roles and manage temporary grant approval. API-key scopes continue to constrain machine callers independently of these bindings.

Role bindings

POST/organizations/{organization_id}/role-bindings
Scope
access:write
Auth
Bearer API key

Creates a scoped role binding for a principal.

Requires access:write. Send principal with type and ID, role_id, and a supported scope object. Returns 201 with binding ID and revision.

To bind the platform team to the payments project, send this body:

JSON
{
  "principal": { "type": "team", "id": "team_platform" },
  "role_id": "role_project_operator",
  "scope": { "type": "project", "id": "prj_payments" }
}

An invalid scope or a role the caller cannot delegate returns 403 or 422 without an effective grant. Bindings combine permissions; there is no implicit deny created by adding a narrower role.

DELETE/organizations/{organization_id}/role-bindings/{binding_id}
Scope
access:write
Auth
Bearer API key

Removes the selected role binding.

Requires the binding ETag in If-Match. Removes that grant, not other independent bindings for the principal.

Request temporary access

POST/organizations/{organization_id}/temporary-grants
Scope
access:write
Auth
Bearer API key

Creates a temporary grant request awaiting approval.

Send principal, role, scope, required reason, and expires_at. The expiry must be in the future and within organization policy. Returns 201 with grant ID and awaiting_approval; the grant does not authorize requests before approval.

POST/organizations/{organization_id}/temporary-grants/{grant_id}/approve
Scope
access:approve
Auth
Bearer API key

Approves the selected temporary grant revision.

Requires access:approve, the grant ETag, and approver eligibility. Self-approval is rejected under default policy. A stale or expired request cannot be approved.

Read and simulate

GET/organizations/{organization_id}/role-bindings
Scope
access:read
Auth
Bearer API key

Lists visible role bindings with standard pagination. Requires access:read.

GET/organizations/{organization_id}/temporary-grants/{grant_id}
Scope
access:read
Auth
Bearer API key

Returns the temporary grant state and review details.

Requires access:read within the relevant administrative scope. Grant states are awaiting_approval, active, rejected, expired, or revoked. The result includes authoritative expiry and review actor.

POST/organizations/{organization_id}/access-simulations
Scope
access:read
Auth
Bearer API key

Simulates a principal's effective access without performing the action.

Requires authorized access review and accepts principal, resource ID, action, and optional API-key ID. It returns the contributing bindings and unmet policy conditions without performing the action.

Revoke

POST/organizations/{organization_id}/temporary-grants/{grant_id}/revoke
Scope
access:write
Auth
Bearer API key

Revokes a temporary grant for subsequent requests.

Requires the current ETag and a reason. Revocation prevents new actions relying on that grant. It does not terminate guest shells or cancel accepted operations automatically.

For emergency cleanup, follow grant expiry and revocation to cancel eligible operations and revoke managed console connections. Use Simulate access to check whether another binding still authorizes the principal.

Read an individual binding

GET/organizations/{organization_id}/role-bindings/{binding_id}
Scope
access:read
Auth
Bearer API key

Returns principal, role, scope, revision, and effective binding state. A missing or invisible binding returns 404.