Skip to content

Check role membership.

POST
/api/policy/check-role
Code sample: Shell / cURL
curl --request POST \
--url https://auth.example.com/api/policy/check-role \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "subject": { "claims": { "sub": "user_123", "roles": [ "admin" ] } }, "role": "admin" }'
Media type application/json
object
subject
required
One of:
object
id
string
roles
Array<object>
object
key
additional properties
key
additional properties
role
string
roles
Array<string>
mode
string
Allowed values: any all
scope
string
scopeTarget
string
Example
{
"subject": {
"claims": {
"sub": "user_123",
"roles": [
"admin"
]
}
},
"role": "admin"
}

Successful JSON response.

Media type application/json
object
hasRole
required
boolean
activeRoles
required
Array<string>
Example
{
"hasRole": true,
"activeRoles": [
"admin"
]
}