Policies
Read, save, publish and roll back policies as a signed-in person. These routes power `reqlo policies`.
Base URL: https://api.reqlo.io/v1. Send Authorization: Bearer <CLI token>. The token comes from reqlo login (or REQLO_ACCESS_TOKEN) and acts as that person, with their role in the environment. Project API keys are refused.
| Endpoint | Method and path |
|---|---|
| Read policies and catalog | GET /policies/state |
| Save a policy draft | POST /policies/save |
| Publish a policy | POST /policies/{id}/publish |
| List policy versions | GET /policy-versions |
| Roll back to a version | POST /policy-versions/{version}/rollback |
Read policies and catalog
/v1/policies/statePurpose and when to use
Returns every policy (draft and published rules), the active actions and resource types, and approval channel IDs. reqlo policies diff uses it.
Authentication and environment
Send Authorization: Bearer <CLI token>. The token comes from reqlo login (or REQLO_ACCESS_TOKEN) and acts as that person, with their role in the environment. Project API keys are refused.
Full URL: https://api.reqlo.io/v1/policies/state.
Request contract
This endpoint has no request body. Unknown fields and query parameters are rejected with 422 parameter_invalid.
Path, query and header parameters
| Name | In | Type | Required | Validation | Description |
|---|---|---|---|---|---|
environment_id | query | string (uuid) | Yes | format uuid | Environment to act in. Copy it from the API keys page in the dashboard. |
Response 200
The environment's policies and catalog.
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
policies | array of object | No | No | Not specified | None specified | See the description above. |
policies[].id | string | No | No | Not specified | None specified | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
policies[].name | string | No | No | Not specified | None specified | Display name for this object. |
policies[].description | string | No | No | Not specified | None specified | Human-readable description of this object. |
policies[].status | string enum | No | No | Not specified | one of draft, published | Current lifecycle status. The allowed enum values are listed in validation. |
policies[].draft_rules | array of object | No | No | Not specified | each item: unknown fields rejected | Rules in the editable draft; publishing is a separate operation. |
policies[].draft_rules[].id | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z0-9][a-z0-9-]{0,63}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
policies[].draft_rules[].description | string | No | No | Not specified | max 500 chars | Human-readable description of this object. |
policies[].draft_rules[].effect | string enum | Yes (when parent is present) | No | Not specified | one of allow, deny, require_approval | Policy outcome produced when the rule matches. |
policies[].draft_rules[].actions | array of string | Yes (when parent is present) | No | Not specified | min 1 items | Action names or namespace.* patterns. |
policies[].draft_rules[].agents | object | No | No | Not specified | None specified | Match agents by ID or tag. Omit to match every agent. |
policies[].draft_rules[].agents.ids | array of string | No | No | Not specified | None specified | Explicit identifiers matched by this selector. |
policies[].draft_rules[].agents.tags | array of string | No | No | Not specified | None specified | Labels attached to this object; use values consistent with the matching policy rules. |
policies[].draft_rules[].subjects | object | No | No | Not specified | None specified | See the description above. |
policies[].draft_rules[].subjects.kinds | array of string | No | No | Not specified | None specified | Subject kinds, or none for requests without a subject. |
policies[].draft_rules[].require_delegation | boolean | No | No | Not specified | None specified | Only match requests with a valid delegation_id. |
policies[].draft_rules[].condition | string | No | No | Not specified | max 4000 chars | Condition expression. See the Policies guide. |
policies[].draft_rules[].approval | object | No | No | Not specified | None specified | See the description above. |
policies[].draft_rules[].approval.channel_id | string | No | No | Not specified | None specified | An approval channel in this environment. |
policies[].draft_rules[].approval.expires_in_seconds | integer | No | No | 3600 | min 60; max 604800 | Requested approval lifetime in seconds. |
policies[].published_rules | array of object, nullable | No | Yes | Not specified | each item: unknown fields rejected | See the description above. |
policies[].published_rules[].id | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z0-9][a-z0-9-]{0,63}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
policies[].published_rules[].description | string | No | No | Not specified | max 500 chars | Human-readable description of this object. |
policies[].published_rules[].effect | string enum | Yes (when parent is present) | No | Not specified | one of allow, deny, require_approval | Policy outcome produced when the rule matches. |
policies[].published_rules[].actions | array of string | Yes (when parent is present) | No | Not specified | min 1 items | Action names or namespace.* patterns. |
policies[].published_rules[].agents | object | No | No | Not specified | None specified | Match agents by ID or tag. Omit to match every agent. |
policies[].published_rules[].agents.ids | array of string | No | No | Not specified | None specified | Explicit identifiers matched by this selector. |
policies[].published_rules[].agents.tags | array of string | No | No | Not specified | None specified | Labels attached to this object; use values consistent with the matching policy rules. |
policies[].published_rules[].subjects | object | No | No | Not specified | None specified | See the description above. |
policies[].published_rules[].subjects.kinds | array of string | No | No | Not specified | None specified | Subject kinds, or none for requests without a subject. |
policies[].published_rules[].require_delegation | boolean | No | No | Not specified | None specified | Only match requests with a valid delegation_id. |
policies[].published_rules[].condition | string | No | No | Not specified | max 4000 chars | Condition expression. See the Policies guide. |
policies[].published_rules[].approval | object | No | No | Not specified | None specified | See the description above. |
policies[].published_rules[].approval.channel_id | string | No | No | Not specified | None specified | An approval channel in this environment. |
policies[].published_rules[].approval.expires_in_seconds | integer | No | No | 3600 | min 60; max 604800 | Requested approval lifetime in seconds. |
policies[].published_version | string, nullable | No | Yes | Not specified | None specified | Identifier of the currently published policy version. |
actions | array of object | No | No | Not specified | None specified | Action names covered by this rule or grant. |
actions[].name | string | No | No | Not specified | None specified | Display name for this object. |
actions[].resource_type | string | No | No | Not specified | None specified | Registered resource type to which this action or rule applies. |
actions[].context_schema | object | No | No | Not specified | None specified | See the description above. |
resource_types | array of object | No | No | Not specified | None specified | See the description above. |
resource_types[].name | string | No | No | Not specified | None specified | Display name for this object. |
resource_types[].attributes | object | No | No | Not specified | None specified | See the description above. |
approval_channels | array of string | No | No | Not specified | None specified | See the description above. |
{
"policies": [
{
"id": "POL_docs000000000001",
"name": "Document access",
"description": "",
"status": "published",
"draft_rules": [
{
"id": "allow-own-documents",
"effect": "allow",
"actions": [
"documents.read"
],
"agents": {
"ids": [],
"tags": [
"assistant"
]
},
"subjects": {
"kinds": [
"user"
]
},
"condition": "resource.attributes.owner_id == subject.id",
"approval": {
"expires_in_seconds": 3600
}
}
],
"published_rules": [
{
"id": "allow-own-documents",
"effect": "allow",
"actions": [
"documents.read"
],
"agents": {
"ids": [],
"tags": [
"assistant"
]
},
"subjects": {
"kinds": [
"user"
]
},
"condition": "resource.attributes.owner_id == subject.id",
"approval": {
"expires_in_seconds": 3600
}
}
],
"published_version": "2026-11-09.1"
}
],
"actions": [
{
"name": "documents.read",
"resource_type": "document"
}
],
"resource_types": [
{
"name": "document"
}
],
"approval_channels": []
}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_ACCESS_TOKEN in your server or terminal; never put it in browser code.
curl --fail-with-body --max-time 3 "https://api.reqlo.io/v1/policies/state?environment_id=6f0d3c52-8a51-4f0e-9a43-2b8f1f2a7c10" \
-H "Authorization: Bearer $REQLO_ACCESS_TOKEN"Errors and recovery
| Code | HTTP | Retry? | Meaning and recovery |
|---|---|---|---|
access_token_invalid | 401 | No, fix it first | The CLI token is invalid, expired or revoked. Run reqlo login again. |
access_denied | 403 | No, fix it first | Your role doesn't allow this operation in that environment. Ask an owner or admin. Publishing and rollback need owner or admin. |
parameter_invalid | 422 | No, fix it first | A field or query parameter is missing, unknown or invalid. Fix the request. Unknown fields are rejected. |
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. This read is safe to retry. Validation errors and denials are not transient.
Security, identity and failure behavior
CLI tokens act as their person: keep them out of logs, URLs and shared machines, and revoke them under Account → CLI tokens when they're no longer needed.
Related endpoints and integration examples
- Authorize — Ask whether an agent may perform an action, and record the decision.
- Policies — Read, save, publish and roll back policies as a signed-in person. These routes power
reqlo policies. - Workspace — List organizations, projects and environments, and manage agents, the catalog and API keys as a signed-in person. These routes power the CLI.
- Guides: Policies, policy as code and
reqlo policies.
Save a policy draft
/v1/policies/savePurpose and when to use
Creates the policy with this ID, or replaces its draft if the ID is already in this environment. Policy IDs are unique across ReQlo, so generate a random one for each new policy. Drafts never affect decisions until published. Developers, admins and owners can save.
Authentication and environment
Send Authorization: Bearer <CLI token>. The token comes from reqlo login (or REQLO_ACCESS_TOKEN) and acts as that person, with their role in the environment. Project API keys are refused.
Full URL: https://api.reqlo.io/v1/policies/save.
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 |
|---|---|---|---|---|---|---|
environment_id | string (uuid) | Yes | No | Not specified | format uuid | Environment identifier. Requests are still scoped by their authenticated API key. |
id | string | Yes | No | Not specified | pattern ^POL_[0-9A-Za-z]{16}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
name | string | Yes | No | Not specified | max 120 chars | Display name for this object. |
description | string | No | No | Not specified | max 1000 chars | Human-readable description of this object. |
rules | array of object | Yes | No | Not specified | max 200 items; each item: unknown fields rejected | Policy rules represented by this object or request. |
rules[].id | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z0-9][a-z0-9-]{0,63}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
rules[].description | string | No | No | Not specified | max 500 chars | Human-readable description of this object. |
rules[].effect | string enum | Yes (when parent is present) | No | Not specified | one of allow, deny, require_approval | Policy outcome produced when the rule matches. |
rules[].actions | array of string | Yes (when parent is present) | No | Not specified | min 1 items | Action names or namespace.* patterns. |
rules[].agents | object | No | No | Not specified | None specified | Match agents by ID or tag. Omit to match every agent. |
rules[].agents.ids | array of string | No | No | Not specified | None specified | Explicit identifiers matched by this selector. |
rules[].agents.tags | array of string | No | No | Not specified | None specified | Labels attached to this object; use values consistent with the matching policy rules. |
rules[].subjects | object | No | No | Not specified | None specified | See the description above. |
rules[].subjects.kinds | array of string | No | No | Not specified | None specified | Subject kinds, or none for requests without a subject. |
rules[].require_delegation | boolean | No | No | Not specified | None specified | Only match requests with a valid delegation_id. |
rules[].condition | string | No | No | Not specified | max 4000 chars | Condition expression. See the Policies guide. |
rules[].approval | object | No | No | Not specified | None specified | See the description above. |
rules[].approval.channel_id | string | No | No | Not specified | None specified | An approval channel in this environment. |
rules[].approval.expires_in_seconds | integer | No | No | 3600 | min 60; max 604800 | Requested approval lifetime in seconds. |
Response 200
The saved policy.
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
public_id | string | No | No | Not specified | None specified | See the description above. |
object | string enum | No | No | Not specified | one of policy | Object discriminator identifying the response shape. |
name | string | No | No | Not specified | None specified | Display name for this object. |
description | string | No | No | Not specified | None specified | Human-readable description of this object. |
status | string enum | No | No | Not specified | one of draft, published | Current lifecycle status. The allowed enum values are listed in validation. |
draft_rules | array of object | No | No | Not specified | each item: unknown fields rejected | Rules in the editable draft; publishing is a separate operation. |
draft_rules[].id | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z0-9][a-z0-9-]{0,63}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
draft_rules[].description | string | No | No | Not specified | max 500 chars | Human-readable description of this object. |
draft_rules[].effect | string enum | Yes (when parent is present) | No | Not specified | one of allow, deny, require_approval | Policy outcome produced when the rule matches. |
draft_rules[].actions | array of string | Yes (when parent is present) | No | Not specified | min 1 items | Action names or namespace.* patterns. |
draft_rules[].agents | object | No | No | Not specified | None specified | Match agents by ID or tag. Omit to match every agent. |
draft_rules[].agents.ids | array of string | No | No | Not specified | None specified | Explicit identifiers matched by this selector. |
draft_rules[].agents.tags | array of string | No | No | Not specified | None specified | Labels attached to this object; use values consistent with the matching policy rules. |
draft_rules[].subjects | object | No | No | Not specified | None specified | See the description above. |
draft_rules[].subjects.kinds | array of string | No | No | Not specified | None specified | Subject kinds, or none for requests without a subject. |
draft_rules[].require_delegation | boolean | No | No | Not specified | None specified | Only match requests with a valid delegation_id. |
draft_rules[].condition | string | No | No | Not specified | max 4000 chars | Condition expression. See the Policies guide. |
draft_rules[].approval | object | No | No | Not specified | None specified | See the description above. |
draft_rules[].approval.channel_id | string | No | No | Not specified | None specified | An approval channel in this environment. |
draft_rules[].approval.expires_in_seconds | integer | No | No | 3600 | min 60; max 604800 | Requested approval lifetime in seconds. |
published_rules | array of object, nullable | No | Yes | Not specified | each item: unknown fields rejected | See the description above. |
published_rules[].id | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z0-9][a-z0-9-]{0,63}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
published_rules[].description | string | No | No | Not specified | max 500 chars | Human-readable description of this object. |
published_rules[].effect | string enum | Yes (when parent is present) | No | Not specified | one of allow, deny, require_approval | Policy outcome produced when the rule matches. |
published_rules[].actions | array of string | Yes (when parent is present) | No | Not specified | min 1 items | Action names or namespace.* patterns. |
published_rules[].agents | object | No | No | Not specified | None specified | Match agents by ID or tag. Omit to match every agent. |
published_rules[].agents.ids | array of string | No | No | Not specified | None specified | Explicit identifiers matched by this selector. |
published_rules[].agents.tags | array of string | No | No | Not specified | None specified | Labels attached to this object; use values consistent with the matching policy rules. |
published_rules[].subjects | object | No | No | Not specified | None specified | See the description above. |
published_rules[].subjects.kinds | array of string | No | No | Not specified | None specified | Subject kinds, or none for requests without a subject. |
published_rules[].require_delegation | boolean | No | No | Not specified | None specified | Only match requests with a valid delegation_id. |
published_rules[].condition | string | No | No | Not specified | max 4000 chars | Condition expression. See the Policies guide. |
published_rules[].approval | object | No | No | Not specified | None specified | See the description above. |
published_rules[].approval.channel_id | string | No | No | Not specified | None specified | An approval channel in this environment. |
published_rules[].approval.expires_in_seconds | integer | No | No | 3600 | min 60; max 604800 | Requested approval lifetime in seconds. |
published_version | string, nullable | No | Yes | Not specified | None specified | Identifier of the currently published policy version. |
updated_at | string (date-time) | No | No | Not specified | format date-time | Time this object was last updated, as a UTC timestamp. |
{
"public_id": "POL_docs000000000001",
"object": "policy",
"name": "Document access",
"description": "Who may read workspace documents.",
"status": "draft",
"draft_rules": [
{
"id": "allow-own-documents",
"effect": "allow",
"actions": [
"documents.read"
],
"agents": {
"ids": [],
"tags": [
"assistant"
]
},
"subjects": {
"kinds": [
"user"
]
},
"condition": "resource.attributes.owner_id == subject.id",
"approval": {
"expires_in_seconds": 3600
}
}
],
"published_rules": [
{
"id": "allow-own-documents",
"effect": "allow",
"actions": [
"documents.read"
],
"agents": {
"ids": [],
"tags": [
"assistant"
]
},
"subjects": {
"kinds": [
"user"
]
},
"condition": "resource.attributes.owner_id == subject.id",
"approval": {
"expires_in_seconds": 3600
}
}
],
"published_version": null,
"updated_at": "2026-11-09T10:42:07Z"
}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_ACCESS_TOKEN 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/policies/save" \
-H "Authorization: Bearer $REQLO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"environment_id": "6f0d3c52-8a51-4f0e-9a43-2b8f1f2a7c10",
"id": "POL_docs000000000001",
"name": "Document access",
"rules": [
{
"id": "allow-own-documents",
"effect": "allow",
"actions": [
"documents.read"
],
"condition": "resource.attributes.owner_id == subject.id"
}
]
}'Errors and recovery
| Code | HTTP | Retry? | Meaning and recovery |
|---|---|---|---|
access_token_invalid | 401 | No, fix it first | The CLI token is invalid, expired or revoked. Run reqlo login again. |
access_denied | 403 | No, fix it first | Your role doesn't allow this operation in that environment. Ask an owner or admin. Publishing and rollback need owner or admin. |
policy_invalid | 422 | No, fix it first | Rules or conditions are invalid, or name an approval channel that doesn't exist. Fix the listed problems; run reqlo policies validate. |
policy_id_taken | 409 | No, fix it first | That policy ID is already used, in this or another environment. Generate a new ID: POL_ followed by 16 random letters or digits. |
parameter_invalid | 422 | No, fix it first | A field or query parameter is missing, unknown or invalid. Fix the request. Unknown fields are rejected. |
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. Don't automatically replay this change after a timeout: read the current state first. Validation errors and denials are not transient.
Security, identity and failure behavior
CLI tokens act as their person: keep them out of logs, URLs and shared machines, and revoke them under Account → CLI tokens when they're no longer needed.
Related endpoints and integration examples
- Authorize — Ask whether an agent may perform an action, and record the decision.
- Policies — Read, save, publish and roll back policies as a signed-in person. These routes power
reqlo policies. - Workspace — List organizations, projects and environments, and manage agents, the catalog and API keys as a signed-in person. These routes power the CLI.
- Guides: Policies, policy as code and
reqlo policies.
Publish a policy
/v1/policies/{id}/publishPurpose and when to use
Makes the policy's draft live and saves a new policy-set version. Conditions are compiled and approval channels checked first. Owners and admins only.
Authentication and environment
Send Authorization: Bearer <CLI token>. The token comes from reqlo login (or REQLO_ACCESS_TOKEN) and acts as that person, with their role in the environment. Project API keys are refused.
Full URL: https://api.reqlo.io/v1/policies/{id}/publish.
Request contract
Send a JSON body with Content-Type: application/json. Unknown fields and query parameters are rejected with 422 parameter_invalid.
Path, query and header parameters
| Name | In | Type | Required | Validation | Description |
|---|---|---|---|---|---|
id | path | string | Yes | pattern ^POL_[0-9A-Za-z]{16}$ | The policy's ID, as in its policy file. |
Every request field
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
environment_id | string (uuid) | Yes | No | Not specified | format uuid | Environment identifier. Requests are still scoped by their authenticated API key. |
Response 200
The published policy, the new version, and warnings about deny rules that read optional attributes without has().
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
public_id | string | No | No | Not specified | None specified | See the description above. |
object | string enum | No | No | Not specified | one of policy | Object discriminator identifying the response shape. |
name | string | No | No | Not specified | None specified | Display name for this object. |
description | string | No | No | Not specified | None specified | Human-readable description of this object. |
status | string enum | No | No | Not specified | one of draft, published | Current lifecycle status. The allowed enum values are listed in validation. |
draft_rules | array of object | No | No | Not specified | each item: unknown fields rejected | Rules in the editable draft; publishing is a separate operation. |
draft_rules[].id | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z0-9][a-z0-9-]{0,63}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
draft_rules[].description | string | No | No | Not specified | max 500 chars | Human-readable description of this object. |
draft_rules[].effect | string enum | Yes (when parent is present) | No | Not specified | one of allow, deny, require_approval | Policy outcome produced when the rule matches. |
draft_rules[].actions | array of string | Yes (when parent is present) | No | Not specified | min 1 items | Action names or namespace.* patterns. |
draft_rules[].agents | object | No | No | Not specified | None specified | Match agents by ID or tag. Omit to match every agent. |
draft_rules[].agents.ids | array of string | No | No | Not specified | None specified | Explicit identifiers matched by this selector. |
draft_rules[].agents.tags | array of string | No | No | Not specified | None specified | Labels attached to this object; use values consistent with the matching policy rules. |
draft_rules[].subjects | object | No | No | Not specified | None specified | See the description above. |
draft_rules[].subjects.kinds | array of string | No | No | Not specified | None specified | Subject kinds, or none for requests without a subject. |
draft_rules[].require_delegation | boolean | No | No | Not specified | None specified | Only match requests with a valid delegation_id. |
draft_rules[].condition | string | No | No | Not specified | max 4000 chars | Condition expression. See the Policies guide. |
draft_rules[].approval | object | No | No | Not specified | None specified | See the description above. |
draft_rules[].approval.channel_id | string | No | No | Not specified | None specified | An approval channel in this environment. |
draft_rules[].approval.expires_in_seconds | integer | No | No | 3600 | min 60; max 604800 | Requested approval lifetime in seconds. |
published_rules | array of object, nullable | No | Yes | Not specified | each item: unknown fields rejected | See the description above. |
published_rules[].id | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z0-9][a-z0-9-]{0,63}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
published_rules[].description | string | No | No | Not specified | max 500 chars | Human-readable description of this object. |
published_rules[].effect | string enum | Yes (when parent is present) | No | Not specified | one of allow, deny, require_approval | Policy outcome produced when the rule matches. |
published_rules[].actions | array of string | Yes (when parent is present) | No | Not specified | min 1 items | Action names or namespace.* patterns. |
published_rules[].agents | object | No | No | Not specified | None specified | Match agents by ID or tag. Omit to match every agent. |
published_rules[].agents.ids | array of string | No | No | Not specified | None specified | Explicit identifiers matched by this selector. |
published_rules[].agents.tags | array of string | No | No | Not specified | None specified | Labels attached to this object; use values consistent with the matching policy rules. |
published_rules[].subjects | object | No | No | Not specified | None specified | See the description above. |
published_rules[].subjects.kinds | array of string | No | No | Not specified | None specified | Subject kinds, or none for requests without a subject. |
published_rules[].require_delegation | boolean | No | No | Not specified | None specified | Only match requests with a valid delegation_id. |
published_rules[].condition | string | No | No | Not specified | max 4000 chars | Condition expression. See the Policies guide. |
published_rules[].approval | object | No | No | Not specified | None specified | See the description above. |
published_rules[].approval.channel_id | string | No | No | Not specified | None specified | An approval channel in this environment. |
published_rules[].approval.expires_in_seconds | integer | No | No | 3600 | min 60; max 604800 | Requested approval lifetime in seconds. |
published_version | string, nullable | No | Yes | Not specified | None specified | Identifier of the currently published policy version. |
updated_at | string (date-time) | No | No | Not specified | format date-time | Time this object was last updated, as a UTC timestamp. |
policy_set_version | string | No | No | Not specified | None specified | See the description above. |
warnings | array of string | No | No | Not specified | None specified | Non-fatal issues identified during validation. |
{
"public_id": "POL_docs000000000001",
"object": "policy",
"name": "Document access",
"description": "Who may read workspace documents.",
"status": "draft",
"draft_rules": [
{
"id": "allow-own-documents",
"effect": "allow",
"actions": [
"documents.read"
],
"agents": {
"ids": [],
"tags": [
"assistant"
]
},
"subjects": {
"kinds": [
"user"
]
},
"condition": "resource.attributes.owner_id == subject.id",
"approval": {
"expires_in_seconds": 3600
}
}
],
"published_rules": [
{
"id": "allow-own-documents",
"effect": "allow",
"actions": [
"documents.read"
],
"agents": {
"ids": [],
"tags": [
"assistant"
]
},
"subjects": {
"kinds": [
"user"
]
},
"condition": "resource.attributes.owner_id == subject.id",
"approval": {
"expires_in_seconds": 3600
}
}
],
"published_version": null,
"updated_at": "2026-11-09T10:42:07Z",
"policy_set_version": "2026-11-09.2",
"warnings": []
}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_ACCESS_TOKEN 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/policies/POL_docs000000000001/publish" \
-H "Authorization: Bearer $REQLO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"environment_id": "6f0d3c52-8a51-4f0e-9a43-2b8f1f2a7c10"
}'Errors and recovery
| Code | HTTP | Retry? | Meaning and recovery |
|---|---|---|---|
access_token_invalid | 401 | No, fix it first | The CLI token is invalid, expired or revoked. Run reqlo login again. |
access_denied | 403 | No, fix it first | Your role doesn't allow this operation in that environment. Ask an owner or admin. Publishing and rollback need owner or admin. |
policy_invalid | 422 | No, fix it first | Rules or conditions are invalid, or name an approval channel that doesn't exist. Fix the listed problems; run reqlo policies validate. |
resource_missing | 404 | No, fix it first | The object doesn't exist in this environment. Check the ID and that you are using the right key or environment. |
parameter_invalid | 422 | No, fix it first | A field or query parameter is missing, unknown or invalid. Fix the request. Unknown fields are rejected. |
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. Don't automatically replay this change after a timeout: read the current state first. Validation errors and denials are not transient.
Security, identity and failure behavior
CLI tokens act as their person: keep them out of logs, URLs and shared machines, and revoke them under Account → CLI tokens when they're no longer needed.
Related endpoints and integration examples
- Authorize — Ask whether an agent may perform an action, and record the decision.
- Policies — Read, save, publish and roll back policies as a signed-in person. These routes power
reqlo policies. - Workspace — List organizations, projects and environments, and manage agents, the catalog and API keys as a signed-in person. These routes power the CLI.
- Guides: Policies, policy as code and
reqlo policies.
List policy versions
/v1/policy-versionsPurpose and when to use
The latest 50 policy-set versions, newest (live) first. Each holds every live policy at that time.
Authentication and environment
Send Authorization: Bearer <CLI token>. The token comes from reqlo login (or REQLO_ACCESS_TOKEN) and acts as that person, with their role in the environment. Project API keys are refused.
Full URL: https://api.reqlo.io/v1/policy-versions.
Request contract
This endpoint has no request body. Unknown fields and query parameters are rejected with 422 parameter_invalid.
Path, query and header parameters
| Name | In | Type | Required | Validation | Description |
|---|---|---|---|---|---|
environment_id | query | string (uuid) | Yes | format uuid | Environment to act in. Copy it from the API keys page in the dashboard. |
Response 200
Versions.
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
data | array of object | No | No | Not specified | None specified | See the description above. |
data[].version | string | No | No | Not specified | None specified | Policy version identifier. Use the exact version returned by the service. |
data[].created_at | string (date-time) | No | No | Not specified | format date-time | Time this object was created, as a UTC timestamp. |
data[].rolled_back_from | string, nullable | No | Yes | Not specified | None specified | Set when this version restored an earlier one. |
data[].policies | array of object | No | No | Not specified | None specified | See the description above. |
data[].policies[].id | string | No | No | Not specified | None specified | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
data[].policies[].name | string | No | No | Not specified | None specified | Display name for this object. |
data[].policies[].rules | array of object | No | No | Not specified | each item: unknown fields rejected | Policy rules represented by this object or request. |
data[].policies[].rules[].id | string | Yes (when parent is present) | No | Not specified | pattern ^[a-z0-9][a-z0-9-]{0,63}$ | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
data[].policies[].rules[].description | string | No | No | Not specified | max 500 chars | Human-readable description of this object. |
data[].policies[].rules[].effect | string enum | Yes (when parent is present) | No | Not specified | one of allow, deny, require_approval | Policy outcome produced when the rule matches. |
data[].policies[].rules[].actions | array of string | Yes (when parent is present) | No | Not specified | min 1 items | Action names or namespace.* patterns. |
data[].policies[].rules[].agents | object | No | No | Not specified | None specified | Match agents by ID or tag. Omit to match every agent. |
data[].policies[].rules[].agents.ids | array of string | No | No | Not specified | None specified | Explicit identifiers matched by this selector. |
data[].policies[].rules[].agents.tags | array of string | No | No | Not specified | None specified | Labels attached to this object; use values consistent with the matching policy rules. |
data[].policies[].rules[].subjects | object | No | No | Not specified | None specified | See the description above. |
data[].policies[].rules[].subjects.kinds | array of string | No | No | Not specified | None specified | Subject kinds, or none for requests without a subject. |
data[].policies[].rules[].require_delegation | boolean | No | No | Not specified | None specified | Only match requests with a valid delegation_id. |
data[].policies[].rules[].condition | string | No | No | Not specified | max 4000 chars | Condition expression. See the Policies guide. |
data[].policies[].rules[].approval | object | No | No | Not specified | None specified | See the description above. |
data[].policies[].rules[].approval.channel_id | string | No | No | Not specified | None specified | An approval channel in this environment. |
data[].policies[].rules[].approval.expires_in_seconds | integer | No | No | 3600 | min 60; max 604800 | Requested approval lifetime in seconds. |
{
"data": [
{
"version": "2026-11-09.2",
"created_at": "2026-11-09T10:42:07Z",
"rolled_back_from": null,
"policies": [
{
"id": "POL_docs000000000001",
"name": "Document access",
"rules": []
}
]
}
]
}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_ACCESS_TOKEN in your server or terminal; never put it in browser code.
curl --fail-with-body --max-time 3 "https://api.reqlo.io/v1/policy-versions?environment_id=6f0d3c52-8a51-4f0e-9a43-2b8f1f2a7c10" \
-H "Authorization: Bearer $REQLO_ACCESS_TOKEN"Errors and recovery
| Code | HTTP | Retry? | Meaning and recovery |
|---|---|---|---|
access_token_invalid | 401 | No, fix it first | The CLI token is invalid, expired or revoked. Run reqlo login again. |
access_denied | 403 | No, fix it first | Your role doesn't allow this operation in that environment. Ask an owner or admin. Publishing and rollback need owner or admin. |
parameter_invalid | 422 | No, fix it first | A field or query parameter is missing, unknown or invalid. Fix the request. Unknown fields are rejected. |
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. This read is safe to retry. Validation errors and denials are not transient.
Security, identity and failure behavior
CLI tokens act as their person: keep them out of logs, URLs and shared machines, and revoke them under Account → CLI tokens when they're no longer needed.
Related endpoints and integration examples
- Authorize — Ask whether an agent may perform an action, and record the decision.
- Policies — Read, save, publish and roll back policies as a signed-in person. These routes power
reqlo policies. - Workspace — List organizations, projects and environments, and manage agents, the catalog and API keys as a signed-in person. These routes power the CLI.
- Guides: Policies, policy as code and
reqlo policies.
Roll back to a version
/v1/policy-versions/{version}/rollbackPurpose and when to use
Republishes an earlier version as a new version. Nothing is deleted. Owners and admins only.
Authentication and environment
Send Authorization: Bearer <CLI token>. The token comes from reqlo login (or REQLO_ACCESS_TOKEN) and acts as that person, with their role in the environment. Project API keys are refused.
Full URL: https://api.reqlo.io/v1/policy-versions/{version}/rollback.
Request contract
Send a JSON body with Content-Type: application/json. Unknown fields and query parameters are rejected with 422 parameter_invalid.
Path, query and header parameters
| Name | In | Type | Required | Validation | Description |
|---|---|---|---|---|---|
version | path | string | Yes | pattern ^\d{4}-\d{2}-\d{2}\.\d{1,6}$ | A policy-set version from List policy versions. |
Every request field
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
environment_id | string (uuid) | Yes | No | Not specified | format uuid | Environment identifier. Requests are still scoped by their authenticated API key. |
Response 200
The rollback result.
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_ACCESS_TOKEN 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/policy-versions/2026-11-09.1/rollback" \
-H "Authorization: Bearer $REQLO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"environment_id": "6f0d3c52-8a51-4f0e-9a43-2b8f1f2a7c10"
}'Errors and recovery
| Code | HTTP | Retry? | Meaning and recovery |
|---|---|---|---|
access_token_invalid | 401 | No, fix it first | The CLI token is invalid, expired or revoked. Run reqlo login again. |
access_denied | 403 | No, fix it first | Your role doesn't allow this operation in that environment. Ask an owner or admin. Publishing and rollback need owner or admin. |
resource_missing | 404 | No, fix it first | The object doesn't exist in this environment. Check the ID and that you are using the right key or environment. |
policy_version_stale | 409 | No, fix it first | A policy in that version no longer exists, so it can't be restored. Roll back to a later version, or recreate the policy. |
parameter_invalid | 422 | No, fix it first | A field or query parameter is missing, unknown or invalid. Fix the request. Unknown fields are rejected. |
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. Don't automatically replay this change after a timeout: read the current state first. Validation errors and denials are not transient.
Security, identity and failure behavior
CLI tokens act as their person: keep them out of logs, URLs and shared machines, and revoke them under Account → CLI tokens when they're no longer needed.
Related endpoints and integration examples
- Authorize — Ask whether an agent may perform an action, and record the decision.
- Policies — Read, save, publish and roll back policies as a signed-in person. These routes power
reqlo policies. - Workspace — List organizations, projects and environments, and manage agents, the catalog and API keys as a signed-in person. These routes power the CLI.
- Guides: Policies, policy as code and
reqlo policies.
Something wrong or unclear? Report an issue with this page.