# REST API

Every HTTP endpoint of the AgenticMind control plane, grouped by area, with request examples for runs and streaming.

Source: https://glamorous-boar.cloudvent.net/api/

---

The API is served at `http://127.0.0.1:8000`. Interactive OpenAPI docs are at `/docs` (FastAPI). With sign-in off (default) no authentication is needed from localhost; with `AGENTICMIND_AUTH=required` a session cookie is needed (see [Security](/security/)). Unsafe methods from a browser must come from an allowed origin.

## Quick examples

<CodeBlock language="bash" filename="Start a run and read it" showCopy={true}>

```
# start (202)
curl -s -X POST http://127.0.0.1:8000/api/projects/prj_abc123/runs \
  -H "Content-Type: application/json" \
  -d '{"inputs": {"question": "What is the hotel limit?"}, "targets": ["answer"]}'

# status, outputs, error
curl -s http://127.0.0.1:8000/api/runs/run_xyz

# live events (SSE)
curl -N -H "Accept: text/event-stream" http://127.0.0.1:8000/api/runs/run_xyz/events
```

</CodeBlock>

<CodeBlock language="bash" filename="One streaming call" showCopy={true}>

```
curl -N -X POST "http://127.0.0.1:8000/api/projects/prj_abc123/runs/stream?trace=false" \
  -H "Content-Type: application/json" -d '{"inputs": {"question": "Hi"}}'
# event: run → event: token (many) → event: result → event: end
```

</CodeBlock>

## Health, registry and templates

| Method | Path | Purpose |
|---|---|---|
| GET | `/api/health` | Liveness. |
| GET | `/api/nodes` | Node manifests (latest permitted versions, with config schemas). |
| GET | `/api/types` | Port types and compatibility. |
| GET | `/api/ir/schema` | The IR JSON Schema. |
| GET | `/api/templates`, `/api/templates/{name}` | Starter templates. |

## Projects and revisions

| Method | Path | Purpose |
|---|---|---|
| GET | `/api/projects` | List projects. |
| POST | `/api/projects` | Create (from a template, blank, or an imported `document`). |
| GET | `/api/projects/{id}` | Project with its latest revision. |
| PUT | `/api/projects/{id}` | Save a new revision (`document`, `expected_revision`). |
| DELETE | `/api/projects/{id}?confirm=DELETE` | Delete (admin when sign-in is on). |
| GET | `/api/projects/{id}/revisions`, `/revisions/{n}` | Revision history. |
| GET | `/api/projects/{id}/export` | Canonical IR. |
| POST | `/api/projects/{id}/validate` | Validate the saved revision or a posted unsaved `document`. |

## Files

| Method | Path | Purpose |
|---|---|---|
| GET / POST | `/api/projects/{id}/files` | List / upload (multipart). |
| GET / DELETE | `/api/projects/{id}/files/{artifact_id}` | Info / delete. |
| GET | `/api/projects/{id}/files/{artifact_id}/content` | Download (attachment). |

## Runs

| Method | Path | Purpose |
|---|---|---|
| POST | `/api/projects/{id}/runs` | Start (202): `inputs`, optional `revision`, `targets`. 422 with diagnostics if not executable. |
| POST | `/api/projects/{id}/runs/stream` | Start and stream `run`, `token`, `trace`, `result`, `end` (`?trace=false`). |
| GET | `/api/projects/{id}/runs` | List runs. |
| GET | `/api/runs/{run_id}` | Status, outputs, error, node status, IR hash. |
| GET | `/api/runs/{run_id}/events` | JSON (`?after=<seq>`) or SSE (`Accept: text/event-stream`; `?tokens=false`). |
| GET | `/api/runs/{run_id}/nodes/{node_id}/outputs` | One node's outputs. |
| POST | `/api/runs/{run_id}/cancel` | Cooperative cancel (works across processes and on waiting runs). |
| POST | `/api/runs/{run_id}/resume` | `{responses}` for waiting runs, `{force}` for interrupted runs. |
| GET | `/api/runs/{run_id}/waits` | Pause points. |
| GET | `/api/projects/{id}/approvals` | Approval inbox (`?status=` pending, answered or cancelled). |
| GET | `/api/runs/{run_id}/otlp` | The run as OTLP/JSON. |
| POST | `/api/runs/{run_id}/export` | Re-export to the configured OTLP endpoint. |

## Memory

| Method | Path | Purpose |
|---|---|---|
| GET / DELETE | `/api/projects/{id}/memories` | List (`?namespace=`, `?q=`) / delete all. |
| DELETE | `/api/projects/{id}/memories/{memory_id}` | Delete one. |
| GET | `/api/projects/{id}/conversations[/{conversation_id}]` | Stored conversations / turns. |
| DELETE | `/api/projects/{id}/conversations/{conversation_id}` | Delete a conversation. |

## Wingman

| Method | Path | Purpose |
|---|---|---|
| GET | `/api/assistant` | Configured provider/model and whether the key is set. |
| POST | `/api/projects/{id}/assistant` | Ask Wingman (message, canvas, history) → reply, proposed graph, diff, problems. |

## Evaluation

| Method | Path | Purpose |
|---|---|---|
| GET / POST | `/api/projects/{id}/datasets` | List / create datasets. |
| GET / PUT / DELETE | `/api/datasets/{id}[?version=]` | Read / save new version / delete. |
| GET | `/api/datasets/{id}/versions` | Versions. |
| GET | `/api/evaluators` | Evaluators with versions and aggregation methods. |
| POST | `/api/projects/{id}/evaluations` | Start (`dataset_id`, `dataset_version`, `revision`, `label`, `config`). |
| GET | `/api/projects/{id}/evaluations` | List. |
| GET / DELETE | `/api/evaluations/{id}` | Summary / delete. |
| GET | `/api/evaluations/{id}/cases` | Per-case results. |
| POST | `/api/evaluations/{id}/cancel` | Cancel. |
| PUT | `/api/evaluations/{id}/baseline` | Mark as baseline. |
| GET | `/api/evaluations/compare?a=…&b=…` | Compare two evaluations. |

## Export and deployment

| Method | Path | Purpose |
|---|---|---|
| GET | `/api/projects/{id}/app/preview` | Endpoints, requirements, warnings, checks. |
| GET | `/api/projects/{id}/app` | The standalone app as a ZIP. |
| GET | `/api/deployment/targets` | Targets and profiles. |
| POST | `/api/projects/{id}/deployments/plan` | Plan with checks and hash. |
| POST | `/api/projects/{id}/deployments` | Deploy (`plan_hash`, `confirm: true`, optional `rollback_of`). |
| GET | `/api/projects/{id}/deployments` | History. |
| GET | `/api/deployments/{id}` | One deployment with its log. |
| GET | `/api/deployments/{id}/bundle` | The deployed bundle. |
| POST | `/api/deployments/{id}/stop` · `/health` · `/url` | Stop, check health, mark live with a URL. |

## GitHub

| Method | Path | Purpose |
|---|---|---|
| GET / PUT / DELETE | `/api/projects/{id}/git` | Link. |
| POST | `/api/projects/{id}/git/check` | Reachability and push permission. |
| POST | `/api/projects/{id}/git/push` | `message`, `force`. |
| POST | `/api/projects/{id}/git/pull` | Pull as a new revision. |
| GET | `/api/projects/{id}/git/history` | Commits touching the project file. |
| POST | `/api/projects/{id}/git/restore` | `sha` → new revision. |

## Triggers and MCP

| Method | Path | Purpose |
|---|---|---|
| GET | `/api/projects/{id}/triggers` | Trigger status. |
| GET / POST | `/api/triggers/{project_id}/{node_id}` | Public trigger endpoint (webhook, Slack, Telegram, WhatsApp). Each trigger authenticates its caller. |
| POST | `/api/mcp` | MCP Streamable HTTP endpoint (exposed projects). |

## Node packages

| Method | Path | Purpose |
|---|---|---|
| GET / POST | `/api/plugins` | List / install a wheel (admin). |
| POST | `/api/plugins/{name}/approve` · `/disable` · `/enable` | Approve exact permissions (`confirm`, wheel hash) / disable / enable. |
| DELETE | `/api/plugins/{name}` | Remove. |
| GET | `/api/plugins/{name}/wheel` | Download the wheel. |

## Settings, secrets, observability

| Method | Path | Purpose |
|---|---|---|
| GET / PUT / DELETE | `/api/settings/assistant` | Wingman settings (admin to change; DELETE resets). |
| POST | `/api/settings/assistant/test` · `/models` | Test connection / list models. |
| GET | `/api/secrets` | Secret names and where they are set. |
| PUT / DELETE | `/api/secrets/{name}` | Set / remove (admin). Values are write-only. |
| GET / PUT / DELETE | `/api/settings/observability` | OTLP export settings. |
| POST | `/api/settings/observability/test` | Send a test span. |
| GET | `/api/metrics` | Prometheus metrics (`AGENTICMIND_METRICS_TOKEN`). |

## Auth and people (sign-in required)

| Method | Path | Purpose |
|---|---|---|
| GET | `/api/auth/status` | Mode, whether setup is needed, current user. |
| POST | `/api/auth/setup` | Create the first admin. |
| POST | `/api/auth/login` · `/logout` | Sign in / out. |
| GET / PATCH | `/api/auth/me` | Profile. |
| POST | `/api/auth/me/password` | Change password (revokes other sessions). |
| POST | `/api/auth/me/sessions/revoke-others` | Sign out other browsers. |
| GET / POST | `/api/users` | List / add people (admin). |
| PATCH | `/api/users/{id}` | Role, active, password reset (admin). |
