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
| Header | Value |
|---|---|
Authorization | Bearer azx_... |
Content-Type | application/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)
| Field | Type | Description |
|---|---|---|
subject | object | Default subject applied to any item that omits subject. |
subject.id | string (uuid) | Subject ID. |
subject.external_id | string | External identifier (alternative to id). |
action | object | Default action applied to any item that omits action. |
action.name | string | Action name (e.g. read, write, delete). |
resource | object | Default resource applied to any item that omits resource. |
resource.id | string | Resource ID. |
resource.type | string | Resource type name. |
context | object | Default 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.
| Field | Type | Description |
|---|---|---|
subject | object | Override subject for this item. |
action | object | Override action for this item. |
resource | object | Override resource for this item. |
context | object | Override 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.
| Field | Type | Description |
|---|---|---|
decision | boolean | true = allowed, false = denied. |
reason | string | Present when denied — a short explanation (e.g. "no matching policy", "approval_pending"). |
Error responses
| Status | Description |
|---|---|
400 | Invalid request body, missing required fields, or more than 50 items |
401 | Missing 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" } }
]
}'