Errors
The error body each API returns, Titan's error codes and what to do about each, and which errors are safe to retry.
On this page
Failed requests return a 4xx or 5xx status with a JSON body. Branch on the status and the machine-readable code, never on message: messages are for people and can change.
Before a request reaches any service, the gateway at api.hexelstudio.com checks its credentials, path and size. Those errors (401 for a missing or invalid token or API key, 404 for an unknown path, 429 for a rate limit, 502 to 504 when a service fails) have their own body, described in Gateway errors. Identity and access errors are on that page too.
Titan
Error body
Every Titan API answers an error with an error object:
{
"error": {
"code": "POLICY_REVISION_STALE",
"message": "..."
}
}The machine-readable code, in capitals, for example NOT_FOUND. The tables below list them.
A description for people, when there is one. Management and administration errors usually carry only code; administration never says more, so it reveals nothing about other approvals, approvers or policy.
Agent API only: whether the same request may succeed later.
Agent API only: the request's id (req_ and 32 hex characters). Include it when you contact support.
With the TypeScript SDK, a refused call throws a TitanError whose status is the HTTP status and whose body is this object.
Status codes
| Status | Meaning |
|---|---|
400 | The request is invalid: a malformed body, path or query, or a value Titan won't accept. The code says which. |
401 | The token or key is missing or invalid (UNAUTHENTICATED), or an agent's identity exchange was refused. |
403 | You are authenticated but not allowed: a missing permission, another organization's resource, a policy deny, or a kill. |
404 | The resource doesn't exist or you can't see it. A resource of another organization is usually 404, so Titan doesn't reveal that it exists. |
405 | The method isn't supported on this route. |
406, 415 | The Accept or Content-Type header isn't the media type the route takes (application/json). |
409 | The request conflicts with the current state: a stale revision, a decided approval, a reached limit. |
412 | A versioned setting changed since you read it. Read it again and reapply. |
413 | The body or headers are too large. |
500 | An unexpected error in the service. |
428 | An agent's side-effecting call came without an Idempotency-Key. |
429 | A rate or concurrency limit. Retry after a back-off. |
502 | Titan couldn't complete a step with another service; the code names the step. |
503 | A dependency Titan needs is unavailable, so it refused before doing anything. Retry after a back-off. |
Retrying
- Retry a
429or a503, and an agent API error withretryable: true, after a back-off. Titan refuses these before it changes anything. - Don't retry a
400,403,404or409unchanged: fix the request, or read the current state first. - A
401usually means the access token expired. Get a new one and retry once. - Repeating a call that takes an
Idempotency-Keywith the same key and the same request is safe: Titan answers with the first result. The same key with a different request is409 IDEMPOTENCY_CONFLICT.
Deployments and policy
Under /v1/titan/management/. The most common codes:
| Status | Code | Meaning |
|---|---|---|
400 | INVALID_REQUEST | The body, path, query or idempotency key is invalid. |
400 | IDEMPOTENCY_KEY_REQUIRED | Creating a deployment needs an Idempotency-Key. |
400 | PROFILE_NOT_AVAILABLE | No approved deployment profile matches the region, hosting mode and exposure you asked for. |
400 | POLICY_INVALID | The policy doesn't compile, names another organization or deployment, or doesn't combine with your organization's policy layers. |
400 | POLICY_TERM_UNSUPPORTED | A rule uses a limit or obligation Titan can't enforce yet. |
400 | POLICY_LAYER_INVALID | An organization or workspace policy layer is invalid. |
400 | OBLIGATION_PROFILE_UNKNOWN | The policy refers to an obligation profile the deployment doesn't have installed. |
400 | CAPABILITIES_INVALID | The capability selection is invalid. |
400 | SETTINGS_INVALID, SETTINGS_ABOVE_PLAN | A setting is invalid, or above what your plan allows. |
400 | ENVIRONMENT_STATES_INVALID, LOCAL_TOOL_RULES_INVALID, DEFENDER_INVALID | The environment states, local tool rules or defender rules are invalid. |
400 | CUSTOM_DOMAIN_INVALID, CUSTOM_DOMAIN_REJECTED | The custom domain is invalid or was refused. |
401 | UNAUTHENTICATED | No valid caller identity. |
403 | FORBIDDEN | Your organization doesn't match, or you lack the permission (for example titan:enforcement_deployment:create to change a policy). |
404 | NOT_FOUND | No such deployment or operation in your organization, or the feature isn't turned on for it. |
405 | METHOD_NOT_ALLOWED | The method isn't supported on this route. |
409 | IDEMPOTENCY_CONFLICT | The Idempotency-Key was used before with a different request. |
409 | DEPLOYMENT_QUOTA_REACHED | Your organization has as many deployments as its plan allows. |
409 | DEPLOYMENT_NOT_PROVISIONED, DEPLOYMENT_RETIRED | The deployment isn't provisioned yet, or is retired. |
409 | OPERATION_IN_PROGRESS | Another operation on the deployment is still running. |
409 | POLICY_REVISION_STALE | The policy's source_revision isn't greater than the one in force: someone saved a change after you read it. Read it again, reapply, save. |
409 | CAPABILITIES_POLICY_CONFLICT | The capability selection conflicts with the policy in force. |
409 | OBLIGATION_PROFILE_IN_USE, EXECUTOR_OBLIGATION_PROFILE_IN_USE | A rule still uses the profile you are removing. |
409 | POLICY_LAYER_WORKSPACE_LIMIT_REACHED, SETTINGS_WORKSPACE_LIMIT_REACHED | Too many workspace policy layers or workspace settings. |
409 | CUSTOM_DOMAIN_TAKEN, CUSTOM_DOMAIN_LIMIT_REACHED, CUSTOM_DOMAIN_REMOVING, CUSTOM_DOMAINS_NOT_ENABLED | The custom domain is used elsewhere, the limit is reached, it is being removed, or custom domains aren't on for the deployment. |
412 | ENVIRONMENT_STATES_VERSION_STALE, EXECUTOR_OBLIGATION_PROFILES_VERSION_STALE | The setting changed since you read it. |
413 | REQUEST_TOO_LARGE | The body is too large. |
415 | UNSUPPORTED_MEDIA_TYPE | Send Content-Type: application/json. |
502 | the failed step | A provisioning step failed; the code names it. |
503 | SERVICE_UNAVAILABLE, PLAN_CEILING_UNAVAILABLE, CUSTOM_DOMAIN_PROVIDER_UNAVAILABLE | Storage, your plan's limits or the domain provider couldn't be reached. Retry later. |
Approvals and administration
Under /v1/titan/admin/. On Titan Cloud each call through api.hexelstudio.com also needs the Titan-Enforcement-Deployment header; without it, or naming another organization's deployment, it is refused. Through the deployment's own hostname the header isn't needed.
| Status | Code | Meaning |
|---|---|---|
400 | INVALID_REQUEST | The body, path or query is invalid. |
400 | INVALID_LIMIT, INVALID_OFFSET, INVALID_CURSOR, INVALID_STATE, INVALID_QUERY, INVALID_AFTER, INVALID_BEFORE | A paging, time or filter parameter is invalid. |
400 | INVALID_SCOPE | X-Environment-Id was sent without X-Workspace-Id. |
401 | UNAUTHENTICATED | No valid caller identity. |
403 | FORBIDDEN | You lack the permission, for example titan:approval:read or titan:approval:decide, or the deployment isn't yours. |
403 | NOT_AN_ELIGIBLE_APPROVER | You aren't a member of an approval role that applies to the request. |
403 | DELEGATOR_SEPARATION | The agent acts for you, and the approval profile requires someone else to approve. |
403 | DEVICE_SIGNATURE_REQUIRED | You must approve this request with your phone. |
403 | REQUESTER_SEPARATION | You requested the call, and the approval profile requires someone else to approve it. |
403 | APPROVAL_CHANNEL_NOT_ALLOWED | The organization's settings don't allow deciding approvals here. |
404 | NOT_FOUND | No such approval, session or entry for this deployment. |
409 | APPROVAL_NOT_PENDING | The request was already decided, or expired. Read its state. |
409 | APPROVAL_REVALIDATION_FAILED | Your approval completed the request, but the call no longer passes the policy in force, or the request expired. It is now denied (or expired) and nothing ran. |
409 | APPROVAL_NO_ACTIVE_LEG | The session the call belongs to has no running process right now. Your vote is kept and the request stays pending; decide again once the session is running. |
413 | PAYLOAD_TOO_LARGE | The body is too large. |
415 | UNSUPPORTED_MEDIA_TYPE | Send Content-Type: application/json. |
503 | SERVICE_UNAVAILABLE | A dependency is unavailable, or Titan can't record the audit for the change yet. Nothing changed; retry later. |
Agent API
Under /v1/titan/agent/, for agent processes. These errors also carry retryable and request_id. The codes for capability calls, approvals and executions:
| Status | Code | Retryable | Meaning |
|---|---|---|---|
400 | INVALID_REQUEST | No | A header Titan doesn't accept, or a body or argument that fails the capability's contract. |
400 | IDEMPOTENCY_KEY_FORBIDDEN | No | An Idempotency-Key on a call that doesn't take one. |
401 | UNAUTHENTICATED | No | A missing or invalid runtime token or device proof, or an assurance level below what the route needs. |
403 | FORBIDDEN | No | The policy denies the call, a kill is in force, or the session is restricted. The body says nothing more. |
403 | SECRET_SOURCE_NOT_ALLOWED | No | A web login's secret source isn't one your organization allows. |
404 | NOT_FOUND | No | The capability or object doesn't exist or isn't visible to this agent. |
406 | NOT_ACCEPTABLE | No | The Accept header isn't the route's media type. |
409 | IDEMPOTENCY_CONFLICT | No | The Idempotency-Key was used before with a different call. |
409 | GOVERNED_ACTION_LIMIT_REACHED | No | Your plan's monthly limit of governed actions is used up. Nothing ran. |
409 | GOVERNED_ACTION_BUDGET_EXCEEDED | No | An enforced billing budget of the organization, workspace or environment is used up. Nothing ran. |
409 | RESULT_NOT_READY | Yes | The execution hasn't finished. Read it again later. |
409 | EXECUTION_NOT_SUCCESSFUL | No | The execution ended without a result to return. |
413 | PAYLOAD_TOO_LARGE | No | Too many or too large headers, or the body is too large. |
415 | UNSUPPORTED_MEDIA_TYPE | No | The Content-Type isn't the route's media type. |
428 | IDEMPOTENCY_KEY_REQUIRED | No | A side-effecting call needs an Idempotency-Key. |
429 | RATE_LIMITED | Yes | The agent's rate or concurrency limit. |
503 | SERVICE_UNAVAILABLE | Yes | Something Titan needs to accept the call safely is unavailable. Nothing ran. |
A call that needs approval isn't an error: it answers 202 with the approval request's id. A call that ran and failed at the tool answers 200 with the execution's outcome, for example DESTINATION_FAILED, in the body.
The identity exchange (POST /v1/titan/broker/runtime-identities/exchange), where an agent gets its runtime token, has its own codes:
| Status | Codes |
|---|---|
400 | INVALID_IDENTITY_EXCHANGE, RUNNER_PROOF_STALE, SOURCE_CREDENTIAL_STALE |
401 | INVALID_SOURCE_CREDENTIAL, SOURCE_CREDENTIAL_REPLAYED, SOURCE_VERIFIER_AMBIGUOUS, UNKNOWN_SOURCE_VERIFIER |
403 | ASSURANCE_INSUFFICIENT, DELEGATED_USER_ORGANIZATION_MISMATCH, IDENTITY_BINDING_AMBIGUOUS, IDENTITY_BINDING_NOT_FOUND, IDENTITY_CONTEXT_MISMATCH, IDENTITY_INACTIVE, SESSION_DELEGATION_DENIED |
409 | DURABLE_SESSION_EXPIRED, DURABLE_SESSION_SUSPENDED, SESSION_CONTINUATION_DENIED, SESSION_CONTINUATION_LAPSED |
429 | IDENTITY_EXCHANGE_RATE_LIMITED |
503 | LOCAL_IDENTITY_STATE_UNAVAILABLE |
Tools and connections
Under /v1/titan/tools/. These errors always have a message.
| Status | Code | Meaning |
|---|---|---|
400 | INVALID_REQUEST | The body is invalid, or the credentials don't fit the auth config (the message names the field). |
400 | INVALID_SCOPE, INVALID_LIFECYCLE | An unknown scope, or a new tool's lifecycle other than draft or published. |
400 | INVALID_TENANT_SCOPE | The workspace or environment id is invalid. |
403 | FORBIDDEN | You may see this tool or toolkit but not change it (a system tool). |
403 | ORG_MISMATCH | The body names another organization. |
404 | NOT_FOUND and similar | No such tool, toolkit, auth config or connected account in your organization. |
409 | SLUG_EXISTS, TOOL_EXISTS | The slug, or the tool's slug and version, is taken. |
409 | PUBLISHED_TOOLS_LIMIT | Your organization has as many published tools as its plan allows. |
500 | INTERNAL_ERROR | An unexpected error. Retry later; contact support if it persists. |
Compute and Agent Registry
The Compute API and the Agent Registry API in this reference use their own bodies.
{
"code": 404,
"error_code": "string",
"message": "string"
}code is the HTTP status, error_code a machine-readable code. Compute also returns 502 when an upstream service failed and 503 when it can't handle the request right now.
{
"error": "string",
"message": "string"
}error is a short identifier. The Agent Registry returns 409 when the request conflicts with the resource's current state.