Production base URL: https://<your-backend-origin>
Local development base URL: http://localhost:3000
Most success responses:
{ "status": "ok", "data": {} }Some endpoints return status: "accepted" (async dispatch) or simple error envelopes:
{ "error": "message" }All requests include/propagate x-trace-id via trace middleware.
- Session auth is cookie-based.
- Mounted auth-required API groups:
/api/chat/api/workflows/api/workflow-runs/api/notifications/api/settings
- CSRF is enforced for authenticated mutation requests (
POST,PUT,PATCH,DELETE) usingx-csrf-tokenthat matchesap_csrfcookie.
GET /health— livenessGET /health/ready— readiness checks (runtime config + DB + webhook security + secrets)GET /health/metrics— Prometheus text metrics In production this stays private by default. UseAuthorization: Bearer <METRICS_AUTH_TOKEN>orx-metrics-tokenwhenMETRICS_AUTH_TOKENis configured, or explicitly setMETRICS_ALLOW_PUBLIC=true.
GET /statePOST /onboarding/registerPOST /loginPOST /logoutGET /meGET /accountPATCH /account/profilePATCH /account/emailPATCH /account/passwordGET /google/startGET /google/callback
POST /client-telemetry
GET /threadsPOST /threadsPATCH /threads/:threadIdDELETE /threads/:threadIdDELETE /threadsGET /threads/:threadId/messagesPOST /threads/:threadId/messages(non-streaming)POST /threads/:threadId/messages/stream(SSE streaming)POST /threads/:threadId/messages/:messageId/questions/:questionId/answer
GET /threads/:threadId/react-telemetryGET /threads/:threadId/audit-log
POST /attachments(multipart form; requiresthreadId, one or morefiles)GET /attachments/:attachmentIdDELETE /attachments/:attachmentId
Streaming event types emitted by /messages/stream:
attachments_linkeduser_savedthinkingblockchunkblock_endcompleteerror
GET /GET /:idPOST /PATCH /:idDELETE /:id(?mode=archive|hard)POST /:id/trigger(returnsstatus: acceptedon dispatch)GET /:id/runsPOST /:id/validatePOST /test-connection
GET /:runIdGET /trace/:traceId
Optional query:
GET /:runId?includeRaw=true
GET /workflows/POST /workflowsGET /documents/POST /documentsGET /runs/POST /runs
Notes:
- These endpoints are auth-protected and use hybrid retrieval:
- relational filters first (ownership/thread/workflow constraints)
- semantic vector similarity ranking second
- Responses include retrieval mode (
semantic,lexical_fallback, orunavailable) where applicable.
GET /workflows/:idGET /runs/:idGET /documents/:id
Notes:
- Recommendation endpoints are auth-protected.
- They return similarity-scored related entities and degrade to
mode: "unavailable"if retrieval is not available.
GET /(auth required)POST /:id/resolve(auth required)POST /(auth user or webhook secret)
GET /stream(SSE)GET /POST /:id/readDELETE /GET /push/public-keyPOST /push/subscribePOST /push/unsubscribePOST /push/test
SSE event envelope examples:
{ "type": "notification", "data": {} }{ "type": "workflow_update", "data": {} }All webhook callbacks are rate-limited and require callback secret.
POST /n8nPOST /callback
Required header:
x-webhook-secret- legacy accepted on n8n endpoint:
x-n8n-secret
{
"type": "completed",
"runId": "run_123",
"result": {}
}type: completed | error
{
"traceId": "trace_123",
"workflowKey": "wf_portfolio",
"provider": "n8n",
"status": "completed",
"result": {},
"raw": {},
"error": null
}status: running | completed | failed | waiting_approval
Settings routes are auth-protected and restricted to primary settings user.
GET /providersPOST /providersPOST /providers/:id/activePATCH /providers/:id/modelDELETE /providers/:idPOST /fetch-modelsGET /providers/model-capabilitiesGET /runtime-preferencesPATCH /runtime-preferencesGET /retrieval-preferencesPATCH /retrieval-preferencesGET /webhook-secretsPOST /webhook-secretsDELETE /webhook-secrets/:id
Notes:
POST /fetch-modelsrequiresproviderIdfor remote provider discovery and resolves API keys from saved provider connections only.GET /providers/model-capabilitiessupportsembeddingOnly=truefor retrieval-model selection flows.