Curltale AI

Docs › Reference

HTTP API

The routes of the app's own API, how to authenticate, and what the MCP endpoint is for.

Curltale AI exposes three things over HTTP:

WhatPathAuthenticationUse it for
The MCP endpoint/mcpBearer tokenAgents and tools. This is the integration surface: see Connect an agent and The tools.
The app's own API/api/... (admin routes under /api/admin, the library under /api/library)Session cookieThe web UI. You can script against it, but it is not a versioned contract: before 1.0, minor versions may change it.
HealthGET /api/healthNoneLoad balancers and monitoring. Returns {"ok": true}.

The Excel template and exports are plain downloads: GET /api/template.xlsx and GET /api/export.xlsx?version=published (or draft).

Sign in from a script#

curl -c jar.txt -H 'content-type: application/json' \
  -d '{"username":"admin","password":"..."}' https://<your-host>/api/login
curl -b jar.txt https://<your-host>/api/me
curl -b jar.txt https://<your-host>/api/entities

The cookie lasts SESSION_HOURS (default 12). The same rate limits and access rules apply as in the UI. A user's entitlements decide what the data routes return.

Routes#

Grouped by what they do. {x} is a path parameter. Roles are those of Users, roles and access; admin routes need the admin role.

Session and status#

RoutePurpose
POST /api/login, POST /api/logoutStart and end a session.
GET /api/me, POST /api/me/passwordWho you are (roles, entitlements) and change your password.
GET /api/statusWhat the app has switched on (for example whether the library is enabled).
GET /api/healthHealth, without signing in.

The model#

RoutePurpose
GET /api/entities, GET /api/entities/{key}, GET /api/entities/{key}/documentsList entities, read one with its fields, and list the related documents you may read.
GET /api/relationships, GET /api/examples, GET /api/graph, GET /api/pathRelationships, query examples, the entity graph and join paths.
GET /api/searchHybrid search over the model.
POST/PATCH/DELETE /api/entities/{key}, PUT/DELETE /api/entities/{key}/fields/{col}Edit the draft (modeller).
PUT/DELETE /api/relationships/{rid}, GET /api/relationships/next-idEdit relationships in the draft.
PUT/DELETE /api/examples/{kid}Edit query examples in the draft.

Versions and Excel#

RoutePurpose
POST /api/versions/draft, DELETE /api/versions/draftStart or discard the draft.
GET /api/versions/validate, GET /api/versions/diffValidate the draft; compare it with the published version.
POST /api/versions/publish, GET /api/versions/publish/statusPublish (publisher) and follow the progress.
GET /api/auditThe audit log of model changes.
GET /api/template.xlsx, GET /api/export.xlsxDownload the blank template or an export.
POST /api/admin/import/excelUpload a workbook (checked first; dry_run=false creates the draft).

Data#

RoutePurpose
GET /api/data/status, GET /api/data/tables, GET /api/data/table, GET /api/data/rowWhich database is in use, its tables, rows and one row.
POST /api/data/sqlOne read-only statement under your entitlements.
GET /api/data/conformanceThe model check.
POST /api/admin/data/buildBuild or rebuild the demo database (admin).

Assistant#

RoutePurpose
POST /api/alfredAsk Alfred a question (streamed).

Administration#

RoutePurpose
GET/POST /api/admin/users, PUT /api/admin/users/{username}/roles, PUT /api/admin/users/{username}/entitlementsUsers, roles and entitlements.
GET/POST /api/admin/tokens, PUT /api/admin/tokens/{tid}/entitlements, DELETE /api/admin/tokens/{tid}MCP tokens.
GET/POST /api/admin/connectors, PUT/DELETE /api/admin/connectors/{cid}Connectors.
POST /api/admin/connectors/{cid}/test, /introspect, /activate, /generate-draft; POST /api/admin/connectors/deactivate; GET /api/admin/connectors/{cid}/structureThe connector workflow.
GET/PUT /api/admin/settings, DELETE /api/admin/settings/{name}Settings.
POST /api/admin/llm/test, POST /api/admin/storage/testTest the AI endpoint and the storage.
POST /api/admin/reindex, GET /api/admin/questionsRebuild the search index; questions nobody could answer.
POST /api/admin/reset-ontology, GET /api/admin/backups, GET /api/admin/backups/{name}Empty the ontology and download the Excel backups.
GET /api/admin/audit, GET /api/admin/activity/summary, /sessions, /sessions/{sid}, /events/{eid}/resultThe audit trail and the activity log.

The library#

All under /api/library. {ref} is a collection's id or slug.

RoutePurpose
GET/POST /collections, PATCH/DELETE /collections/{ref}Collections.
GET/PUT /collections/{ref}/grants, DELETE /collections/{ref}/grants/{gid}, POST /collections/{ref}/self-grantAccess, including an admin granting themselves access (logged).
GET/POST /collections/{ref}/sources, POST /collections/{ref}/sources/url, DELETE /collections/{ref}/sources/{sid}Sources: upload, add a web page, delete.
POST /collections/{ref}/sources/{sid}/retry, /refreshRetry a failed source; capture a web page again.
GET/PUT /collections/{ref}/sources/{sid}/wiki, POST .../wiki/regenerate, POST .../wiki/approve, GET .../passages, GET .../download/original, GET .../download/pageThe source page, its passages and downloads.
GET /collections/{ref}/search, GET /findSearch inside a collection; search across everything you may read.
GET /collections/{ref}/topics, GET /collections/{ref}/topics/{slug}, POST .../merge, POST .../reviseTopics.
PUT/DELETE .../topics/{slug}/model-links, POST .../model-links/decide, POST .../model-links/suggestThe bridge to the model.
GET /collections/{ref}/inbox, GET /collections/{ref}/conflicts, GET .../conflicts/{kid}, POST .../conflicts/{kid}/approve, /reject, /redirectThe review queue and its decisions.
GET/POST/PATCH/DELETE /collections/{ref}/vocabulary..., POST .../vocabulary/proposals/{pid}, POST .../vocabulary/{kind}/mergeThe collection's vocabulary.
GET/POST /collections/{ref}/healthRun and read the health check.
GET /collections/{ref}/graphThe topic graph.
GET/POST /collections/{ref}/interviews, POST .../interviews/{iid}/turns, /draft, /finalize, PUT/DELETE .../claims/{claim_id}Interviews.
GET /collections/{ref}/exportExport a collection as a zip (managers).

This documentation covers version 0.2.0. Something missing or wrong? Open an issue.