Authorize
Ask whether an agent may perform an action, and record the decision.
Base URL: https://api.reqlo.io/v1. Send Authorization: Bearer <project API key> from your server. The key (rq_test_…, from API keys in the dashboard) selects the organization and environment; nothing in the request can change them.
| Endpoint | Method and path |
|---|---|
| Check authorization | POST /authorize |
Check authorization
/v1/authorizePurpose and when to use
Evaluates the live policies in the key's environment and records the decision. Call it from your server immediately before the action, and run the action only when decision is allow. A deny is a successful 200 response; any error is never a decision.
Authentication and environment
Send Authorization: Bearer <project API key> from your server. The key (rq_test_…, from API keys in the dashboard) selects the organization and environment; nothing in the request can change them.
Full URL: https://api.reqlo.io/v1/authorize.
Request contract
Send a JSON body with Content-Type: application/json. Unknown fields and query parameters are rejected with 422 parameter_invalid.
Every request field
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
agent | object | Yes | No | Not specified | unknown fields rejected | The registered agent making the request. Your server chooses this, never the model. |
agent.id | string | Yes (when parent is present) | No | Not specified | pattern ^[A-Za-z0-9_.:-]{1,128}$ | Agent ID from the dashboard. |
subject | object | No | No | Not specified | unknown fields rejected | The person or entity the agent acts for, from your verified session. Omit for autonomous agents. |
subject.id | string | Yes (when parent is present) | No | Not specified | min 1 chars; max 128 chars | Subject ID in your system. |
subject.kind | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z][a-z0-9_]{0,63}$ | Subject kind that rules match on. |
action | string | Yes | No | Not specified | max 128 chars | A registered action name. |
resource | object | Yes | No | Not specified | unknown fields rejected | Target resource reference and authoritative attributes used for this authorization request. |
resource.type | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z][a-z0-9_]{0,63}$ | The action's registered resource type. |
resource.id | string | Yes (when parent is present) | No | Not specified | min 1 chars; max 256 chars | Resource ID in your system. |
resource.attributes | map | No | No | Not specified | None specified | Up to 64 attributes. Values are strings (up to 1,024 characters), numbers, booleans or arrays of up to 100 strings. Must match the registered schema. |
context | map | No | No | Not specified | None specified | Up to 64 attributes. Values are strings (up to 1,024 characters), numbers, booleans or arrays of up to 100 strings. Must match the registered schema. |
delegation_id | string | No | No | Not specified | max 128 chars | A delegation the subject granted this agent. Required by rules with require_delegation. |
operation_digest | string | No | No | Not specified | pattern ^sha256:[a-f0-9]{64}$ | Stable SHA-256 digest of the complete operation arguments. Included in approval binding. The TypeScript protect helper computes it automatically. |
approval_id | string | No | No | Not specified | pattern ^APR_[0-9A-Za-z]{16}$ | Redeem an approved request. The rest of the request must be identical. |
Response 200
A decision. Check decision before acting.
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
id | string | Yes | No | Not specified | None specified | Decision ID. Log it next to your own record of the action. |
object | string enum | Yes | No | Not specified | one of decision | Object discriminator identifying the response shape. |
decision | string enum | Yes | No | Not specified | one of allow, deny, approval_required | Only allow permits the action. |
allowed | boolean | Yes | No | Not specified | None specified | True only when decision is allow. |
reason_code | string | Yes | No | Not specified | None specified | Why. See reason codes. |
matched_rules | array of string | Yes | No | Not specified | None specified | IDs of the rules that decided. |
policy_version | string, nullable | Yes | Yes | Not specified | None specified | Live policy-set version used. Null if nothing is published. |
approval | object, nullable | Yes | Yes | Not specified | None specified | Present when decision is approval_required. |
approval.id | string | No | No | Not specified | None specified | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
approval.status | string enum | No | No | Not specified | one of pending | Current lifecycle status. The allowed enum values are listed in validation. |
approval.expires_at | string (date-time) | No | No | Not specified | format date-time | Expiry timestamp; do not use authority after it expires. |
environment | string enum | Yes | No | Not specified | one of sandbox, production | Environment associated with the authenticated request or record. |
livemode | boolean | Yes | No | Not specified | None specified | True only in production. |
created_at | string (date-time) | Yes | No | Not specified | format date-time | Time this object was created, as a UTC timestamp. |
request_id | string | Yes | No | Not specified | None specified | Request correlation identifier for diagnostics and support. Never use it as authorization proof. |
{
"id": "dec_9f1c2b7e4a5d4c3e8b6a1f0e2d3c4b5a",
"object": "decision",
"decision": "allow",
"allowed": true,
"reason_code": "policy_allowed",
"matched_rules": [
"allow-own-documents"
],
"policy_version": "2026-11-09.1",
"approval": null,
"environment": "sandbox",
"livemode": false,
"created_at": "2026-11-09T10:42:07Z",
"request_id": "3b2f1c9e-0d4a-4c51-9b8e-6a7d2f0e1c44"
}Policy deny: HTTP 200
A refusal is a successful decision, not an error. Never run the action on deny.
{
"id": "dec_9f1c2b7e4a5d4c3e8b6a1f0e2d3c4b5a",
"object": "decision",
"decision": "deny",
"allowed": false,
"reason_code": "policy_denied",
"matched_rules": [
"deny-confidential"
],
"policy_version": "2026-11-09.1",
"approval": null,
"environment": "sandbox",
"livemode": false,
"created_at": "2026-11-09T10:42:07Z",
"request_id": "3b2f1c9e-0d4a-4c51-9b8e-6a7d2f0e1c44"
}Infrastructure failure: HTTP 503
No decision was obtained. Don't run the action, and never fall back to allow.
{
"error": {
"code": "service_unavailable",
"message": "A required service is unavailable. Do not execute protected actions.",
"request_id": "3b2f1c9e-0d4a-4c51-9b8e-6a7d2f0e1c44"
}
}Response headers
| Header | Meaning |
|---|---|
Reqlo-Request-Id | Correlation ID for support. Also in every error body as request_id. |
Sample requests
IDs are placeholders. Export REQLO_API_KEY in your server or terminal; never put it in browser code.
curl --fail-with-body --max-time 3 -X POST "https://api.reqlo.io/v1/authorize" \
-H "Authorization: Bearer $REQLO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent": {
"id": "agt_7Hq2mK9xR4vTq8Lp"
},
"subject": {
"id": "usr_94",
"kind": "user"
},
"action": "documents.read",
"resource": {
"type": "document",
"id": "doc_831",
"attributes": {
"owner_id": "usr_94"
}
},
"context": {
"document_classification": "internal"
}
}'Errors and recovery
| Code | HTTP | Retry? | Meaning and recovery |
|---|---|---|---|
api_key_required | 401 | No, fix it first | This route needs a project API key. Use the rq_test_ key from the API keys page on your server. |
api_key_invalid | 401 | No, fix it first | The API key is invalid, expired or revoked. Check the key or roll a new one in the dashboard. |
scope_missing | 403 | No, fix it first | The key can't authorize requests. Create a new key in the dashboard. |
parameter_invalid | 422 | No, fix it first | A field or query parameter is missing, unknown or invalid. Fix the request. Unknown fields are rejected. |
action_unknown | 422 | No, fix it first | The action isn't registered and active in this environment. Register it under Actions & resources. |
attribute_invalid | 422 | No, fix it first | Attributes don't match the registered schemas. Send exactly the declared attributes with the right types. |
content_type_invalid | 415 | No, fix it first | The body isn't sent as application/json. Send Content-Type: application/json. |
invalid_json | 400 | No, fix it first | The body is missing or is not valid UTF-8 JSON. Send a JSON object. |
request_too_large | 413 | No, fix it first | The body is larger than 32 KiB. Send fewer or shorter attributes. |
authentication_required | 401 | No, fix it first | No Bearer credential was sent. Send Authorization: Bearer with a project key or CLI token. |
rate_limited | 429 | Yes, with backoff | More than 120 requests in a minute for this key, token or address. Back off and retry. |
service_unavailable | 503 | Yes, with backoff | A required service is unavailable. This is never a decision. Do not run the action. Retry with backoff. |
Errors use one envelope:
{
"error": {
"code": "parameter_invalid",
"message": "Request fields are invalid or unsupported.",
"request_id": "3b2f1c9e-0d4a-4c51-9b8e-6a7d2f0e1c44"
}
}Rate limits, retries and uncertain outcomes
Each key, token and IP address can make 120 requests per minute; more return 429 rate_limited. Use a bounded timeout (the samples use 3 seconds) and retry only 429 and 5xx, with exponential backoff. A retried check that requires approval can create a second approval request; that's safe, because each is single-use. Validation errors and denials are not transient.
Security, identity and failure behavior
Only decision: "allow" permits the action. A deny, approval_required, any HTTP error, a timeout or an unreadable response must leave it stopped. Take the subject from your verified session and resource attributes from your own database, never from the model. See Secure enforcement.
Related endpoints and integration examples
- Authorize — Ask whether an agent may perform an action, and record the decision.
- Approvals — Read approval requests, and approve or reject them as a signed-in person.
- Delegations — Record, list and revoke a person's grant letting one agent act for them.
- Policies — Read, save, publish and roll back policies as a signed-in person. These routes power
reqlo policies. - Guides: Quickstart, secure enforcement and the TypeScript SDK.
Operation-specific notes
- An unregistered or archived action returns
422 action_unknown, never an allow. - An unknown agent is a
denywithagent_unknown; a disabled agent isagent_revoked. - With
approval_id, the request is checked against the approved one. A matching approved request returnsallowwithapproval_redeemedonce; see Human approvals.
Something wrong or unclear? Report an issue with this page.