Skip to content

Remove a capability grant from a user (admin)

DELETE
/admin/users/{ref}/grants/{capability}

Pass team_id query param to scope to a team-scoped grant; omit for the global grant. Returns 404 when no matching grant exists (composite key, not by ID — there is no ID).

ref
required
integer format: int64
capability
required
string
team_id
string format: uuid

Grant removed.

Grant removal refused — would leave the system with zero users holding system.admin (last-admin invariant guard). Applies to global system.admin grants only.

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Authenticated but missing required capabilities

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Resource not found

object
error
required

Human-readable error summary

string
Example
the request could not be completed