API Reference
API Overview
Complete REST API and WebSocket event reference for the Realtime Platform.
The Realtime Platform exposes a REST API on the backend server (default port 3000) and a WebSocket gateway via Socket.IO on the same port.
Base URL
http://localhost:3000All REST endpoints are prefixed with /api/ except health and auth routes.
Authentication
Most API endpoints require authentication via one of:
- JWT Bearer Token —
Authorization: Bearer <token>header - Session Token —
Authorization: <session-token>orX-Session-Token: <session-token>header
The Admin UI uses session-based authentication. Service-to-service calls use JWT tokens.
Application Scoping
All entity-owning endpoints are scoped by application. The X-Application-Id header identifies which application's data to access:
curl http://localhost:3000/api/topics \
-H 'Authorization: Bearer <token>' \
-H 'X-Application-Id: app_abc123'The Admin UI auto-attaches this header from the currently selected application.
Environment Scoping
Many endpoints also respect the X-Environment header for environment-specific data:
curl http://localhost:3000/api/schemas/session.status/latest \
-H 'X-Application-Id: app_abc123' \
-H 'X-Environment: staging'Response Format
All API responses return JSON. Successful responses return the resource directly. Errors return:
{
"error": "NotFoundError",
"message": "Topic not found: session.status"
}Common HTTP Status Codes
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request — invalid input |
401 | Unauthorized — missing or invalid auth |
403 | Forbidden — insufficient permissions |
404 | Not Found |
409 | Conflict — optimistic concurrency failure |
500 | Internal Server Error |
Health Check
GET /healthReturns {"status":"ok"} — no authentication required.
Metrics
GET /api/metrics/prometheusReturns Prometheus-format metrics for scraping. No authentication required.
API Sections
Topics
CRUD for domain topics in the Topic Registry.
Schemas
Schema versioning, validation, and compatibility.
Database
Mappings, versions, promotions, and subscriptions.
Sync
Document CRUD with revision tracking.
Services
Sync document service namespace management.
Socket
Channel management and broadcasting.
Webhooks
Webhook endpoint management and delivery logs.
Debugger
Event traces, routing debug, and replay.
Auth
Token issuance, verification, and user auth.
Admin
Signing key management.