Overview
A running QiForge oracle exposes a REST + WebSocket surface. Most routes require a UCAN delegation header; some (/health, /docs, plus anything declared in getAuthExcludedRoutes() or authExcludedRoutes) are public.
The Swagger UI at /docs is generated from the running app’s controllers — open it in a browser for the live, deployment-specific reference.
Authentication
Every protected route requires these headers:| Header | Required | Notes |
|---|---|---|
x-ucan-delegation | Yes | UCAN envelope authorising the request. |
x-did | Yes | The user’s IXO DID. |
x-matrix-access-token | Optional | Matrix session token (used by Portal/Slack). |
x-matrix-homeserver | Optional | Matrix homeserver URL. |
x-timezone | Optional | Propagates to rtCtx.user.timezone. |
x-request-id | Optional | Correlation ID; echoed back as X-Request-Id. |
CORS
CORS_ORIGIN controls allowed origins (wildcard * is the default; specific origins enable credentials).
Allowed request headers:
GET, POST, PUT, DELETE, PATCH, OPTIONS.
Exposed response headers: X-Request-Id.
Public routes
| Route | Method | Auth | Purpose |
|---|---|---|---|
/health | GET | Public | Liveness probe. |
/docs | GET | Public | Swagger UI. |
/docs/(.*) | GET | Public | Swagger static assets. |
getAuthExcludedRoutes() or by createOracleApp({ authExcludedRoutes }).
Protected routes (overview)
The runtime ships these modules:SessionsModule— manage chat sessions (/sessions).MessagesModule— send and stream messages (/messages).WsModule— WebSocket gateway for event streaming.SubscriptionModule— credit/subscription gating middleware (active whencreditsplugin is loaded).
getNestModules(). Bundled examples:
SlackModule— Slack webhook endpoints (whenslackplugin is loaded).UserPreferencesController—/user-preferencesCRUD (whenuser-preferencesplugin is loaded).ClaimProcessingModule— claim cron endpoints (whencreditsplugin is fully configured).
GET /docs. The shape is generated from your app’s controllers — including plugin and host routes — so it’s always in sync.
WebSocket events
Plugins emit typed events viartCtx.emit. The framework forwards them over the active WebSocket connection to the client.
| Event | When it fires |
|---|---|
toolCall | A tool is being invoked (or has returned). |
actionCall | An action (e.g. AG-UI action) is being invoked. |
renderComponent | A render component result is ready for the client. |
reasoning | The agent emits intermediate reasoning. |
browserToolCall | A browser-side tool is being invoked on the user’s Portal. |
router | Routing decision between agents/sub-agents. |
messageCacheInvalidation | A message cache entry should be invalidated. |
Record<string, unknown> and may be tightened in future runtime versions. The @ixo/oracles-client-sdk React SDK parses these and renders them.
Client SDK
For frontend integration, use@ixo/oracles-client-sdk — it handles the SSE / WebSocket protocol, UCAN delegation, and event parsing. See Client SDK.
Related references
- Identity and auth — the UCAN flow.
- Plugin HTTP endpoints — adding your own routes.
- Client SDK — React integration.