Every error response from Cadreen follows the same structure. Parse the error.code, not the error.message. Codes are stable; messages may change phrasing.
{
"error": {
"type": "permission_error",
"code": "blocked_by_policy",
"message": "Action blocked by governance policy",
"hint": "Resolve the escalation or adjust governance rules",
"doc_url": "https://accomplishanything.today/infra/docs/errors#err-blocked_by_policy",
"next_action": {
"type": "resolve_escalation",
"label": "Resolve the policy block"
}
}
}Every error response includes a trace_id. Use it to inspect the full context in the dashboard trace explorer.
Not every non-200 response is an error. Some 2xx responses carry a structured status:
| HTTP | Status field | Meaning |
|---|---|---|
| 200 | answered | Intent resolved immediately. Read message.content. |
| 200 | needs_input | More information required. Read clarification.questions. |
| 200 | ready_to_execute | Plan is ready. Trigger execution to proceed. |
| 200 | executing | Mission is running. Stream or poll for progress. |
| 200 | blocked_by_policy | Governance prevented the action. Read next_action for resolution path. |
| 200 | failed | Execution failed. Use the trace ID to diagnose via /intelligence. |
Branch on status or type, never on the HTTP status alone. The X-Cadreen-Gate header mirrors the gate: ok, blocked, escalate, needs_input.
Every error code Cadreen returns. The hint field on each error response tells you how to fix it. Bookmark this page — it is the canonical error reference.
| HTTP | Code | Hint |
|---|---|---|
| 400 | invalid_request | Check request syntax. Ensure the body is valid JSON and all required fields are present. |
| 400 | missing_fields | Include at least one of: connections, credentials, memory, or policies. |
| 400 | invalid_memory_type | Valid types are: reference, preference, episode, precedent, note, project. |
| 400 | invalid_memory_id | Memory IDs are UUIDs — check that the ID is well-formed and exists. |
| 400 | memory_query_required | Provide a `query` parameter to search memory. |
| 400 | openapi_invalid_url | The OpenAPI spec URL must be a valid HTTPS URL. |
| 400 | assessment_missing_task | Provide a `task` describing what you want to accomplish. |
| 400 | policy_missing_name | Policies require a `name` field. |
| 400 | escalation_missing_decision | Provide a `decision` field with one of: auto, auto_complete, handoff, escalate, clarify_requester, abstain. |
| 401 | unauthorized | Include an `Authorization: Bearer <api_key>` header with a valid API key. |
| 404 | not_found | The requested resource or endpoint was not found. Check the URL path. |
| 403 | forbidden | Your API key does not have permission for this resource. |
| 403 | connection_forbidden | This connection belongs to a different workspace or requires elevated permissions. |
| 403 | blocked_by_policy | Action matched a governance policy. Review the policy and the `next_action` suggestions in the response. |
| 403 | conditional_approval_required | Human approval needed. Follow the approve URL in the response. |
| 404 | memory_not_found | The requested memory item was not found — verify the ID or create it first. |
| 404 | connection_not_found | Verify the connection ID or capability name. List connections with GET /connections. |
| 404 | policy_not_found | The requested policy bundle was not found. List policies with GET /policies. |
| 404 | escalation_not_found | The escalation ID was not found. List escalations with GET /escalations. |
| 404 | credential_not_found | The credential ID was not found. List credentials with GET /credentials. |
| 404 | intelligence_not_found | The requested trace was not found. List traces with GET /intelligence. |
| 404 | webhook_not_found | The webhook subscription was not found. List webhooks with GET /webhooks. |
| 422 | tenant_required | Pass a valid workspace ID header. |
| 422 | missing_capability | Required tool not connected. Connect the missing integration. |
| 422 | degraded_capability | Required tool connected but unhealthy. Check /cadreen/health for subsystem status. |
| 429 | rate_limit | Reduce request frequency or request a rate limit increase. See the `Retry-After` header. |
| 503 | store_unavailable | A backend dependency is temporarily unavailable. Retry with exponential backoff. |
| 503 | service_unavailable | A backend dependency is temporarily unavailable. Retry with exponential backoff. |
| 500 | internal_error | Server-side failure. Retry with exponential backoff. Report the trace ID if persistent. |
| 500 | memory_creation_failed | Ensure `content.text` is non-empty and the type is valid. |
| 500 | memory_search_failed | Internal knowledge query failed. Retry with a more specific query. |
| 503 | governance_unavailable | Governance system is not configured. Contact your workspace admin. |
| 500 | policy_query_failed | Governance policy query failed. Retry or check governance configuration. |
| 500 | policy_creation_failed | Policy creation failed. Check for duplicate names or invalid rules. |
| 500 | policy_confirm_failed | Policy confirmation failed. Verify the policy ID and version are correct. |
| 500 | policy_evaluation_failed | Check that the policy `rule` is a valid natural-language condition. |
| 503 | capabilities_unavailable | Capability graph is not configured. This workspace may not have tools registered. |
| 503 | audit_unavailable | Audit log is not configured. Contact your workspace admin. |
| 500 | audit_query_failed | Audit query failed. Check filter parameters and retry. |
| 503 | learning_unavailable | Learning system is not configured. Contact your workspace admin. |
| 503 | escalations_unavailable | Escalation system is not configured. Contact your workspace admin. |
| 503 | credentials_unavailable | Credential store is not configured. Contact your workspace admin. |
| 500 | credential_creation_failed | Ensure `provider`, `name`, and `key_data` are all provided. |
| 500 | diagnosis_failed | Provide at minimum `error_message` and optionally `error_category` and `tool_name`. |
| 503 | intelligence_unavailable | Intelligence trace system is not configured. Contact your workspace admin. |
| 503 | webhook_unavailable | Webhook system is not configured. Contact your workspace admin. |
| 500 | webhook_creation_failed | Provide a valid `url` (HTTPS required), at least one `event`, and a `secret`. |
| 500 | connection_unregister_failed | Connection deletion failed. Verify the ID is valid and the connection exists. |
| 503 | provider_unavailable | Integration provider is not configured. Contact your workspace admin. |
| 503 | openapi_unavailable | OpenAPI integration is not configured. Contact your workspace admin. |
| 503 | mcp_unavailable | MCP gateway is not configured. Contact your workspace admin. |
| 500 | escalation_resolve_failed | Escalation resolution failed. Verify the decision value is valid. |
| 500 | credential_delete_failed | Credential deletion failed. Verify the ID is valid. |
| 500 | webhook_delete_failed | Webhook deletion failed. Verify the ID is valid. |
| 500 | intelligence_query_failed | Intelligence query failed. Check filter parameters and retry. |
| 503 | diagnosis_unavailable | Healing diagnostics are not configured. Contact your workspace admin. |
| 503 | preconditions_unavailable | Precondition checking is not configured. Contact your workspace admin. |
| 500 | install_failed | Integration installation failed. Check the integration ID and try again. |
| 500 | openapi_fetch_failed | Could not fetch the OpenAPI spec from the provided URL. Check it is publicly accessible. |
| 500 | openapi_read_failed | Could not parse the OpenAPI spec. Ensure it is valid JSON or YAML. |
| 500 | openapi_invalid_spec | The OpenAPI spec is syntactically valid but missing required fields (e.g. paths, info). |
| 500 | openapi_generation_failed | Tool generation from the OpenAPI spec failed. Check the spec structure. |
| 500 | mcp_registration_failed | MCP server registration failed. Check the connection URL and protocol. |
| 500 | escalation_list_failed | Escalation listing failed. Retry or contact support. |
| 500 | credential_list_failed | Credential listing failed. Retry or contact support. |
| 500 | webhook_list_failed | Webhook listing failed. Retry or contact support. |
| 500 | intelligence_stats_failed | Intelligence stats aggregation failed. Retry or contact support. |
| 500 | audit_stats_failed | Audit stats aggregation failed. Retry or contact support. |
| 500 | audit_timeline_failed | Execution timeline query failed. Verify the execution ID. |
| 500 | learning_detection_failed | Pattern detection failed. Contact support. |
| 500 | learning_query_failed | Learning query failed. Contact support. |
| 500 | learning_suggestion_failed | Knowledge suggestion failed. Contact support. |
| 500 | preconditions_check_failed | Precondition check failed. Verify tool parameters. |
| 503 | routing_unavailable | Intent routing engine is not initialized. Contact your workspace admin. |
For tool failures and execution errors, Cadreen has a self-healing subsystem that diagnoses root causes and records recoveries:
POST /api/v1/cadreen/healing/diagnose — Diagnose a failure by error message, category, and tool name. Returns root cause, confidence, and recovery strategy.GET /api/v1/cadreen/healing/precedents — Browse past recoveries to find a pattern that matches your failure.Common integration mistakes and how to avoid them.
type, status, or gate.reason_code. Message content strings may change phrasing.X-Cadreen-Gate header says blocked — the action did not execute. Do not retry without resolving the gate first.gate and next_action first. Retries without resolving the root cause are wasted calls and will hit the same block.POST /api/v1/cadreen/credentials for API keys, tokens, and secrets. Memory items are queryable and shareable — credentials are encrypted at rest and never surfaced in traces.intelligence.process.duration_ms as SLA. It varies with model latency and system load. Use X-Cadreen-Trace-ID for observability, not timing contracts.intelligence. Use the field_stability.stable list to know what is safe to depend on. Fields in evolving may change.POST /api/v1/cadreen/setup returns your installation checklist: connections to register, memory to upload, policies to confirm, and webhooks to configure. Revisit it as your integration grows.