Endpoints
Policies and approvals
Register, list and switch spending rules on or off, and resolve purchases that a rule held for a person.
Policies
/v1/policiesScope policies:write (workspace key). Registers a policy document. workspaceId comes from your key.
| Field | Type | Required |
|---|---|---|
document | string, in the policy language | yes |
curl -s -X POST https://api.zanora.dev/v1/policies -H "x-api-key: $WKEY" \
-H 'content-type: application/json' -d '{"document":"approval:\n price > 5"}'
# → {"policies":[{"id":"pol_…","policyType":"approval","enabled":true,…}]}A document with several sections becomes several policies. A line that can't be parsed rejects the whole document with 400.
/v1/policiesScope policies:read. Your workspace's policies, including disabled ones: { policies }.
/v1/policies/:id/disableScope policies:write. Stops applying a policy from the next purchase. No body. Returns { policy }.
/v1/policies/:id/enableScope policies:write. Starts applying it again. No body.
Approvals
/v1/approvalsScope approvals:read. Your workspace's approval requests: { approvals }. Filter with ?status=pending (or approved, denied).
{ "approvals": [{ "id": "apr_…", "agentId": "invoice-bot", "walletId": "wal_…", "capabilityId": "cap_…",
"amountMinor": "1200", "currency": "USD", "rule": "price > 5", "status": "pending", "createdAt": "…" }] }/v1/approvals/:id/approveScope approvals:write. Approves the request. Body is optional: { resolvedBy? }. The approval covers one later purchase by that wallet of that capability, at up to the approved amount.
/v1/approvals/:id/denyScope approvals:write. Denies it. Body is optional: { resolvedBy? }.
Keep approvals:write away from agents
Give agents a key without approvals:write, so a model can never approve its own held spend. See Approvals.