HTTP API Reference
RelataDB exposes a REST API on the HTTP port (default 9090). All endpoints require Bearer token authentication via the Authorization header.
Authentication
Authorization: Bearer <token>Create tokens via the CLI: relata tenant members <org> --add <pid> --role admin, or via POST /tokens.
Query
| Method | Endpoint | Description |
|---|---|---|
POST | /query | Execute a SQL (or Cypher) query |
POST | /query/arrow | Execute and return Arrow IPC |
POST | /query/stream | Streaming query results (SSE) |
GET | /export | Export query results as CSV/JSON |
curl -X POST http://localhost:9090/query \
-H "Authorization: Bearer $RELATA_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT * FROM Person LIMIT 5","purpose":"analytics"}'Search
| Method | Endpoint | Description |
|---|---|---|
POST | /search | Full-text / vector / hybrid search |
POST | /multi-search | Multi-query with rank fusion |
Ingest
| Method | Endpoint | Description |
|---|---|---|
POST | /ingest | Ingest CSV/JSON data |
POST | /ingest/bulk | Bulk ingest |
POST | /ingest/document | Ingest a document (with auto-chunking) |
POST | /ingest/media | Ingest media (image/audio/video) |
GET | /ingest/tasks/:id | Check ingest task status |
Tenants (3 surfaces)
/tenants — tenant admin
| Method | Endpoint | Description |
|---|---|---|
POST | /tenants | Create tenant |
GET | /tenants | List tenants |
GET | /tenants/me | Caller's tenant context |
GET | /tenants/:id | Tenant detail |
PATCH | /tenants/:id | Update name/classification |
POST | /tenants/:id/suspend | Suspend |
POST | /tenants/:id/reactivate | Reactivate |
DELETE | /tenants/:id | Soft-delete |
GET/PUT | /tenants/:id/quota | Get/set quota |
GET | /tenants/:id/usage | Usage |
POST/GET/DELETE/PATCH | /tenants/:id/members[/:pid] | Membership CRUD |
POST/GET/DELETE | /tenants/:id/sharing[/:aid] | Sharing agreements |
GET/PUT | /tenants/:id/config/search | Search config |
/api/v1/tenants — control-plane
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/tenants | Provision with inline quota |
GET | /api/v1/tenants | List with usage |
GET | /api/v1/tenants/:id | Config + usage |
POST | /api/v1/tenants/:id/suspend | Suspend (402 on queries) |
POST | /api/v1/tenants/:id/resume | Resume |
DELETE | /api/v1/tenants/:id | Hard purge (removes rows) |
GET | /api/v1/tenants/:id/usage | Billing snapshot |
GET | /api/v1/tenants/usage/summary | Cross-tenant summary |
/platform/tenants — platform admin
| Method | Endpoint | Description |
|---|---|---|
GET | /platform/tenants | List all |
GET | /platform/tenants/:id | Detail |
PATCH | /platform/tenants/:id/tier | Assign tier |
POST | /platform/tenants/:id/suspend | Suspend |
POST | /platform/tenants/:id/reactivate | Reactivate |
DELETE | /platform/tenants/:id | Tombstone |
GET | /platform/license | License status |
GET | /platform/usage | Usage summary |
Audit & Provenance
| Method | Endpoint | Description |
|---|---|---|
GET | /audit/count | Entry count |
GET | /audit/entries | List entries |
GET | /audit/proof | Merkle proof |
GET | /audit/log | Raw log |
POST | /api/v1/audit/export | Export (control-plane) |
Health & System
| Method | Endpoint | Description |
|---|---|---|
GET | /health | Health check |
GET | /health/live | Liveness |
GET | /health/ready | Readiness |
GET | /version | Version |
GET | /status | Detailed status |
GET | /metrics | Prometheus metrics |
GET | /config | Server config |
GET | /openapi.json | OpenAPI spec |
Admin
| Method | Endpoint | Description |
|---|---|---|
POST | /admin/backup | Trigger backup |
GET | /admin/backups | List backups |
POST | /admin/restore | Restore |
POST | /admin/compact | Compact storage |
POST | /admin/reindex | Reindex a type |
POST | /admin/rotate-dek | Rotate encryption key |
GET | /admin/system | System info |
GET | /admin/dashboard | Admin dashboard |
Cluster
| Method | Endpoint | Description |
|---|---|---|
GET | /cluster/nodes | List nodes |
GET | /cluster/topology | Topology view |
POST | /cluster/rebalance | Rebalance |
POST | /cluster/drain/:node | Drain a node |
See also
- Tenant management — CLI + onboarding guide
- SDKs — Python / TypeScript / Go clients
- Error codes — HTTP error reference