Evaluate policy input.
POST
/api/policy/evaluate
Code sample: Shell / cURL
curl --request POST \ --url https://auth.example.com/api/policy/evaluate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "subject": { "id": "user_123", "roles": [ { "name": "admin", "scope": "global" } ] }, "resource": { "type": "document", "id": "doc_123" }, "action": { "name": "read" } }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
subject
required
object
id
string
roles
Array<object>
object
key
additional properties
key
additional properties
resource
required
object
key
additional properties
action
required
object
key
additional properties
environment
object
key
additional properties
timestamp
integer
Example
{ "subject": { "id": "user_123", "roles": [ { "name": "admin", "scope": "global" } ] }, "resource": { "type": "document", "id": "doc_123" }, "action": { "name": "read" }}Responses
Section titled “ Responses ”Successful JSON response.
Media type application/json
object
allowed
required
boolean
reason
string
ruleId
string
effect
string
key
additional properties
Example
{ "allowed": true, "reason": "Matched allow rule", "effect": "allow"}