API reference
A successful answer from most routes carries a trace: not just what the system did, but how it decided. On an error the layer adds only a trace ID, in the X-Cadreen-Trace-ID header (a refusal before the handler runs carries none), and the A2A routes follow their own protocol. The trace has 8 sections. Its field_stability section says which fields keep their shape and which may change.
On this page
Intelligence contract
A successful answer from most routes carries a trace. The sections below show which rules fired, what knowledge was consulted, and what Cadreen was unsure about.
summary
One-line verdict — what happened and why.
"Governance: blocked; Gaps: 1 blocking, 3 total; Memory: 12 sources consulted"capability
What tools and connections are available and healthy.
{ "total_available": 42, "healthy_count": 38, "active_integrations": ["acme", "salesforce"] }reasoning
Why the system chose this path — capability matches, evidence, gaps.
{ "capability_matches": 12 }memory
Whether the memory could be reached, and how many knowledge items you can read. The count is left out when there are none, and when it could not be counted (knowledge_unreadable).
{ "healthy": true, "knowledge_queried": 12 }governance
What your rules say — approved, conditional, blocked: not a decision about this request. The intent route writes its own object, with the decision engine's decision about the request (auto, handoff or clarify_requester).
{ "active": true, "decision": "conditional" }humility
What the system doesn't know — gaps detected and whether they block the action.
{ "gaps_detected": 3, "blocking": 1 }process
Timing.
{ "started_at": "2026-01-15T09:30:00Z", "duration_ms": 342 }next_action
What the caller should do next — with a labeled endpoint.
{ "type": "resolve_gap", "label": "Resolve 1 blocking gap(s)", "endpoint": "/api/v1/cadreen/connections/catalog", "reason": "1 blocking capability gap(s) prevent the system from proceeding; connect a tool or add capability to fill the gap" }Endpoints by capability
/api/v1/cadreen/intentAsk Cadreen anything. Returns a direct answer, clarification request, or execution handle.
curl -X POST "https://api.cadreen.com/api/v1/cadreen/intent" \
-H "Authorization: Bearer sk_cadreen_..." \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Customer 123 wants a refund for order 456"}],"context":{"domain":"ecommerce"}}'Parameters
| Name | Type | Required | Description |
|---|---|---|---|
messages | object[] | Yes | Conversation messages. First element must have role: user. |
messages[].role | enum [user | assistant | system] | No | Who is speaking. A message is read only when its role is user; one with another role, or none, is skipped |
messages[].content | string | No | The message text. A message with no text is skipped |
context.domain | string | No | Optional domain to scope rule checks |
mode | enum [auto | chat | execution] | No | Processing modeDefault: auto |
rehearsal | boolean | No | Run it as a rehearsal: admitted with a $1 budget, and every tool call that is not declared read-only waits for a person to approve it, whatever your rules say.Default: false |
stream | boolean | No | Stream partial results via SSE |
Idempotency-Key | header | No | Unique key for idempotent requests. Prevents duplicate execution if the same request is sent twice within 24 hours. |
Request body
POST /api/v1/cadreen/intent
{
"messages": [{"role": "user", "content": "Customer 123 wants a refund for order 456"}],
"context": {"domain": "ecommerce"}
}Response
full profile{
"id": "int_abc123",
"type": "direct",
"status": "answered",
"message": {"content": "Based on the refund policy..."},
"next_action": {"type": "none", "label": "No further action needed"},
"intelligence": {"next_actions": []},
"trace_id": "eb8a38bf-acc1-48c4-9fb5-8daf2e9d558d"
}Set Accept: application/json; profile="lean" for trace_id only. profile="audit" for gate decisions.
Response fields
| Field | Type | When | Description |
|---|---|---|---|
id | string | always | Unique intent ID |
type | string | always | Discriminator: direct, clarify, execution, blocked, connect_required |
status | string | always | Canonical outcome: answered, needs_input, ready_to_execute, executing, planning, blocked_by_policy, blocked_by_missing_connection, failed |
next_action | object | always | What the caller should do next |
message | object | always | Direct answer (when type is direct) |
clarification | object | always | Clarification questions (when type is clarify) |
execution | object | always | Execution handle (when type is execution) |
meta | object | blocked or connect_required | Why it was held back (when type is blocked or connect_required) |
meta.governance.decision | string | blocked or connect_required | What governance decided: handoff (a rule, a missing approval or too little confidence holds it for a person), escalate, or governance_evaluation_failed when the rules could not be read |
meta.governance.reason | string | blocked or connect_required | Why, in a sentence |
intelligence | object | always | The short decision block: the route's own decision and policy_id when it gives them, next_actions, and blocking_gaps when a gap analysis ran. The full reasoning trace comes with ?include=intelligence. |
trace_id | string | a successful answer that is not a stream | Request trace ID. Present in all profiles (lean included). Use for debugging and support. |
Possible errors
workspace_requiredA signed-in person who belongs to more than one workspace chose none. Send the one you mean in the X-Workspace-ID header. Nothing was stored and no model was calledworkspace_membership_requiredA signed-in person who is not in a workspace. Ask someone to add you. Nothing was stored and no model was callednot_readyThe intent engine is not initialized/api/v1/intentSame as /api/v1/cadreen/intent. Use this if your app already speaks the /v1/ protocol.
curl -X POST "https://api.cadreen.com/api/v1/intent" \
-H "Authorization: Bearer sk_cadreen_..." \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Review this invoice for policy compliance"}]}'Parameters
| Name | Type | Required | Description |
|---|---|---|---|
messages | object[] | Yes | Same as Cadreen-native intent |
context.domain | string | No | Optional domain scope |
mode | enum [auto | chat | execution] | No | Processing modeDefault: auto |
Request body
POST /api/v1/intent
{
"messages": [{"role": "user", "content": "Review this invoice for policy compliance"}]
}Response
full profile{
"id": "int_def456",
"type": "direct",
"status": "ready_to_execute",
"message": {"role": "assistant", "content": "1. Read the invoice.\n2. Check each line against your rules.\n3. List what needs a person."},
"next_action": {
"type": "start_mission",
"label": "Start this",
"reason": "Nothing runs until you start it. Starting it is charged.",
"method": "POST",
"endpoint": "/api/v1/intent",
"mode": "execution",
"cost": {"status": "not_estimated", "reason": "The cost is known once the plan is made, after you start it."}
},
"operation_id": null,
"trace_id": "5f734f8d-de5f-452e-b3f9-88a9840f58a0"
}Set Accept: application/json; profile="lean" for trace_id only. profile="audit" for gate decisions.
Response fields
| Field | Type | When | Description |
|---|---|---|---|
trace_id | string | a successful answer that is not a stream | Request trace ID |
Possible errors
not_readyThe intent engine is not initialized/api/v1/cadreen/chat/completionsDrop-in OpenAI-compatible endpoint with governed tool calling. The model proposes tool calls and governance checks each one. A call it lets through runs on Cadreen (a Cadreen tool) or comes back to you to run (a tool of your app). A call it holds for a person is in pending_actions and does not run; one it refuses is in refused_actions. A field this endpoint does not read, such as temperature, is accepted and ignored.
curl -X POST "https://api.cadreen.com/api/v1/cadreen/chat/completions" \
-H "Authorization: Bearer sk_cadreen_..." \
-H "Content-Type: application/json" \
-d '{"model":"cadreen","messages":[{"role":"user","content":"Refund order 456 for $750"}],"tools":[{"type":"function","function":{"name":"process_refund","parameters":{"type":"object","properties":{"order_id":{"type":"string"},"amount":{"type":"number"}}}}}]}'Parameters
| Name | Type | Required | Description |
|---|---|---|---|
model | string | No | Ignored. Any value accepted. |
messages | object[] | Yes | OpenAI-format messages. Content can be string or multimodal array (text, image_url, input_audio, file). |
tools | object[] | No | OpenAI function definitions. Model proposes calls; governance evaluates each. |
conversation_id | string | No | Track conversations across requests. Ensures pending confirmations match correctly. |
memory | boolean | No | Enable cross-conversation memory (default: true). When true, Cadreen injects relevant context from past conversations into the model prompt.Default: true |
stream | boolean | No | Stream partial results via SSE |
Request body
POST /api/v1/cadreen/chat/completions
{
"model": "cadreen",
"messages": [{"role": "user", "content": "Refund order 456 for $750"}],
"tools": [{"type": "function", "function": {"name": "process_refund", "parameters": {"type": "object", "properties": {"order_id": {"type": "string"}, "amount": {"type": "number"}}}}}]
}Response
full profile{
"id": "chatcmpl-9f2c41b7",
"object": "chat.completion",
"created": 1760000000,
"model": "cadreen",
"operation_id": null,
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "This action needs a person's approval before it can run:\n- process_refund (decision governance_task:5b1e0c2a-7f3d-4c58-9a41-2d6e8b0f7a13)\n\nA person in this workspace has to approve or decline it, signed in. Replying here does not approve it."
},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0},
"pending_actions": [{
"tool": "process_refund",
"tool_call_id": "call_8f2a",
"operation_id": "e3a6d0f4-91b7-4c0e-8d52-6a7b1f2c3d44",
"decision_id": "governance_task:5b1e0c2a-7f3d-4c58-9a41-2d6e8b0f7a13",
"kind": "governance_task",
"source_id": "5b1e0c2a-7f3d-4c58-9a41-2d6e8b0f7a13",
"resolve_path": "/api/v1/cadreen/decisions/governance_task:5b1e0c2a-7f3d-4c58-9a41-2d6e8b0f7a13/resolve",
"runs_in": "your_app",
"permit_path": "/api/v1/cadreen/relay/actions/e3a6d0f4-91b7-4c0e-8d52-6a7b1f2c3d44"
}],
"conversation_id": "0b6f1c9e-4d2a-4f7b-8c35-1e9a7d2b6c40"
}Set Accept: application/json; profile="lean" for trace_id only. profile="audit" for gate decisions.
Response fields
| Field | Type | When | Description |
|---|---|---|---|
id | string | always | The completion's id: chatcmpl- and a random suffix |
choices[].message.content | string | always | The reply: text, or the sentence that says which actions are held for a person. null when the model proposed tool calls and nothing was held |
choices[].message.tool_calls | object[] | finish_reason is tool_calls | The tool calls of your app that governance let through, for you to run: id, type and function (name, arguments) |
choices[].message.reasoning | string | the reply held a think block | The model's reasoning, taken out of content |
choices[].finish_reason | string | always | tool_calls when the message has tool calls for you to run; length when a streamed reply was still cut short after the server continued it 3 times (the text is not whole); stop otherwise |
operation_id | string | always | The operation this call started. null when it started no work. A call held for a person has its own operation, named in pending_actions |
pending_actions | object[] | a tool call was held | Tool calls governance held for a person. Each names the operation and the decision that wait for one. A person in the workspace approves or declines it on the decision route; replying in the chat does not |
refused_actions | object[] | a tool call was refused | Tool calls that did not run and that nobody can approve: tool, tool_call_id, a code and a sentence |
conversation_id | string | the call belongs to a conversation | The conversation the call belongs to. Send it back as conversation_id to continue it |
trace_id | string | a successful answer that is not a stream | Request trace ID |