Chat / Tasks API
The /api/chat endpoints create and track chat tasks in the web application. Authenticate with a JWT access token from POST /api/auth/login, sent as a bearer token. Errors use the { "detail": "..." } shape; see the API Reference for the full auth and error model.
App API vs Workspace SDK
These /api/chat/* endpoints are the application surface used by the web app. For stable, versioned programmatic integration, prefer the Workspace SDK (POST /v1/chat/tasks) — a smaller, versioned contract. The two surfaces create tasks independently and return different shapes.
Create a Task — POST /api/chat/task/create
Creates a chat task. Only title is required; supply agent_id to run a specific Agent Builder agent.
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Task title. The only required field. |
| description | string | No | Longer task description. |
| agent_id | integer | No | Agent Builder agent to run. |
| files | array | No | Uploaded file_ids to attach to the task. |
| execution_mode | string | No | One of flash, balanced, think, auto. |
| agent_type | string | No | Default standard. |
| is_visible | boolean | No | Default true. Set is_preview: true for a hidden preview run. |
| llm_ids | array | No | Model ids by slot: [default, fast, vision, compact]. |
| memory_similarity_threshold | number | No | Default 1.5. |
| agent_config | object | No | Inline agent configuration overrides. |
Request:
curl -X POST http://localhost:8000/api/chat/task/create \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"title": "Summarize Q2 report",
"description": "Summarize the attached PDF",
"agent_id": 42,
"execution_mode": "balanced"
}' Response (200): required fields are task_id, title, status, and created_at; the model / channel / agent fields are populated when applicable.
{
"task_id": 1001,
"title": "Summarize Q2 report",
"status": "pending",
"created_at": "2026-07-10T09:20:00Z",
"model_id": "gpt-4o",
"model_name": "gpt-4o",
"small_fast_model_id": null,
"visual_model_id": null,
"compact_model_id": null,
"execution_mode": "balanced",
"channel_id": null,
"channel_name": null,
"agent_id": 42,
"agent_name": "Research Assistant",
"agent_logo_url": "/uploads/agent_logos/agent_42.png"
}Validation error (422): missing or malformed fields return FastAPI's validation shape — an array of per-field errors:
HTTP/1.1 422 Unprocessable Entity
{
"detail": [
{ "loc": ["body", "title"], "msg": "Field required", "type": "missing" }
]
}Errors: 401 (missing/invalid token), 404 "Agent not found or access denied" (bad agent_id), 422 (validation), 500.
Other Task Endpoints
The rest of the task lifecycle on the application API. All require the same JWT bearer auth and return { "detail": ... } on error.
| Method | Path | Purpose |
|---|---|---|
| GET | /api/chat/tasks | List tasks (paginated: page, per_page, search, and filters). Returns { tasks, pagination }. |
| GET | /api/chat/task/{task_id} | Full task detail. |
| GET | /api/chat/task/{task_id}/status | Lightweight status — poll this while a task runs. |
| PUT | /api/chat/task/{task_id} | Update task details (e.g. title). |
| DELETE | /api/chat/task/{task_id} | Delete a task and its related data. |
| GET | /api/chat/workspace/{task_id}/files | Workspace files produced during the run. |
| GET | /api/chat/workspace/{task_id}/output | Final output files. |
| GET | /api/chat/task/{task_id}/runtime-extensions | Live metadata published by the runtime extensions active on this task. |
Runtime Extensions — GET /api/chat/task/{task_id}/runtime-extensions
Returns metadata published by each runtime extension attached to the task. Values are read live from every registered extension on each call rather than served from a stored snapshot, and only fields an extension explicitly publishes are exposed.
Response (200):
{
"task_id": 1001,
"runtime_extensions": {
"example_extension": { "status": "ready" }
},
"runtime_extensions_status": "complete",
"runtime_extensions_omitted": []
}| Field | Description |
|---|---|
runtime_extensions | Extension name → that extension's published metadata. |
runtime_extensions_status | complete when every extension's metadata is included; truncated when some was dropped to stay within the response size cap. |
runtime_extensions_omitted | Names dropped because of that cap. |
The endpoint is fail-closed: if an extension cannot report, the call returns an error rather than partial data. Errors: 404 "Task not found" (also when the task is not yours), 400 or 403 from an extension, 500.
Full generated reference
Every application endpoint and its exact schema is available from the live OpenAPI spec — open /docs (Swagger) or /openapi.json on a running instance. This page curates the high-value task endpoints; the generated spec is the exhaustive source.
Next Steps
- Workspace SDK → — the versioned
/v1task API - End-to-End Example →