REST API
Interactive API reference, Swagger UI, Postman collection, and authentication.
DataHub exposes a REST API for all console operations and integrations. Endpoint details below are generated from the OpenAPI spec.
In each endpoint playground, choose an API server (for local Docker use http://localhost:4400, or Same origin when the console and API share a reverse proxy). Requests are sent through the docs proxy (/api/openapi-proxy) to avoid CORS issues.
Integrator surfaces
| Surface | URL | Use |
|---|---|---|
| This reference | Sidebar pages by API tag | Browse schemas + try requests |
| Swagger UI | /api/docs on your API host | Interactive try against running API |
| OpenAPI JSON | GET /api/docs-json | Codegen / CI |
| Postman | /postman/datahub.postman_collection.json | Offline collection ({{baseUrl}}, Bearer {{token}}) |
| Console Devs | /devs (signed-in) | Quick links to all of the above |
Authentication
All API endpoints (except login, health, and documented public share routes) require a JWT bearer token.
POST /api/auth/login
Content-Type: application/json
{ "username": "admin", "password": "your-password" }Use the returned token as:
Authorization: Bearer <token>In Swagger UI, click Authorize and paste the token. Postman collection variables use the same Bearer pattern.
Plant scope and UNS filter
Users may be scoped to a single plant and/or a UNS path filter. List and read endpoints respect these limits server-side — do not rely on client-side filtering alone. See Permissions matrix and RBAC.
Public routes (no JWT)
| Route | Purpose |
|---|---|
GET /api/public/dashboards/:token | Shared dashboard data (tag paths limited to widgets) |
GET /api/public/dashboards/:token/latest | Latest telemetry for one widget tag |
GET /api/public/dashboards/:token/history | History for one widget tag |
GET /api/public/screens/:token | Shared screen payload |
GET /api/public/files/:token | Shared file or directory metadata |
GET /api/public/files/:token/content | Download shared file binary |
GET /api/health | Service liveness |
Mark Postman requests for these routes with "auth": { "type": "noauth" }.
Error responses
API errors return JSON with statusCode, message, and error. User-visible error codes in the console are translated via the frontend i18n catalog — integrators should handle HTTP status and stable message shapes.
Webhook testing
For HTTP rule actions during development, inspect deliveries at GET /api/webhooks/test/log (authenticated).
