Skip to main content
The OneCLI API uses standard HTTP status codes to indicate the outcome of a request. Codes in the 2xx range indicate success, 4xx codes indicate a client error, and 5xx codes indicate a server error. This page covers the management API (api.onecli.sh/v1). Errors on an agent’s proxied traffic — requests that ride the gateway to a provider — use flat, code-tagged bodies documented separately in Gateway errors.

Error response format

Error responses come in two shapes. Route-level validation errors return a flat error string:
For validation errors, the message is the first issue reported by the validator. Authentication failures and service errors use an envelope with a message and a type:
Handle both: read error when it is a string, otherwise error.message.

Error reference

Common error messages

General

Agents

Secrets

Grants

Policy rules (organization)

Apps

User

Retired endpoints (410)

The move to agent grants retired the legacy rules model and the project-scope policy CRUD. Retired paths answer 410 Gone with a message that names the replacement — the pointer differs by scope, because the capability split: project access is written through grants, while organization rules keep the full policy console. Project-scope tombstones end with:
Project access is granted per agent: PUT /v1/agents/:agentId/grants/connections/:connectionId and /v1/agents/:agentId/grants/secrets/:secretId.
Organization-scope tombstones end with:
Use /v1/org/policy — one first-match rule set covering blocks, allows, rate limits, approvals and app permissions.
GET /v1/policy/effective-app-permissions is not retired — it is the surviving project-scope reflection.

Retry guidance

Most 4xx errors are not retryable. They indicate a problem with the request that must be fixed before retrying. For 500 errors, retry with exponential backoff: