# REST API overview

Base URL, credentials, path layout, versioning, pagination, streaming and retry rules for the Center of Agentic REST API.

The REST API is the HTTP API that the web workspace itself uses. With a workspace API key you can list and inspect agents, run them, read receipts and audit entries, and read workspace metrics from your own systems. This page describes the rules that hold across operations. The reference pages document each operation.

## Basics

| Item | Value |
| --- | --- |
| Base URL | `https://centerofagentic.com/api` |
| Transport | HTTPS |
| Format | JSON request and response bodies in UTF-8. Streaming operations respond with server-sent events. |
| Credential | `Authorization: Bearer <key>`. See [Authentication](https://centerofagentic.com/docs/authentication). |
| Workspace | Taken from the credential. No parameter selects a workspace. |
| Field names | camelCase. The policy decision object embedded in a receipt keeps its own snake_case names. |
| Browser calls | The API sends no cross-origin (CORS) headers, so browsers block calls from pages on other sites. Call it from a server or a shell. |

## A first request

List the agents in the key's workspace and keep three fields of each. Any key can do this, because a `GET` needs only the `read` scope.

```bash
curl -s https://centerofagentic.com/api/agents \
  -H "Authorization: Bearer $COA_API_KEY" \
  | jq '.agents[] | {id, name, status}'
```

```json
{
  "id": "3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11",
  "name": "Renewal brief writer",
  "status": "published"
}
```

## How paths are organized

Paths follow the resource: a collection at `/api/agents`, one item at `/api/agents/{id}` and related resources and actions as sub-paths such as `/api/agents/{id}/versions`. Each area has a reference page.

| Area | Main paths | Reference |
| --- | --- | --- |
| Agents | `/api/agents`, `/api/agent-runtime/ticket`, `/api/models` | [Agents](https://centerofagentic.com/docs/api/agents) |
| Runs and conversations | `/api/run`, `/api/conversations` | [Runs](https://centerofagentic.com/docs/api/runs) |
| Receipts, approvals and audit | `/api/receipts`, `/api/approvals`, `/api/audit` | [Receipts](https://centerofagentic.com/docs/api/receipts) |
| Workspace settings and keys | `/api/me`, `/api/health`, `/api/tenant/…` | [Workspace](https://centerofagentic.com/docs/api/workspace) |
| Integrations | `/api/integrations/…` | [Integrations](https://centerofagentic.com/docs/api/integrations) |
| Knowledge and skills | `/api/knowledge`, `/api/skills` | [Knowledge and skills](https://centerofagentic.com/docs/api/knowledge-skills) |
| Datasets, experiments and annotations | `/api/datasets`, `/api/experiments`, `/api/annotations` | [Evaluations](https://centerofagentic.com/docs/api/evaluations) |
| Monitoring, alerts and webhooks | `/api/dashboard`, `/api/metrics/…`, `/api/fleet/…`, `/api/governance-webhooks` | [Monitoring](https://centerofagentic.com/docs/api/monitoring) |
| Templates, domain packs and authoring | `/api/templates`, `/api/domain-packs`, `/api/contributions`, `/api/builder/…`, `/api/assistant/…` | [Authoring](https://centerofagentic.com/docs/api/authoring) |
| Missions and tasks | `/api/missions`. The task routes under `/api/tasks` are not part of the programmatic API. | [Missions and tasks](https://centerofagentic.com/docs/api/missions-tasks) |
| External agents | `/api/v1/external-agents`, and the pilot operation routes under `/api/v1/operations` | [External agents](https://centerofagentic.com/docs/api/external-agents) |
| Desktop app and device tokens | `/api/desktop/me`. The device-token routes under `/api/desktop/tokens` accept signed-in people only. | [Desktop](https://centerofagentic.com/docs/api/desktop) |

## Versioning

Most paths are unversioned

Only the external agent routes carry a version segment: `/api/v1/external-agents` and `/api/v1/operations`. Every other path has no version, and there is no version header.

The unversioned paths change together with the web workspace, and no deprecation policy is published for them. Write clients that ignore response fields they do not know, handle an unfamiliar `error` code by its HTTP status, and cover the calls you depend on with your own integration tests. The reference marks operations that are gated or in pilot.

How this reference is checked

Every operation on these pages is described from the service's code and checked against it when the docs are built. The operations are not yet exercised against the live service one by one. If a call behaves differently from its page, [tell us](https://centerofagentic.com/contact).

The operations an API key can call are also published as one machine-readable file; see [OpenAPI description](https://centerofagentic.com/docs/api/openapi).

## Requests

- Send `Content-Type: application/json` and a JSON object as the body of `POST`, `PATCH` and `PUT` requests.

- Filters and paging options go in the query string.

- Validation failures return `400` with a code that names the problem, such as `missing_prompt` or `invalid_limit`.

- A synchronous run answers when the run is finished, which can take up to 60 seconds. Set client timeouts above that.

### Extra headers for runs

Send `X-CoA-Model-Request` on every request that can call a model, such as starting a run, a stream or a conversation turn. Its value is the Unix time in milliseconds, a dot and a new UUID, for example `1795166043120.5f0c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11`. It identifies the request for usage accounting. A background job ignores the header, because its usage is accounted to the job, so sending it there does no harm. Without it the request can be refused with `503 model_usage_request_identity_required` before any model call.

An agent whose `grantLifecycle` is `managed`, the default for new agents, runs only after a workspace admin has activated a version of it, and every run needs a [launch ticket](https://centerofagentic.com/docs/api/agents#launch). Request the ticket for the exact body you are about to send, then send that body with the `X-CoA-Agent-Protocol` and `X-CoA-Agent-Ticket` headers. Without them the run is refused with `426 agent_protocol_required`. [Run an agent](https://centerofagentic.com/docs/guides/run-an-agent) walks through both calls.

## Ids, timestamps and amounts

- Resource ids are UUID strings such as `3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11`. Treat them as opaque.

- `userId` fields hold a person's id at the sign-in provider, or `api-key:` followed by a key id for work done with an API key.

- Most timestamps, including `createdAt` on agents, receipts and audit entries, are ISO 8601 in UTC with millisecond precision, for example `2026-11-20T09:14:03.120Z`. A few date fields are not: `updatedAt` on an agent, for example, can arrive as a JavaScript-style date string such as `Fri Nov 20 2026 09:14:03 GMT+0000 (Coordinated Universal Time)`. Parse dates with a date library, and do not sort or compare them as strings.

- Costs are numbers in US dollars, as in `costUsd`. `null` means the value was not recorded. It does not mean zero.

## Lists and pagination

There is no single paging scheme. Each list operation documents its own, and these are the patterns in use:

| Pattern | Example | How to page |
| --- | --- | --- |
| Whole collection | `GET /api/agents` returns `{ agents }` | Not paged. Every agent is returned, most recently updated first. |
| Recent window | `GET /api/audit` returns `{ entries, chain }` | The 100 newest entries. There are no paging parameters. |
| Keyset with totals | `GET /api/receipts` returns `{ receipts, total, hasMore }` | `limit` (default 100, at most 200), then `createdBefore` and `beforeId` taken from the last item of the previous page. |
| Opaque cursor | The [MCP list tools](https://centerofagentic.com/docs/mcp/tools) return `{ items, nextCursor, truncated }` | Pass `nextCursor` back as `cursor`. At most 50 items per page. A cursor is bound to the key and the filters and is refused if either changes. |

```bash
# Page 1: the 50 newest receipts with a deny decision
curl -s "https://centerofagentic.com/api/receipts?decision=deny&limit=50" \
  -H "Authorization: Bearer $COA_API_KEY"

# Page 2: add createdAt and id of the last receipt on page 1
curl -s "https://centerofagentic.com/api/receipts?decision=deny&limit=50&createdBefore=2026-11-20T09:14:03.120Z&beforeId=7b2e4c1a-5d3f-4a68-8c90-1e2f3a4b5c6d" \
  -H "Authorization: Bearer $COA_API_KEY"
```

Keep the filters identical between pages and always send `beforeId` together with `createdBefore`. `total` counts every receipt that matches the filters, not only the page. Stop when `hasMore` is `false`. `createdAt` is rounded to the millisecond while receipts are ordered more finely, so a receipt written in the same millisecond as the last item of a page can be missing from the next page. When you need every receipt, compare the number you collected with `total`.

## Streaming

`POST /api/run/stream` and `POST /api/conversations/{id}/run/stream` answer with server-sent events (`Content-Type: text/event-stream`) so that you can show model output as it arrives. Each event has a name and a JSON `data` line.

| Event | Data | Meaning |
| --- | --- | --- |
| `meta` | `{ decision, reasonCode, model }` | The policy decision for the run, sent first. |
| `delta` | `{ text }` | A fragment of model output. Concatenate the fragments in order. |
| `done` | `{ output, receipt }` for a run, `{ message, steps, receiptId }` for a conversation turn (`receiptId` is absent on some refusals). A refusal decided after `meta`, such as a budget refusal, can add `decision`, `reasonCode` and `detail`. | The run ended and its record is stored. The last event of a stream that did not fail. |
| `error` | `{ detail }`, sometimes with further fields | The run failed after the stream opened. The stream then closes. |

The example streams a run of an activated agent with a key that has the `run` scope. `COA_LAUNCH_TICKET` holds a [launch ticket](https://centerofagentic.com/docs/api/agents#launch) that was requested for exactly this body with the purpose `run_stream`. A ticket is valid for ten minutes and starts one run.

```bash
curl -N https://centerofagentic.com/api/run/stream \
  -H "Authorization: Bearer $COA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-CoA-Model-Request: $(date +%s)000.$(uuidgen)" \
  -H "X-CoA-Agent-Protocol: agent-active-grants/1" \
  -H "X-CoA-Agent-Ticket: $COA_LAUNCH_TICKET" \
  -d '{"agentId":"3f1c2a9e-0b7d-4e55-9a51-6f2f1c0e8d11","prompt":"Summarize our returns policy in three bullet points."}'
```

```text
event: meta
data: {"decision":"allow","reasonCode":"ALLOWED","model":"openai/gpt-4o-mini"}

event: delta
data: {"text":"- Returns are accepted within 30 days"}

event: delta
data: {"text":" of delivery."}
```

Problems found before the stream opens, such as a validation failure, a missing scope or a rate limit, are ordinary JSON error responses with an HTTP status. Once the stream is open the status is already `200`: a failure arrives as an `error` event, and a policy denial arrives as `meta` with `decision` set to `deny`, followed by `done`. A refusal decided later, for example by a budget, arrives on `done` with `decision` set to `deny` although `meta` said `allow`, so read both. [Runs](https://centerofagentic.com/docs/api/runs) has the details.

## Idempotency and retries

- `GET` requests are safe to repeat.

- There is no general idempotency key. Repeating a `POST` repeats the work: a second `POST /api/run` runs again, can incur model cost again and writes a second receipt.

- Launch tickets change this for activated agents. A ticket starts exactly one run, so repeating a request with a ticket that was already used does not run the agent again: it answers `200` with `{ replayed: true, root: { id, status } }` and no output. A repeat sent with a new ticket is a new run.

- The platform does not retry a model call on your behalf, and a client should not do it blindly either. After a timeout or a `5xx` on a run, look for the receipt with `GET /api/receipts` before sending the run again.

- Most budget and accounting refusals carry `invoked`. `false` means the refused call was not sent to the model provider. `true` means the provider may have been called. See [Errors](https://centerofagentic.com/docs/api/errors).

- A `429 rate_limited` request was refused before any model call. Wait for the time in `Retry-After`, then send it again. On the run and stream operations the refused request has already used its launch ticket, so request a new ticket for the retry.

- A `409` reports a conflict with current state. Read the resource again and decide again; do not replay the same request.

- The external agent operation routes are the exception: they require an `Idempotency-Key` header of 12 to 128 letters, digits and `_`, `.`, `:` or `-`. The same key with the same body returns the original operation, and the same key with a different body returns `409 idempotency_conflict`. These routes are a pilot and answer `503 external_pilot_disabled` unless Center of Agentic has enabled the pilot; see [External agents](https://centerofagentic.com/docs/api/external-agents).

## Next steps

- [**Errors** The error body and the codes every operation can return.](https://centerofagentic.com/docs/api/errors)

- [**Rate limits** Limits per key and per workspace, and how to back off.](https://centerofagentic.com/docs/reference/rate-limits)

- [**Run an agent** A guided walk from request to receipt.](https://centerofagentic.com/docs/guides/run-an-agent)

Source: https://centerofagentic.com/docs/api

## Related pages

- [Authentication](https://centerofagentic.com/docs/authentication)
- [Agents](https://centerofagentic.com/docs/api/agents)
- [Runs](https://centerofagentic.com/docs/api/runs)
- [Receipts](https://centerofagentic.com/docs/api/receipts)
- [Workspace](https://centerofagentic.com/docs/api/workspace)
- [Integrations](https://centerofagentic.com/docs/api/integrations)
- [Knowledge and skills](https://centerofagentic.com/docs/api/knowledge-skills)
- [Evaluations](https://centerofagentic.com/docs/api/evaluations)
- [Monitoring](https://centerofagentic.com/docs/api/monitoring)
- [Authoring](https://centerofagentic.com/docs/api/authoring)
- [Missions and tasks](https://centerofagentic.com/docs/api/missions-tasks)
- [External agents](https://centerofagentic.com/docs/api/external-agents)
- [Desktop](https://centerofagentic.com/docs/api/desktop)
- [tell us](https://centerofagentic.com/contact)
- [OpenAPI description](https://centerofagentic.com/docs/api/openapi)
- [launch ticket](https://centerofagentic.com/docs/api/agents#launch)
- [Run an agent](https://centerofagentic.com/docs/guides/run-an-agent)
- [MCP list tools](https://centerofagentic.com/docs/mcp/tools)
- [Errors](https://centerofagentic.com/docs/api/errors)
- [Errors The error body and the codes every operation can return.](https://centerofagentic.com/docs/api/errors)
- [Rate limits Limits per key and per workspace, and how to back off.](https://centerofagentic.com/docs/reference/rate-limits)
- [Run an agent A guided walk from request to receipt.](https://centerofagentic.com/docs/guides/run-an-agent)
