> ## Documentation Index
> Fetch the complete documentation index at: https://docs.checkfu.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Checkfu is open source (https://github.com/checkfu/checkfu) and runs in the reader's own Cloudflare account. There is no shared hosted base URL: `checkfu deploy` prints the deployment's API URL (`https://<api-worker>.workers.dev` or the CHECKFU_API_DOMAIN hostname, exported as `CHECKFU_BASE_URL` for the CLI, SDK, and curl) and MCP URL (`.../mcp`). Local development serves the API on http://localhost:1337 and MCP on http://localhost:1338/mcp.
> Authenticated HTTP requests send the deployment's CHECKFU_API_KEY as `Authorization: Bearer $CHECKFU_API_KEY` (or `x-api-key`) and `Content-Type: application/json` for JSON bodies. Pass `Idempotency-Key` on retriable writes.
> Core workflow: create an Agent (`POST /v1/agents`) and an Environment (`POST /v1/environments`), create a Session that references both (`POST /v1/sessions`), send a `user.message` event (`POST /v1/sessions/{session_id}/events`), and follow `GET /v1/sessions/{session_id}/events/stream` until `session.status_idle`.
> Other resources: Memory stores (`/v1/memory_stores`), Files (`/v1/files`), Artifacts (`/v1/artifacts`), Vaults and credentials (`/v1/vaults`), Provider credentials (`/v1/provider_credentials`), Automations (`/v1/automations`), Inbound bindings (`/v1/inbound_bindings`), and Webhooks (`/v1/webhooks`). The deployment serves its OpenAPI 3.1 specification at `GET /openapi.json`.

# HTTP API

> Rules shared by every Checkfu HTTP endpoint.

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --fail-with-body -X POST "$CHECKFU_BASE_URL/v1/agents" \
  -H "Authorization: Bearer $CHECKFU_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-support-agent" \
  -d '{"name": "Support", "model": "claude-sonnet-5-5"}'
```

The SDK, CLI, MCP server, and Dashboard all call this API. Each endpoint has a generated page under **HTTP API** in the sidebar, starting with [Create an agent](https://docs.checkfu.com/api-reference/agents/create-an-agent.md).

## Base URL

| Where | API URL |
| :- | :- |
| `checkfu deploy` | The URL printed after `Checkfu is live at`, or `CHECKFU_API_DOMAIN` |
| `bun run dev` | `http://localhost:1337` |

| No key needed | Returns |
| :- | :- |
| `GET /health` | `{ "status": "ok" }` |
| `GET /openapi.json` | The OpenAPI 3.1 document |
| `GET /schemas/apply/{agent,environment,automation,memory_store,vault}.json` | [Editor schemas](https://docs.checkfu.com/guides/agents-as-code.md#validate-and-edit) |

## Authentication

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --fail-with-body "$CHECKFU_BASE_URL/v1/auth/verify" -H "Authorization: Bearer $CHECKFU_API_KEY"
# {"type":"authentication_verified"}
```

Send `CHECKFU_API_KEY` as `Authorization: Bearer` or `x-api-key`. There is one key per deployment, with full access. A missing or wrong key returns `401`; a deployment with no key configured returns `503`.

`POST /v1/incoming/{binding_id}` authenticates the original delivery bytes with a provider signature. See the [incoming integrations guide](https://docs.checkfu.com/guides/incoming-integrations.md) for each sender's setup.

## Conventions

* JSON endpoints require `Content-Type: application/json`, or the API returns `415`. `POST /v1/files` and `POST /v1/incoming/{binding_id}` accept raw bytes. Signed deliveries are verified against the bytes exactly as sent, regardless of their content type.
* Fields are `snake_case`. Timestamps are ISO 8601 UTC. IDs are opaque.
* Most updates use `POST` to the resource URL (`PUT` is used for Artifact data documents, provider credentials, and inbound signing secrets). Optimistic concurrency uses `version` (Agents, Environments), `revision` (Automations), or `precondition.content_sha256` (Memories); a stale value returns `409`.
* Body size limits are in [Limits](https://docs.checkfu.com/reference/limits.md#request-bodies).

## Pagination

```sh theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --fail-with-body "$CHECKFU_BASE_URL/v1/sessions?limit=20&order=desc" -H "Authorization: Bearer $CHECKFU_API_KEY"
# {"data": [...], "next_page": "..."}
```

Pass `next_page` back as `page` until it is `null`. A page can hold fewer items than `limit`.

| Parameter | Values | Default |
| :- | :- | :- |
| `limit` | 1 to 100 | 50 |
| `page` | Previous `next_page` | First page |
| `order` | `asc` or `desc`, by creation | `asc` |
| `include_archived` | `true` or `false` | `false` |

Agent versions and Webhook deliveries return newest first. Memories sort by path. Artifact data returns oldest first.

`GET /v1/sessions/{session_id}/resources` accepts `page` and a `limit` from 1 to 1000. Omit `limit` to return all remaining resources. When `next_page` has a value, pass it unchanged as `page`.

## Idempotency

Send `Idempotency-Key` (1 to 128 characters, no leading or trailing whitespace) on create requests and event sends to make retries safe. Repeating the same key and body returns the original result; reusing a key with a different body returns `409` `idempotency_key_reused`.

| Method | Endpoint | Key |
| :- | :- | :- |
| `POST` | `/v1/agents` | Optional |
| `POST` | `/v1/environments` | Optional |
| `POST` | `/v1/sessions` | Optional |
| `POST` | `/v1/sessions/{session_id}/events` | Optional |
| `POST` | `/v1/automations` | Required |
| `POST` | `/v1/automations/{automation_id}/run` | Optional |
| `POST` | `/v1/artifacts` | Optional |
| `POST` | `/v1/artifacts/{artifact_id}/publication` | Optional |
| `DELETE` | `/v1/artifacts/{artifact_id}/publication` | Optional |
| `POST` | `/v1/artifacts/{artifact_id}/data/{collection}` | Optional |
| `POST` | `/v1/files` | Optional |
| `POST` | `/v1/vaults` | Optional |
| `POST` | `/v1/vaults/{vault_id}/credentials` | Optional |
| `POST` | `/v1/webhooks` | Optional |
| `POST` | `/v1/webhooks/{webhook_id}/rotate-secret` | Optional |
| `POST` | `/v1/memory_stores` | Optional |

Use the same key to recover a manual Automation Run after an uncertain response. Each unkeyed call can start a new run. Session events can also carry their own `id`.

Receipts are retained indefinitely, with a few lifecycle exceptions: retrying after deleting an Artifact or Vault returns `404` (and `409` for a deleted File), retrying a Webhook create or secret rotation after a subsequent rotation returns `409`, and Artifact data collection idempotency keys are cleared if the document is deleted (or return its current contents if updated via `PUT`).

## Pending receipts

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{ "id": "agent_...", "type": "agent", "pending": true }
```

A `202` with this body means the write succeeded, but the read view hasn't caught up yet. Poll by `id` for the state the operation requested. For a create, look for the resource to appear. For an archive, wait for `archived_at` to be set. Agent update receipts carry a target `version`, and Automation update receipts carry a target `revision`. For a receipt copied from HTTP or restored from JSON, pass an operation-specific `until` predicate that checks the target or desired state. Receipts for nested resources include the parent field you need for polling: `version` (`artifact_version`), `vault_id` (`vault_credential`), and `memory_store_id` (`memory`). A pending `webhook` receipt includes `signing_secret`. An authenticated retry with the original create key and body can recover that secret while the Webhook exists and the secret has not been rotated. Ordinary Webhook reads omit the secret.

Deleting a Vault or Credential can also return `202` (`"secrets": "erasing"` or `"custody": "erasing"`) while secret erasure finishes in the background.

## Archive and delete

An archived resource stays readable with `archived_at` set, is hidden from lists unless `include_archived=true`, and rejects edits with `409`. A deleted resource returns `404`.

| Resource | Archive | Delete |
| :- | :- | :- |
| Agent | Yes | No |
| Environment | Yes | Yes |
| Session | Yes, ends it | No |
| Automation | Yes, stops it | No |
| Memory store | Yes, read-only | Yes |
| Vault, Credential | Yes | Yes |
| Memory, File, Artifact, Webhook, Provider credential, Inbound binding | No | Yes |

To archive only if nothing changed, pass `version` (Agent, Environment) or `revision` (Automation) as a query parameter (for example, `POST /v1/agents/{agent_id}/archive?version=2`).

## Request IDs

Every response carries a `request-id` header, and error bodies repeat it as `request_id`. Include it when reporting a bug.

Streaming is covered in [Session events](https://docs.checkfu.com/reference/events.md), and status/error codes in [Errors](https://docs.checkfu.com/reference/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.