Skip to content

Assign a role to an admin user.

POST
/api/admin/admins/{id}/roles
Code sample: Shell / cURL
curl --request POST \
--url https://auth.example.com/api/admin/admins/example/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "role_id": "role_security_admin", "admin_user_id": "admin_123", "scope_type": "tenant", "scope_id": "default" }'

Assign an Admin role to a user with a tenant or global scope binding.

id
required
string
X-Tenant-Id
string

Tenant selector for multi-tenant admin requests.

Media type application/json
object
role_id

Required when assigning a role through /api/admin/admins/{id}/roles.

string
admin_user_id

Required when assigning through /api/admin/admin-roles/{id}/assignments.

string
scope_type
string
Allowed values: global tenant org
scope_id
string
expires_at
integer format: int64
key
additional properties
Example
{
"role_id": "role_security_admin",
"admin_user_id": "admin_123",
"scope_type": "tenant",
"scope_id": "default"
}

Admin role assignment response.

Media type application/json
object
id
required
string
tenant_id
required
string
admin_user_id
required
string
admin_role_id
required
string
scope_type
required
string
Allowed values: global tenant org
scope_id
required
string | null
expires_at
integer | null format: int64
assigned_by
string | null
created_at
required
integer format: int64
key
additional properties
Example
{
"scope_type": "global"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}