Grant a capability to a user
POST /admin/users/{ref}/grants
Grants a capability to a user, across the instance or, with
team_id, within that team and the teams below it. Use a code from
GET /auth/capabilities.
Granting the same capability for the same scope again updates the
existing grant: its note and expiry are replaced with the new
values, so leaving them out clears them. Needs the users.write
capability. An unknown user gets 404.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body required
Section titled “Request Body required ”Set team_id to limit the override to a team; leave it out, or send
null, for one that applies across the instance.
object
The capability code, such as users.write.
A reason to record with it.
When it should expire. It must be in the future, or you get 400. Leave it out for a permanent one.
Responses
Section titled “ Responses ”The grant was added or updated.
Malformed request
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completedResource not found
object
Human-readable error summary
Example
the request could not be completed