Skip to main content

Batch Evaluation

Check multiple subject/action/resource combinations in a single request.

POST /v1/evaluations

Up to 50 evaluation items per request. Top-level subject, action, resource, and context act as defaults — any item that omits a field inherits from the top level. Results are returned in the same order as the input items.

Request

Headers

HeaderValue
AuthorizationBearer azx_...
Content-Typeapplication/json

Body

{
"subject": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"action": {
"name": "read"
},
"evaluations": [
{
"resource": { "id": "res-001" }
},
{
"resource": { "id": "res-002" },
"action": { "name": "write" }
},
{
"subject": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" },
"resource": { "id": "res-003" }
}
]
}

Fields

Top-level defaults (all optional)

FieldTypeDescription
subjectobjectDefault subject applied to any item that omits subject.
subject.idstring (uuid)Subject ID.
subject.external_idstringExternal identifier (alternative to id).
actionobjectDefault action applied to any item that omits action.
action.namestringAction name (e.g. read, write, delete).
resourceobjectDefault resource applied to any item that omits resource.
resource.idstringResource ID.
resource.typestringResource type name.
contextobjectDefault context key/value pairs (e.g. ip, time).

evaluations array (required, 1–50 items)

Each item has the same shape as the top-level defaults. Fields present in an item override the top-level default for that evaluation only.

FieldTypeDescription
subjectobjectOverride subject for this item.
actionobjectOverride action for this item.
resourceobjectOverride resource for this item.
contextobjectOverride context for this item.

Response

200 OK

{
"evaluations": [
{ "decision": true },
{ "decision": false, "reason": "no matching policy" },
{ "decision": true }
]
}

Results appear in the same order as the input evaluations array.

FieldTypeDescription
decisionbooleantrue = allowed, false = denied.
reasonstringPresent when denied — a short explanation (e.g. "no matching policy", "approval_pending").

Error responses

StatusDescription
400Invalid request body, missing required fields, or more than 50 items
401Missing or invalid API key

Example

# Check if a user can read three documents in one call
curl -X POST https://api.vengtoo.com/v1/evaluations \
-H "Authorization: Bearer azx_..." \
-H "Content-Type: application/json" \
-d '{
"subject": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" },
"action": { "name": "read" },
"evaluations": [
{ "resource": { "id": "doc-001" } },
{ "resource": { "id": "doc-002" } },
{ "resource": { "id": "doc-003" } }
]
}'