Grant a shell role to a user
POST
/api/users/{user_id}/roles
const url = 'https://example.com/api/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/roles?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” user_id
required
User Id
string format: uuid
Query Parameters
Section titled “ Query Parameters ” organization_id
required
Organization Id
string format: uuid
Request Bodyrequired
Section titled “ Request Bodyrequired ” Media type application/json
GrantRoleRequest
Request body for creating a role grant.
object
role
required
Role
string
Example generated
{ "role": "example"}Responses
Section titled “ Responses ”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
id
required
Id
string format: uuid
organization_id
required
Organization Id
string format: uuid
role
required
Role
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" } ]}