# Troubleshooting

Go from an HTTP status, an error code or an unexpected run outcome to its cause and its fix, from authenticating to reading results.

Start from what you see: an HTTP status with an `error` code, or a run that answered `200` without doing the work.

## Read the response first

- **The HTTP status.** After a `5xx` on a run, the outcome can be unknown.

- **The `error` code** in the JSON body. Branch on it, not on `detail`, whose wording can change.

- **`decision`, on a `200` from a run.** `deny` is a governed refusal with a `reasonCode`. `replayed` without `decision` means no new run started.

This shell function, which needs `jq`, prints all three. Pass it the failing call's `curl` arguments without the `Authorization` header. The two calls shown start no run.

```bash
# Print the HTTP status, then the fields that explain an error or a refusal.
coa_check() {
  local http_code
  : > coa-response.json
  http_code=$(curl -sS -o coa-response.json -w '%{http_code}' \
    -H "Authorization: Bearer $COA_API_KEY" "$@") || http_code=000
  printf 'HTTP %s\n' "$http_code"
  jq '{error, detail, retryAfterSec, invoked, decision, reasonCode, replayed, root}
      | with_entries(select(.value != null))' coa-response.json 2>/dev/null \
    || cat coa-response.json
}

# The key: 200 and an empty object, or 401 unauthenticated.
coa_check https://centerofagentic.com/api/me

# The run scope, without running anything: 400 missing_prompt with the scope,
# 403 insufficient_scope without it.
coa_check https://centerofagentic.com/api/run \
  -H "Content-Type: application/json" -d '{}'
```

## Authenticating

Do not retry a `401` or `403` in a loop: stop and alert.

| What you see | Why | What to do |
| --- | --- | --- |
| `401 unauthenticated` | The `Authorization` header is missing or malformed, the key is wrong or revoked, or the admin who created it could not be confirmed as an active workspace member. | Test it with `GET /api/me`, once more after a few seconds: every request re-checks the key's creator, and that check can fail briefly. If the creator left, an admin creates a new key. See [Expiry and revocation](https://centerofagentic.com/docs/authentication#lifetime). |
| `403 insufficient_scope` | The key lacks the scope that `detail` names. | Use a key with that scope. [Scopes](https://centerofagentic.com/docs/authentication#scopes) are fixed when a key is created. |
| `403 capability_denied` | The operation is reserved for a signed-in person, or the key's creator now has the **Business Owner** access profile. | Use the web workspace, or have a workspace admin create a new key. |
| `403 full_session_required` | Creating, editing and reviewing agents needs a member's own browser session. | A script can read and run agents, not change them. |
| `403 admin_required`, `403 admin_session_required` | The operation needs a workspace admin's own session, such as changing the model key or managing a connection. No scope makes a key an admin. | See [What cannot be automated](https://centerofagentic.com/docs/guides/automation#session-only). |

## Launching a run

An activated agent starts with two calls made with the same key: a [launch ticket](https://centerofagentic.com/docs/api/agents#launch), then the run. These answers arrive before any model call.

| What you see | Why | What to do |
| --- | --- | --- |
| `426 agent_protocol_required` | `X-CoA-Agent-Protocol` is missing or is not exactly `agent-active-grants/1`, on the ticket request or on the run. | Send the header on both calls. |
| `428 agent_launch_required` | `X-CoA-Agent-Ticket` is missing. | Request a ticket and send its `ticketId`. |
| `200` with `replayed` and no `output` | The ticket was used before. The first request uses it up even when that request fails. | No new run started. Read `root.status`; see [After a replayed response](https://centerofagentic.com/docs/guides/automation#after-a-replay). |
| `409 agent_admission_unavailable` | The agent has no active version, or is paused or revoked. On the run: the ticket is over ten minutes old, or was requested with another key, operation or request body. | Check `activeGrant.state` in `GET /api/agents`. Unless it is `available`, a workspace admin activates the agent or makes it available again; see [Prepare a workspace](https://centerofagentic.com/docs/guides/prepare-an-agent). Otherwise request a new ticket with the same key, for the exact body you send. |
| `409 agent_adoption_required` | The agent is not under managed activation: `GET /api/agents` reports its `grantLifecycle` as `legacy_unadopted`. On the ticket request it can also mean that the top-level `agentId` and the agent the `request` runs are not the same. | Choose an activated agent, or have a workspace admin adopt this one; see [Adopt agents created before activation](https://centerofagentic.com/docs/guides/prepare-an-agent#legacy-agents). |
| `409 active_connection_changed`, on the run | A connection bound to the agent no longer matches the state recorded when its version was activated, for example after it was renamed or a test returned a different tool list. `activeGrant.state` still reads `available`. The ticket is used up. | A workspace admin restores the connection or activates a new version. Then request a new ticket. See [Bind a connection to an agent](https://centerofagentic.com/docs/mcp/connections#bind). |
| `429 agent_launch_limit` | This key requested 120 launch tickets within the past hour. The same code is returned, on the ticket request or on the run, when stored launch records reach a cap: 20,000 tickets or 10,000 runs for one agent, ten times as many for the workspace. The response has no `Retry-After`. | Back off for minutes. If the code arrives on the run, or an hour after your last ticket, waiting does not help: a workspace admin opens **Retention and grant-record cleanup** in the agent's **Active version and draft** card, ticks the confirmation and selects **Clean obsolete unreferenced records**. It removes only records past the agent's retention period: unused tickets, and finished runs that no stored record, such as a receipt, still refers to. See [Other limits](https://centerofagentic.com/docs/reference/rate-limits#other-limits). |
| `429 rate_limited` | The run limit was reached. | Wait for `Retry-After` seconds, then request a new ticket. See [The 429 response](https://centerofagentic.com/docs/reference/rate-limits#limited-response). |
| `400 no_model_key`, `400 no_model` | The workspace has no model provider key, or neither the request, the agent nor the workspace default names a model. | A workspace admin stores the key under **Settings → Models → Bring your own model**. For `no_model`, the admin sets the **Default model** there or the agent's **Model**, then prepares and activates the agent's draft again: an active version keeps the models it was captured with. See [Get an agent to an active version](https://centerofagentic.com/docs/guides/prepare-an-agent#activate-an-agent). |
| `500 server_error` whose `detail` mentions `uuid` | An id is not a UUID. On the ticket request, the same mistake inside `request` answers `503 agent_runtime_unavailable`. | Send ids exactly as the API returned them. |

```json
{
  "replayed": true,
  "root": { "id": "f2b8d6a1-0c47-4e9b-a3d5-7e1c9b4f6082", "status": "failed" }
}
```

### The usage-request header

`X-CoA-Model-Request` identifies a request for usage accounting: the Unix time in milliseconds (13 digits), a dot and a UUID. In a shell: `$(date +%s)000.$(uuidgen)`. Generate a new value for each run, stream or conversation turn you start, and keep it if you send that same request again; see [Retry safely](https://centerofagentic.com/docs/guides/automation#retry-safely).

| What you see | Why | What to do |
| --- | --- | --- |
| `503 model_usage_request_identity_required` from `POST /api/run` or a conversation turn | The header is missing, or malformed on a conversation turn. The model was not called. | Send the header and repeat the request with a new ticket. |
| `POST /api/run` answers `deny` although policy allows the run | The value is malformed, over 24 hours old or over a minute ahead. The run can then end denied, for example with `DECISION_RECORD_UNAVAILABLE`. | Use the current time and a new UUID. |
| `503 model_usage_reconciliation_required` or `model_usage_root_conflict` with `invoked` set to `false`; on a conversation turn a `done` event with `replayed`, or `409 model_usage_conversation_reconciliation_required` | The value was used before. The model is not called again. | Find the first attempt's receipt or message. Use a new value for a new run. |
| `POST /api/run/stream` answers `200`, sends `meta`, then stalls or closes without `done` or `error` | Usually the header is missing or its value was used before: this check runs after the stream opens. A server failure mid-stream looks the same. | Treat the outcome as unknown and look for a receipt first. If there is none, check that the request carries the header, then start again with a new ticket and a new header value. Set a client read timeout so that a stalled stream ends. |

## During a run

| What you see | Why | What to do |
| --- | --- | --- |
| `200` with `approvalRequired` | A tool call needed approval. Synchronous and streaming runs cannot wait, so the call was refused and the run carried on. | Use a [background job](https://centerofagentic.com/docs/api/runs#jobs), which holds the call. |
| A job at `pending_approval` with `heldActions` | The call is held until a workspace admin decides in the Review Queue. A key cannot approve. | Keep sending `{ jobId }`. An unresolved hold expires, after 24 hours by default, and the job ends with `APPROVAL_EXPIRED`. |
| A `toolLog` entry with `outcome` set to `denied` | That tool call was refused and never sent. `reasonCode` says why, for example `TOOL_POLICY_DENIED` or `APPROVAL_DENIED`. `LIMITED_OUTPUT` on a write tool, while read tools on the same connection run, means the active version has no write access to that connection. | See [How tool calls are governed](https://centerofagentic.com/docs/mcp/connections#governance). Write access is granted when a version is prepared; see [Prepare a workspace](https://centerofagentic.com/docs/guides/prepare-an-agent#activate-an-agent). |
| `402 spend_reservation_refused` | The estimated cost does not fit under a configured budget. `invoked` is `false`. | A workspace admin raises the budget under **Settings → Budgets**. |
| `409` or `503 spend_reservation_refused`; outside agent runs, `503 spend_state_unavailable` | The budget state changed or cannot be verified. `invoked` is `false`. | Send the request again later, deliberately. |
| `503 model_usage_accounting_unavailable`, `503 model_usage_reconciliation_required`, `500 model_call_failed` | Usage accounting is unavailable, or the call to the model provider failed, possibly after it was made. | Read `invoked`. Unless it is `false`, find the receipt first. |

Never retry paid work blindly

A timeout or a `5xx` on a run does not tell you whether the model provider was called, and a second attempt can be charged again. `invoked` set to `false` states only that the refused model call was not sent. An agent with connections makes several model and tool calls in one request, so earlier ones may already have run, and that request wrote no receipt: check the connected system before you run again. In every other case check `GET /api/receipts` first. See [Retry safely](https://centerofagentic.com/docs/guides/automation#retry-safely) and [Budget and accounting refusals](https://centerofagentic.com/docs/api/errors#budget-refusals).

## Reading results

A run refused by policy, the agent's lifecycle or a budget still answers `200`: `decision` is `deny`, `output` is empty, `reasonCode` gives the reason and `receipt` records the refusal. On a stream the refusal arrives in `meta` or, when decided later, in `done`.

| Reason code | Why | What to do |
| --- | --- | --- |
| `ALLOWLIST_NO_GRANT`, `PKG_CEILING_NO_GRANT`, `DENY_RULE_MATCHED` | A layer that had to grant the action did not, or a deny rule matched. In `receipt.decision`, `allowlist_layers_missing_grant` and `deny_rules_matched` name them. | Do not loop: the answer stays the same until configuration changes. |
| `PLACEMENT_DENIED`, `LIMITED_OUTPUT` | The run may not use the cloud model, because of the agent's data classes, its runtime mode or a `model` outside the active version. | Check the `model` you send; the other causes are configuration. |
| `PKG_REVOKED` | The agent is revoked. | Stop and ask a workspace admin. |
| `SPEND_OVER_BUDGET` | A spend cap would be exceeded, or spend could not be verified. `detail` says which. | See [Budgets and spend refusals](https://centerofagentic.com/docs/guides/run-an-agent#budgets). |
| `FAIL_CLOSED` or a code you do not know | A required check or record was unavailable. | Treat it as a refusal. |

## MCP

The MCP endpoint lists no tools

The MCP server is closed today for every workspace, because Center of Agentic has not turned on the platform-wide switch that it controls. `tools/list` returns an empty list and every `tools/call` is refused with `host_grant_required`. Nothing is wrong with your key or your MCP client. See [Availability today](https://centerofagentic.com/docs/mcp#availability).

## Next steps

- [**Errors** The codes any operation can return.](https://centerofagentic.com/docs/api/errors)

- [**Automation and CI** Safe retries, and what to do after a replay.](https://centerofagentic.com/docs/guides/automation)

- [**Runs and conversations** Every run operation with its errors.](https://centerofagentic.com/docs/api/runs)

- [**Prepare a workspace** The admin steps behind most launch errors.](https://centerofagentic.com/docs/guides/prepare-an-agent)

Source: https://centerofagentic.com/docs/guides/troubleshooting

## Related pages

- [Expiry and revocation](https://centerofagentic.com/docs/authentication#lifetime)
- [Scopes](https://centerofagentic.com/docs/authentication#scopes)
- [What cannot be automated](https://centerofagentic.com/docs/guides/automation#session-only)
- [launch ticket](https://centerofagentic.com/docs/api/agents#launch)
- [After a replayed response](https://centerofagentic.com/docs/guides/automation#after-a-replay)
- [Prepare a workspace](https://centerofagentic.com/docs/guides/prepare-an-agent)
- [Adopt agents created before activation](https://centerofagentic.com/docs/guides/prepare-an-agent#legacy-agents)
- [Bind a connection to an agent](https://centerofagentic.com/docs/mcp/connections#bind)
- [Other limits](https://centerofagentic.com/docs/reference/rate-limits#other-limits)
- [The 429 response](https://centerofagentic.com/docs/reference/rate-limits#limited-response)
- [Get an agent to an active version](https://centerofagentic.com/docs/guides/prepare-an-agent#activate-an-agent)
- [Retry safely](https://centerofagentic.com/docs/guides/automation#retry-safely)
- [background job](https://centerofagentic.com/docs/api/runs#jobs)
- [How tool calls are governed](https://centerofagentic.com/docs/mcp/connections#governance)
- [Prepare a workspace](https://centerofagentic.com/docs/guides/prepare-an-agent#activate-an-agent)
- [Budget and accounting refusals](https://centerofagentic.com/docs/api/errors#budget-refusals)
- [Budgets and spend refusals](https://centerofagentic.com/docs/guides/run-an-agent#budgets)
- [Availability today](https://centerofagentic.com/docs/mcp#availability)
- [Errors The codes any operation can return.](https://centerofagentic.com/docs/api/errors)
- [Automation and CI Safe retries, and what to do after a replay.](https://centerofagentic.com/docs/guides/automation)
- [Runs and conversations Every run operation with its errors.](https://centerofagentic.com/docs/api/runs)
- [Prepare a workspace The admin steps behind most launch errors.](https://centerofagentic.com/docs/guides/prepare-an-agent)
