Cortex · Configuration & integration
Use the durable HTTP API
Use JSON request bodies and Authorization: Bearer <token> over a protected connection. Query token is also accepted (including WebSocket upgrades), but can leak in URLs/logs. Without a configured master token, a request with no token is authorized in local mode; an explicitly invalid token still fails. Static UI assets, provider webhooks/OAuth callbacks and pairing exchange are dispatched before daemon bearer authentication and have their own validation. Serving the UI is not proof that an API token works.
Most successful reads return 200 JSON. Unmatched routes return 404 {"error":"Not found","path":"…"}; unauthenticated API calls return 401 {"error":"Unauthorized"}. Explicit role denials return 403. The common handler maps thrown messages containing busy to 409, not found/not registered to 404, and other failures (including many malformed bodies/arguments) to 500 {"error":"…"}. Do not assume all invalid arguments produce 400. Pair exchange separately returns 400 with ok:false. These are current implementation contracts, not a promise of uniform validation.
In the following table, S means /api/v1/seats/{encodedSeatId} and C means S/conversations/{positiveConversationId}. Default-seat equivalents /api/v1/conversations… and /api/v1/tasks/graph accept optional query seatId; they are aliases, not another data store.
- GET S
- GET S/tasks/graph
- GET / POST S/conversations
- GET C
- PATCH C/config
- GET C/context
- GET C/entries
- POST C/submit
- POST C/abort
- POST C/compact
- POST C/reset
- POST C/fork
- POST C/classify-system1 or C/system1
For example, after substituting an authorized daemon URL, token, seat and conversation:
curl -H "Authorization: Bearer $PI_DURABLE_API_TOKEN" \
-H 'Content-Type: application/json' \
"$PI_DURABLE_DAEMON_URL/api/v1/seats/example/conversations/1/submit" \
-d '{"content":"Report current status without edits","whenBusy":"followUp","wait":false}'
# Accepted shape: {"submissionId":42,"status":...}
Use the entry ID for historical context/forking, submission ID for submission cancellation, task ID for task cancellation. They are not interchangeable. A request ID belongs to submission correlation/deduplication, not a replay permission for external effects.