Credentials
Check which environment a project key belongs to, who a CLI token acts as, and revoke a CLI token.
Base URL: https://api.reqlo.io/v1. Send either a project API key from your server (the key selects the environment) or a CLI token from reqlo login (pass environment_id; it acts as that person).
| Endpoint | Method and path |
|---|---|
| Inspect a project key | GET /key-context |
| Who a CLI token acts as | GET /me |
| Revoke this CLI token | POST /access-tokens/current/revoke |
Inspect a project key
/v1/key-contextPurpose and when to use
Returns the organization and environment a project key belongs to. Use it to check configuration at startup, or to find the environment ID.
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/key-context.
Request contract
This endpoint has no request body. Unknown fields and query parameters are rejected with 422 parameter_invalid.
Response 200
The key's context. Never includes the secret.
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
key_id | string (uuid) | No | No | Not specified | format uuid | See the description above. |
organization_id | string (uuid) | No | No | Not specified | format uuid | See the description above. |
environment_id | string (uuid) | No | No | Not specified | format uuid | Environment identifier. Requests are still scoped by their authenticated API key. |
scopes | array of string | No | No | Not specified | None specified | API permissions granted to the credential. Use the smallest required set. |
agent_ids | array of string, nullable | No | Yes | Not specified | None specified | Agent identifiers to which the credential is restricted. |
{
"key_id": "0c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"organization_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"environment_id": "6f0d3c52-8a51-4f0e-9a43-2b8f1f2a7c10",
"scopes": [
"decisions.write"
],
"agent_ids": null
}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 "https://api.reqlo.io/v1/key-context" \
-H "Authorization: Bearer $REQLO_API_KEY"Errors and recovery
| Code | HTTP | Retry? | Meaning and recovery |
|---|---|---|---|
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. |
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
Project keys are secrets: keep them on your servers, out of logs and out of prompts. A key can't change policies, agents or keys, and can't approve requests.
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. - Credentials — Check which environment a project key belongs to, who a CLI token acts as, and revoke a CLI token.
- Guides: Authentication and the CLI.
Who a CLI token acts as
/v1/mePurpose and when to use
Returns the person a CLI token belongs to. reqlo whoami 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/me.
Request contract
This endpoint has no request body. Unknown fields and query parameters are rejected with 422 parameter_invalid.
Response 200
The person.
| Field | Type | Required | Nullable | Default | Validation and restrictions | Description |
|---|---|---|---|---|---|---|
id | string (uuid) | No | No | Not specified | format uuid | Identifier of this object. Treat it as opaque; an identifier is not identity proof. |
email | string | No | No | Not specified | None specified | Email address associated with this account or invitation. |
{
"id": "1f2e3d4c-5b6a-4978-8a9b-0c1d2e3f4a5b",
"email": "you@example.com"
}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/me" \
-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. |
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. - Credentials — Check which environment a project key belongs to, who a CLI token acts as, and revoke a CLI token.
- Guides: Authentication and the CLI.
Revoke this CLI token
/v1/access-tokens/current/revokePurpose and when to use
Revokes the token used for this request. reqlo logout uses it. Send an empty JSON object.
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/access-tokens/current/revoke.
Request contract
Send a JSON body with Content-Type: application/json. Unknown fields and query parameters are rejected with 422 parameter_invalid.
Response 200
The revoked token's metadata.
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/access-tokens/current/revoke" \
-H "Authorization: Bearer $REQLO_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'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. |
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. - Credentials — Check which environment a project key belongs to, who a CLI token acts as, and revoke a CLI token.
- Guides: Authentication and the CLI.
Something wrong or unclear? Report an issue with this page.