Skip to content

Grant a shell role to a user

POST
/api/users/{user_id}/roles
curl --request POST \
--url 'https://example.com/api/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/roles?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "role": "example" }'

Create a shell role grant for user_id in org.

Errors

404 — user is not a member of this organization. 409 — user already holds this role (active grant exists). 422 — unknown role string.

user_id
required
User Id
string format: uuid
organization_id
required
Organization Id
string format: uuid
Media type application/json
GrantRoleRequest

Request body for creating a role grant.

object
role
required
Role
string
Example generated
{
"role": "example"
}

Successful Response

Media type application/json
GrantRoleResponse

Response schema for a single role grant.

sod_warning is populated when granting ELEVATED or BREAKGLASS to a user who already holds an org-tenancy OWNER or ADMIN role — a separation-of-duties concern. None (omitted) when no SoD concern exists. This is a warning only; it does NOT block the grant.

object
created_at
required
Created At
string format: date-time
granted_by_id
required
Any of:
string format: uuid
id
required
Id
string format: uuid
organization_id
required
Organization Id
string format: uuid
role
required
Role
string
sod_warning
Any of:
string
user_id
required
User Id
string format: uuid
Example generated
{
"created_at": "2026-04-15T12:00:00Z",
"granted_by_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"organization_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"role": "example",
"sod_warning": "example",
"user_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}