Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Test a policy file against fixture requests

Decides each fixture request against the environment as it would be after applying the file (every enabled policy the file does not own, plus the file’s policies), using the production decision function. Writes nothing and dispatches nothing. Policy decision only: an action’s own approval floor is not applied.

POST/api/v2/approval-policies/files/test
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Request body
requiredapplication/json
sourcestringrequired
min length 1 · max length 262144
casesstring | object[]required

Fixture cases as YAML/JSON text (a list, or an object with cases), or as a list. Each case has name, request { kind, action, input, agent, user, tags } and expect { effect and/or policy (a key in this file, another policy id, or null) }.

Show properties
One of:
string
string
object[]
Array of object
object
Responses
200

Per-case results.

successbooleanrequired
Allowed:true
dataPolicyFileTestResultrequired
Show properties
filestringrequired
passedintegerrequired
failedintegerrequired
resultsobject[]required
Show properties
Array of object
namestringrequired
passbooleanrequired
policystring | nullrequired

The governing policy: a key in this file, another policy id, or null.

effectstringrequired
Allowed:require_approvalauto_approveauto_deny
explanationstringrequired
400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
429

Too Many Requests - Rate limit exceeded

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.anlyon.com/api/v2/approval-policies/files/test' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "source": "string",
  "cases": "string"
}'
Response
{
  "success": true,
  "data": {
    "file": "string",
    "passed": 0,
    "failed": 0,
    "results": [
      {
        "name": "string",
        "pass": true,
        "policy": "string",
        "effect": "require_approval",
        "explanation": "string"
      }
    ]
  }
}