Skip to content
Hexel StudioDocs

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:

JSON
{
  "error": {
    "code": "POLICY_REVISION_STALE",
    "message": "..."
  }
}
error.codestringrequired

The machine-readable code, in capitals, for example NOT_FOUND. The tables below list them.

error.messagestring

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.

error.retryableboolean

Agent API only: whether the same request may succeed later.

error.request_idstring

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

StatusMeaning
400The request is invalid: a malformed body, path or query, or a value Titan won't accept. The code says which.
401The token or key is missing or invalid (UNAUTHENTICATED), or an agent's identity exchange was refused.
403You are authenticated but not allowed: a missing permission, another organization's resource, a policy deny, or a kill.
404The 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.
405The method isn't supported on this route.
406, 415The Accept or Content-Type header isn't the media type the route takes (application/json).
409The request conflicts with the current state: a stale revision, a decided approval, a reached limit.
412A versioned setting changed since you read it. Read it again and reapply.
413The body or headers are too large.
500An unexpected error in the service.
428An agent's side-effecting call came without an Idempotency-Key.
429A rate or concurrency limit. Retry after a back-off.
502Titan couldn't complete a step with another service; the code names the step.
503A dependency Titan needs is unavailable, so it refused before doing anything. Retry after a back-off.

Retrying

  • Retry a 429 or a 503, and an agent API error with retryable: true, after a back-off. Titan refuses these before it changes anything.
  • Don't retry a 400, 403, 404 or 409 unchanged: fix the request, or read the current state first.
  • A 401 usually means the access token expired. Get a new one and retry once.
  • Repeating a call that takes an Idempotency-Key with the same key and the same request is safe: Titan answers with the first result. The same key with a different request is 409 IDEMPOTENCY_CONFLICT.

Deployments and policy

Under /v1/titan/management/. The most common codes:

StatusCodeMeaning
400INVALID_REQUESTThe body, path, query or idempotency key is invalid.
400IDEMPOTENCY_KEY_REQUIREDCreating a deployment needs an Idempotency-Key.
400PROFILE_NOT_AVAILABLENo approved deployment profile matches the region, hosting mode and exposure you asked for.
400POLICY_INVALIDThe policy doesn't compile, names another organization or deployment, or doesn't combine with your organization's policy layers.
400POLICY_TERM_UNSUPPORTEDA rule uses a limit or obligation Titan can't enforce yet.
400POLICY_LAYER_INVALIDAn organization or workspace policy layer is invalid.
400OBLIGATION_PROFILE_UNKNOWNThe policy refers to an obligation profile the deployment doesn't have installed.
400CAPABILITIES_INVALIDThe capability selection is invalid.
400SETTINGS_INVALID, SETTINGS_ABOVE_PLANA setting is invalid, or above what your plan allows.
400ENVIRONMENT_STATES_INVALID, LOCAL_TOOL_RULES_INVALID, DEFENDER_INVALIDThe environment states, local tool rules or defender rules are invalid.
400CUSTOM_DOMAIN_INVALID, CUSTOM_DOMAIN_REJECTEDThe custom domain is invalid or was refused.
401UNAUTHENTICATEDNo valid caller identity.
403FORBIDDENYour organization doesn't match, or you lack the permission (for example titan:enforcement_deployment:create to change a policy).
404NOT_FOUNDNo such deployment or operation in your organization, or the feature isn't turned on for it.
405METHOD_NOT_ALLOWEDThe method isn't supported on this route.
409IDEMPOTENCY_CONFLICTThe Idempotency-Key was used before with a different request.
409DEPLOYMENT_QUOTA_REACHEDYour organization has as many deployments as its plan allows.
409DEPLOYMENT_NOT_PROVISIONED, DEPLOYMENT_RETIREDThe deployment isn't provisioned yet, or is retired.
409OPERATION_IN_PROGRESSAnother operation on the deployment is still running.
409POLICY_REVISION_STALEThe 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.
409CAPABILITIES_POLICY_CONFLICTThe capability selection conflicts with the policy in force.
409OBLIGATION_PROFILE_IN_USE, EXECUTOR_OBLIGATION_PROFILE_IN_USEA rule still uses the profile you are removing.
409POLICY_LAYER_WORKSPACE_LIMIT_REACHED, SETTINGS_WORKSPACE_LIMIT_REACHEDToo many workspace policy layers or workspace settings.
409CUSTOM_DOMAIN_TAKEN, CUSTOM_DOMAIN_LIMIT_REACHED, CUSTOM_DOMAIN_REMOVING, CUSTOM_DOMAINS_NOT_ENABLEDThe custom domain is used elsewhere, the limit is reached, it is being removed, or custom domains aren't on for the deployment.
412ENVIRONMENT_STATES_VERSION_STALE, EXECUTOR_OBLIGATION_PROFILES_VERSION_STALEThe setting changed since you read it.
413REQUEST_TOO_LARGEThe body is too large.
415UNSUPPORTED_MEDIA_TYPESend Content-Type: application/json.
502the failed stepA provisioning step failed; the code names it.
503SERVICE_UNAVAILABLE, PLAN_CEILING_UNAVAILABLE, CUSTOM_DOMAIN_PROVIDER_UNAVAILABLEStorage, 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.

StatusCodeMeaning
400INVALID_REQUESTThe body, path or query is invalid.
400INVALID_LIMIT, INVALID_OFFSET, INVALID_CURSOR, INVALID_STATE, INVALID_QUERY, INVALID_AFTER, INVALID_BEFOREA paging, time or filter parameter is invalid.
400INVALID_SCOPEX-Environment-Id was sent without X-Workspace-Id.
401UNAUTHENTICATEDNo valid caller identity.
403FORBIDDENYou lack the permission, for example titan:approval:read or titan:approval:decide, or the deployment isn't yours.
403NOT_AN_ELIGIBLE_APPROVERYou aren't a member of an approval role that applies to the request.
403DELEGATOR_SEPARATIONThe agent acts for you, and the approval profile requires someone else to approve.
403DEVICE_SIGNATURE_REQUIREDYou must approve this request with your phone.
403REQUESTER_SEPARATIONYou requested the call, and the approval profile requires someone else to approve it.
403APPROVAL_CHANNEL_NOT_ALLOWEDThe organization's settings don't allow deciding approvals here.
404NOT_FOUNDNo such approval, session or entry for this deployment.
409APPROVAL_NOT_PENDINGThe request was already decided, or expired. Read its state.
409APPROVAL_REVALIDATION_FAILEDYour 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.
409APPROVAL_NO_ACTIVE_LEGThe 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.
413PAYLOAD_TOO_LARGEThe body is too large.
415UNSUPPORTED_MEDIA_TYPESend Content-Type: application/json.
503SERVICE_UNAVAILABLEA 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:

StatusCodeRetryableMeaning
400INVALID_REQUESTNoA header Titan doesn't accept, or a body or argument that fails the capability's contract.
400IDEMPOTENCY_KEY_FORBIDDENNoAn Idempotency-Key on a call that doesn't take one.
401UNAUTHENTICATEDNoA missing or invalid runtime token or device proof, or an assurance level below what the route needs.
403FORBIDDENNoThe policy denies the call, a kill is in force, or the session is restricted. The body says nothing more.
403SECRET_SOURCE_NOT_ALLOWEDNoA web login's secret source isn't one your organization allows.
404NOT_FOUNDNoThe capability or object doesn't exist or isn't visible to this agent.
406NOT_ACCEPTABLENoThe Accept header isn't the route's media type.
409IDEMPOTENCY_CONFLICTNoThe Idempotency-Key was used before with a different call.
409GOVERNED_ACTION_LIMIT_REACHEDNoYour plan's monthly limit of governed actions is used up. Nothing ran.
409GOVERNED_ACTION_BUDGET_EXCEEDEDNoAn enforced billing budget of the organization, workspace or environment is used up. Nothing ran.
409RESULT_NOT_READYYesThe execution hasn't finished. Read it again later.
409EXECUTION_NOT_SUCCESSFULNoThe execution ended without a result to return.
413PAYLOAD_TOO_LARGENoToo many or too large headers, or the body is too large.
415UNSUPPORTED_MEDIA_TYPENoThe Content-Type isn't the route's media type.
428IDEMPOTENCY_KEY_REQUIREDNoA side-effecting call needs an Idempotency-Key.
429RATE_LIMITEDYesThe agent's rate or concurrency limit.
503SERVICE_UNAVAILABLEYesSomething 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:

StatusCodes
400INVALID_IDENTITY_EXCHANGE, RUNNER_PROOF_STALE, SOURCE_CREDENTIAL_STALE
401INVALID_SOURCE_CREDENTIAL, SOURCE_CREDENTIAL_REPLAYED, SOURCE_VERIFIER_AMBIGUOUS, UNKNOWN_SOURCE_VERIFIER
403ASSURANCE_INSUFFICIENT, DELEGATED_USER_ORGANIZATION_MISMATCH, IDENTITY_BINDING_AMBIGUOUS, IDENTITY_BINDING_NOT_FOUND, IDENTITY_CONTEXT_MISMATCH, IDENTITY_INACTIVE, SESSION_DELEGATION_DENIED
409DURABLE_SESSION_EXPIRED, DURABLE_SESSION_SUSPENDED, SESSION_CONTINUATION_DENIED, SESSION_CONTINUATION_LAPSED
429IDENTITY_EXCHANGE_RATE_LIMITED
503LOCAL_IDENTITY_STATE_UNAVAILABLE

Tools and connections

Under /v1/titan/tools/. These errors always have a message.

StatusCodeMeaning
400INVALID_REQUESTThe body is invalid, or the credentials don't fit the auth config (the message names the field).
400INVALID_SCOPE, INVALID_LIFECYCLEAn unknown scope, or a new tool's lifecycle other than draft or published.
400INVALID_TENANT_SCOPEThe workspace or environment id is invalid.
403FORBIDDENYou may see this tool or toolkit but not change it (a system tool).
403ORG_MISMATCHThe body names another organization.
404NOT_FOUND and similarNo such tool, toolkit, auth config or connected account in your organization.
409SLUG_EXISTS, TOOL_EXISTSThe slug, or the tool's slug and version, is taken.
409PUBLISHED_TOOLS_LIMITYour organization has as many published tools as its plan allows.
500INTERNAL_ERRORAn 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.

JSON
{
  "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.