Docs

Error Glossary

Every error response from Cadreen follows the same structure. Parse the error.code, not the error.message. Codes are stable; messages may change phrasing.

Canonical error shape

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

Outcome vs. Error

Not every non-200 response is an error. Some 2xx responses carry a structured status:

HTTPStatus fieldMeaning
200answeredIntent resolved immediately. Read message.content.
200needs_inputMore information required. Read clarification.questions.
200ready_to_executePlan is ready. Trigger execution to proceed.
200executingMission is running. Stream or poll for progress.
200blocked_by_policyGovernance prevented the action. Read next_action for resolution path.
200failedExecution 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.

Error catalog

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.

HTTPCodeHint
400invalid_requestCheck request syntax. Ensure the body is valid JSON and all required fields are present.
400missing_fieldsInclude at least one of: connections, credentials, memory, or policies.
400invalid_memory_typeValid types are: reference, preference, episode, precedent, note, project.
400invalid_memory_idMemory IDs are UUIDs — check that the ID is well-formed and exists.
400memory_query_requiredProvide a `query` parameter to search memory.
400openapi_invalid_urlThe OpenAPI spec URL must be a valid HTTPS URL.
400assessment_missing_taskProvide a `task` describing what you want to accomplish.
400policy_missing_namePolicies require a `name` field.
400escalation_missing_decisionProvide a `decision` field with one of: auto, auto_complete, handoff, escalate, clarify_requester, abstain.
401unauthorizedInclude an `Authorization: Bearer <api_key>` header with a valid API key.
404not_foundThe requested resource or endpoint was not found. Check the URL path.
403forbiddenYour API key does not have permission for this resource.
403connection_forbiddenThis connection belongs to a different workspace or requires elevated permissions.
403blocked_by_policyAction matched a governance policy. Review the policy and the `next_action` suggestions in the response.
403conditional_approval_requiredHuman approval needed. Follow the approve URL in the response.
404memory_not_foundThe requested memory item was not found — verify the ID or create it first.
404connection_not_foundVerify the connection ID or capability name. List connections with GET /connections.
404policy_not_foundThe requested policy bundle was not found. List policies with GET /policies.
404escalation_not_foundThe escalation ID was not found. List escalations with GET /escalations.
404credential_not_foundThe credential ID was not found. List credentials with GET /credentials.
404intelligence_not_foundThe requested trace was not found. List traces with GET /intelligence.
404webhook_not_foundThe webhook subscription was not found. List webhooks with GET /webhooks.
422tenant_requiredPass a valid workspace ID header.
422missing_capabilityRequired tool not connected. Connect the missing integration.
422degraded_capabilityRequired tool connected but unhealthy. Check /cadreen/health for subsystem status.
429rate_limitReduce request frequency or request a rate limit increase. See the `Retry-After` header.
503store_unavailableA backend dependency is temporarily unavailable. Retry with exponential backoff.
503service_unavailableA backend dependency is temporarily unavailable. Retry with exponential backoff.
500internal_errorServer-side failure. Retry with exponential backoff. Report the trace ID if persistent.
500memory_creation_failedEnsure `content.text` is non-empty and the type is valid.
500memory_search_failedInternal knowledge query failed. Retry with a more specific query.
503governance_unavailableGovernance system is not configured. Contact your workspace admin.
500policy_query_failedGovernance policy query failed. Retry or check governance configuration.
500policy_creation_failedPolicy creation failed. Check for duplicate names or invalid rules.
500policy_confirm_failedPolicy confirmation failed. Verify the policy ID and version are correct.
500policy_evaluation_failedCheck that the policy `rule` is a valid natural-language condition.
503capabilities_unavailableCapability graph is not configured. This workspace may not have tools registered.
503audit_unavailableAudit log is not configured. Contact your workspace admin.
500audit_query_failedAudit query failed. Check filter parameters and retry.
503learning_unavailableLearning system is not configured. Contact your workspace admin.
503escalations_unavailableEscalation system is not configured. Contact your workspace admin.
503credentials_unavailableCredential store is not configured. Contact your workspace admin.
500credential_creation_failedEnsure `provider`, `name`, and `key_data` are all provided.
500diagnosis_failedProvide at minimum `error_message` and optionally `error_category` and `tool_name`.
503intelligence_unavailableIntelligence trace system is not configured. Contact your workspace admin.
503webhook_unavailableWebhook system is not configured. Contact your workspace admin.
500webhook_creation_failedProvide a valid `url` (HTTPS required), at least one `event`, and a `secret`.
500connection_unregister_failedConnection deletion failed. Verify the ID is valid and the connection exists.
503provider_unavailableIntegration provider is not configured. Contact your workspace admin.
503openapi_unavailableOpenAPI integration is not configured. Contact your workspace admin.
503mcp_unavailableMCP gateway is not configured. Contact your workspace admin.
500escalation_resolve_failedEscalation resolution failed. Verify the decision value is valid.
500credential_delete_failedCredential deletion failed. Verify the ID is valid.
500webhook_delete_failedWebhook deletion failed. Verify the ID is valid.
500intelligence_query_failedIntelligence query failed. Check filter parameters and retry.
503diagnosis_unavailableHealing diagnostics are not configured. Contact your workspace admin.
503preconditions_unavailablePrecondition checking is not configured. Contact your workspace admin.
500install_failedIntegration installation failed. Check the integration ID and try again.
500openapi_fetch_failedCould not fetch the OpenAPI spec from the provided URL. Check it is publicly accessible.
500openapi_read_failedCould not parse the OpenAPI spec. Ensure it is valid JSON or YAML.
500openapi_invalid_specThe OpenAPI spec is syntactically valid but missing required fields (e.g. paths, info).
500openapi_generation_failedTool generation from the OpenAPI spec failed. Check the spec structure.
500mcp_registration_failedMCP server registration failed. Check the connection URL and protocol.
500escalation_list_failedEscalation listing failed. Retry or contact support.
500credential_list_failedCredential listing failed. Retry or contact support.
500webhook_list_failedWebhook listing failed. Retry or contact support.
500intelligence_stats_failedIntelligence stats aggregation failed. Retry or contact support.
500audit_stats_failedAudit stats aggregation failed. Retry or contact support.
500audit_timeline_failedExecution timeline query failed. Verify the execution ID.
500learning_detection_failedPattern detection failed. Contact support.
500learning_query_failedLearning query failed. Contact support.
500learning_suggestion_failedKnowledge suggestion failed. Contact support.
500preconditions_check_failedPrecondition check failed. Verify tool parameters.
503routing_unavailableIntent routing engine is not initialized. Contact your workspace admin.

Recovery & self-healing

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.

What not to do

Common integration mistakes and how to avoid them.

  • 1Do not parse prose to decide what happened. Always branch on type, status, or gate.reason_code. Message content strings may change phrasing.
  • 2Do not ignore governance gates. The X-Cadreen-Gate header says blocked — the action did not execute. Do not retry without resolving the gate first.
  • 3Do not retry blindly. Check the gate and next_action first. Retries without resolving the root cause are wasted calls and will hit the same block.
  • 4Do not store secrets in memory items. Use 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.
  • 5Do not treat intelligence.process.duration_ms as SLA. It varies with model latency and system load. Use X-Cadreen-Trace-ID for observability, not timing contracts.
  • 6Do not hard-code field paths inside intelligence. Use the field_stability.stable list to know what is safe to depend on. Fields in evolving may change.
  • 7Do not discard the setup response. 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.