Skip to content

API Reference

This page lists common backend interfaces. The repository’s generated route catalog links mounted routes to source; CI checks generator freshness, not runtime completeness. The repository API guide contains additional endpoints and details. There is no bundled Swagger UI.

Browser login sets an HttpOnly cookie. For scripts, use a personal access token as Authorization: Bearer <token>. /api/auth/login-mobile returns a session token and expiresAt; /api/auth/login does not return the token in JSON. MASTER_KEY is not an API credential. Health and designated auth routes are public; SSO and webhook endpoints have their own authentication contracts.

MethodEndpointAuthDescription
GET/api/healthNoBasic health check
GET/api/health/detailedNoService status with latencies
GET/api/health/readyNoReadiness probe
GET/api/health/liveNoLiveness probe
GET/api/health/storageNoStorage provider (cache/queue/pub-sub) health
MethodEndpointAuthDescription
POST/api/auth/registerNoRegister new user
POST/api/auth/loginNoLogin with credentials (+ optional TOTP)
POST/api/auth/login-mobileNoLogin returning bearer token in response body (for native clients)
POST/api/auth/logoutYesLogout and invalidate session
GET/api/auth/meYesGet current user info
GET/api/auth/ws-ticketYesGet short-lived token for WebSocket authentication
POST/api/auth/passkey/register/optionsYesGenerate WebAuthn registration options
POST/api/auth/passkey/register/verifyYesVerify WebAuthn registration response
POST/api/auth/passkey/auth/optionsNoGenerate WebAuthn authentication options
POST/api/auth/passkey/auth/verifyNoVerify WebAuthn authentication response
POST/api/auth/totp/setupYesSetup TOTP 2FA
POST/api/auth/totp/enableYesEnable TOTP after verification
POST/api/auth/totp/disableYesDisable TOTP 2FA
POST/api/auth/linkYesRedeem channel link code
MethodEndpointDescription
GET/api/agentsList all agents
POST/api/agentsSpawn new agent
GET/api/agents/:idGet agent details
DELETE/api/agents/:idStop and remove agent
POST/api/agents/:id/messageSend message to agent
GET/api/agents/:id/eventsGet agent events (cursor-based: ?after=<seq>)
MethodEndpointDescription
GET/api/sessionsList sessions
GET/api/sessions/:idGet session details
GET/api/sessions/:id/messagesGet session messages
MethodEndpointDescription
GET/api/modelsList all models
POST/api/modelsRegister new model
GET/api/models/:nameGet model details
PATCH/api/models/:nameUpdate model config
DELETE/api/models/:nameDelete model
POST/api/models/:name/defaultSet as default model
GET/api/topicsGet topic bindings and configuration
GET/api/models/healthCheck provider health
GET/api/models/cli/statusCLI tool availability
GET/api/models/cli/quotaCLI quota status
GET/api/models/providers/ollama/modelsList available Ollama models
GET/api/models/providers/litellm/modelsList LiteLLM models
GET/api/models/providers/:provider/knownKnown models for a provider
MethodEndpointDescription
GET/api/topicsList all topics with current model bindings and config
PATCH/api/topics/:topic/configUpdate topic config (executorModel, temperature, maxTokens) (admin)
PUT/api/topics/:topic/bindingSet topic’s primary/backup model binding (admin)
POST/api/topics/assign-allBind one model as primary for all text topics (admin)
MethodEndpointDescription
GET/api/toolsList registered tools
GET/api/tools/:idGet tool details
GET/api/tools/allAll built-in and expanded MCP tool definitions
GET/api/tools/permissionsUser permission overrides
PUT/api/tools/permissionsSet an override, optionally scoped with expiry
DELETE/api/tools/permissions/:toolId/:actionReset permission
POST/api/tools/:toolId/tools/:toolName/executeExecute a tool function
MethodEndpointDescription
POST/api/chatSend a chat message (optional expertId for expert routing)
POST/api/chat/approveRespond to an approval request
MethodEndpointDescription
POST/api/documents/uploadUpload one or more documents
GET/api/documentsList documents (with optional filtering by category/status)
GET/api/documents/:idGet document details
GET/api/documents/:id/rawStream original file (with ?download=1 for attachment mode)
DELETE/api/documents/:idDelete document
POST/api/documents/:id/cancelCancel document processing
MethodEndpointDescription
POST/api/readerFetch and extract article/page content
MethodEndpointDescription
POST/api/researchStart a deep research job
GET/api/research/:jobIdGet persisted research job status and results
MethodEndpointDescription
GET/api/tasksList user’s tasks (?status=, ?due=today, ?category=, ?view=next for next-action order with a bucket and reason each)
GET/api/tasks/:idGet one task
POST/api/tasksCreate a task (parentId, blockedBy[], estimate optional)
PATCH/api/tasks/:idUpdate task; status is open / in_progress / done / archived; parentId: null and blockedBy: [] clear the links
DELETE/api/tasks/:idDelete task (its sub-tasks become top-level)
MethodEndpointDescription
GET/api/hooksList all hooks
POST/api/hooksCreate hook
GET/api/hooks/:idGet hook details
PATCH/api/hooks/:idUpdate hook
DELETE/api/hooks/:idDelete hook
POST/api/hooks/:id/toggleToggle hook enabled state
MethodEndpointDescription
GET/api/auth/api-tokensList API tokens
POST/api/auth/api-tokensCreate token
DELETE/api/auth/api-tokens/:idRevoke token
MethodEndpointDescription
GET/api/saml/:orgSlug/metadataRetrieve organization SAML metadata
POST/api/saml/:orgSlug/acsOrganization SAML assertion consumer service

SCIM (System for Cross-domain Identity Management)

Section titled “SCIM (System for Cross-domain Identity Management)”
MethodEndpointDescription
GET/api/scim/v2/UsersList users
POST/api/scim/v2/UsersCreate user
GET/api/scim/v2/Users/:idGet user
PATCH/api/scim/v2/Users/:idApply supported SCIM user updates
DELETE/api/scim/v2/Users/:idDelete user
GET/api/scim/v2/GroupsList groups
MethodEndpointDescription
GET/api/admin/orgsList organizations (admin)
POST/api/admin/orgsCreate organization (admin)
GET/api/admin/usersList all users (admin)
POST/api/admin/usersCreate user (admin)
PATCH/api/admin/users/:idUpdate user (admin)
GET/api/admin/quotasList usage quotas (admin)
GET/api/admin/quotas/:userIdGet user quota details (admin)
PATCH/api/admin/quotas/:userIdUpdate user quota overrides (admin)
DELETE/api/admin/quotas/:userIdClear user quota overrides (admin)
POST/api/admin/impersonate/:userIdStart impersonation session (admin)
POST/api/admin/impersonate/stopStop impersonation session
GET/api/admin/impersonateList recent impersonation sessions (admin)
GET/api/admin/auditAudit log (admin)

PUT /api/tools/permissions accepts toolId, action, level (ALLOW, ASK, DENY), optional reason, and optional scope. A scope needs future expiresAt and at least one of sessionId, workspaceId, pathPattern, commandPattern. An existing DENY cannot be replaced by scoped ALLOW without first reviewing the denial. Deleting an override restores its manifest default.

Direct execution accepts an args object and runs unattended. Blocked ASK returns HTTP 409 with code: "approval_required"; other tool execution failures return 400 with code: "tool_execution_failed". See Security.

New clients connect to /gateway and send an authentication frame within five seconds. Use a short-lived ticket from GET /api/auth/ws-ticket where appropriate. Frames and event types are defined by src/core/gateway/protocol.ts; consult that schema rather than the retired /ws examples. The backend exposes gateway status through /api/gateway/status and connection information to authorized callers.

GET /v1/models lists registry models and octipus/agent. POST /v1/chat/completions supports text messages and final-text SSE delivery. octipus/agent runs the latest user message through the agent; the older octipus/orchestrator alias is accepted. A stable user field or X-Octipus-Session header keeps an agent conversation sticky.

Registry model IDs use stateless provider passthrough. This is a limited text interface, not full OpenAI API compatibility: client tool schemas and multimodal content arrays are not supported. Streaming chunks the completed response rather than emitting provider tokens as they are generated.

Agent-mode usage reports the observed total under completion/total tokens, with prompt tokens set to zero because the split is unavailable. API token scope api:chat applies to completions; an unscoped token is full access.

The standalone MCP server uses separate /sse and /messages routes on its own listener. These are not backend REST routes. See MCP Server.