ReferenceHTTP API

Error codes

Every error the API returns, its status, meaning, and the fix.

Errors always use the same envelope:

{
  "error": {
    "code": "validation_error",
    "message": "The request contains invalid fields.",
    "details": {}
  },
  "requestId": "01J..."
}

details is present only when the error carries structured information — most often a flattened validation result naming the offending fields.

Authentication and authorization

StatusCodeMeaning and fix
401unauthorizedNo credential, an unrecognised one, or a revoked key. Send Authorization: Bearer wor_….
403insufficient_scopeValid key, missing scope. Scopes are fixed at creation — issue a new key.
403session_requiredThe endpoint is session-only: API keys, organizations, projects.
403organization_forbiddenYou are not owner or admin in that organization, so you cannot create a project in it.

Validation

StatusCodeMeaning and fix
400validation_errorA field failed schema validation. details names the fields.
400invalid_modelThe model identifier is not in the current directory. Pick a listed model.
400invalid_scheduleThe cron expression is not five fields, or cannot produce a future occurrence.
400invalid_nameThe name contains no letters or digits, so no slug can be derived.
400tool_policy_requires_connectionTool policies must reference a saved connection; they cannot be created inline with a routine.
413body_too_large/v1 bodies are capped at 1 MB.

Not found

StatusCodeMeaning
404routine_not_foundNo routine with that id in this project.
404run_not_foundNo run with that id in this project.
404connection_not_foundNo connection with that id in this project.
404tool_policy_not_foundNo such policy, or it belongs to a different routine.
404api_key_not_foundNo such key in this project, or it is already revoked.
404not_foundNo route matched.

404 rather than 403 across projects

A resource that exists in another project returns 404. The API does not confirm the existence of something the credential cannot see.

Conflicts

StatusCodeMeaning and fix
409successful_run_requiredActivation needs a successful manual run of the current configuration.
409routine_archivedArchived routines cannot run. Unarchive or recreate.
409automatic_tool_confirmation_requiredSend confirmAutomaticExecution: true alongside automaticExecution: true.

Rate limiting

StatusCodeMeaning and fix
429rate_limit_exceededPer-credential window exceeded. Honour Retry-After; details.retryAfterSeconds repeats it.

Upstream and service

StatusCodeMeaning and fix
502model_directory_unavailableLLMGateway's directory could not be read. Retry.
502mcp_discovery_failedThe MCP server was unreachable or returned invalid tools. Check the URL and headers.
503scheduler_unavailable/internal/scheduler/tick was called on a deployment with no scheduler configured.
500internal_errorUnexpected failure. Quote the requestId.

Run error categories are different

The codes above describe API requests. A run that fails carries an error.category instead — tool_denied, step_limit, gateway_timeout, and so on. See Run states and error categories.

On this page

Edit this page on GitHub