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" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
Example
{ "subject": { "claims": { "sub": "user_123", "roles": [ "admin" ] } }, "role": "admin"}Responses
Section titled “ Responses ”Successful JSON response.
Media type application/json
object
hasRole
required
boolean
activeRoles
required
Array<string>
Example
{ "hasRole": true, "activeRoles": [ "admin" ]}