Skip to content

Control Plane API

The Control Plane exposes the platform's REST API surface through APISIX, organized into route families under the /v1/ prefix.

Common Headers

All API requests require:

HeaderRequiredDescription
AuthorizationYesBearer <JWT> from Keycloak
X-API-VersionYesAPI version (e.g., 2024-01-01)
X-Correlation-IdYesRequest correlation ID (^[A-Za-z0-9._:-]{8,128}$)
Content-TypeFor mutationsapplication/json
Idempotency-KeyFor mutationsIdempotency key (24h TTL)

Route Families

Platform Management

GET /v1/platform/health

Returns platform health status.

GET /v1/platform/info

Returns platform version and configuration metadata.


Tenants

POST /v1/tenants

Create a new tenant.

json
{
  "slug": "acme-corp",
  "displayName": "Acme Corporation",
  "plan": "starter",
  "adminEmail": "admin@acme.example.com"
}

GET /v1/tenants

List all tenants. Supports pagination and filtering.

ParameterTypeDescription
statusstringFilter by status
planstringFilter by plan
limitnumberPage size (default: 20, max: 100)
cursorstringPagination cursor

GET /v1/tenants/:tenantId

Get a tenant by ID.

PATCH /v1/tenants/:tenantId

Update a tenant (plan, display name, status).

DELETE /v1/tenants/:tenantId

Soft-delete (deactivate) a tenant.


Workspaces

POST /v1/workspaces

Create a new workspace within a tenant.

json
{
  "tenantId": "tnt_01HXXX",
  "slug": "dev-environment",
  "displayName": "Development Environment",
  "capabilities": ["postgres", "mongo", "kafka", "storage"]
}

GET /v1/workspaces

List workspaces. Scoped by tenant context from JWT.

GET /v1/workspaces/:workspaceId

Get workspace details.

PATCH /v1/workspaces/:workspaceId

Update workspace capabilities or status.

DELETE /v1/workspaces/:workspaceId

Soft-delete a workspace.


Authentication

POST /v1/auth/token

Proxy to Keycloak token endpoint.

POST /v1/auth/refresh

Refresh an access token.

GET /v1/auth/signups/policy

Returns the current signup policy for the environment.


IAM (Plan-Capability Gated)

WARNING

IAM endpoints require the tenant's plan to have the identity capability enabled.

GET /v1/iam/realms

List Keycloak realms for the current tenant.

POST /v1/iam/realms/:realmId/clients

Create a new OAuth 2.0 client.

GET /v1/iam/realms/:realmId/roles

List realm roles.


PostgreSQL Data API

See PostgreSQL Data API for full reference.

EndpointDescription
GET /v1/postgres/:workspaceId/rows/:tableQuery rows
POST /v1/postgres/:workspaceId/rows/:tableInsert rows
PATCH /v1/postgres/:workspaceId/rows/:tableUpdate rows
DELETE /v1/postgres/:workspaceId/rows/:tableDelete rows

MongoDB Data API

See MongoDB Data API for full reference.

EndpointDescription
GET /v1/mongo/:workspaceId/collections/:col/documentsQuery documents
POST /v1/mongo/:workspaceId/collections/:col/documentsInsert documents
PATCH /v1/mongo/:workspaceId/collections/:col/documents/:idUpdate document
DELETE /v1/mongo/:workspaceId/collections/:col/documents/:idDelete document
POST /v1/mongo/:workspaceId/collections/:col/aggregateAggregation pipeline
POST /v1/mongo/:workspaceId/collections/:col/bulkBulk operations

Events

POST /v1/events/:workspaceId/publish

Publish a custom event to Kafka.

json
{
  "topic": "user.actions",
  "key": "usr_123",
  "payload": {
    "action": "checkout_completed",
    "amount": 198.95
  }
}

Functions (Serverless)

POST /v1/functions/:workspaceId/actions

Deploy a new serverless function.

GET /v1/functions/:workspaceId/actions

List deployed functions.

POST /v1/functions/:workspaceId/actions/:name/invoke

Invoke a function synchronously.

DELETE /v1/functions/:workspaceId/actions/:name

Remove a deployed function.


Storage (S3)

PUT /v1/storage/:workspaceId/objects/:path

Upload an object.

GET /v1/storage/:workspaceId/objects/:path

Download an object.

GET /v1/storage/:workspaceId/objects?prefix=...

List objects with prefix filtering.

DELETE /v1/storage/:workspaceId/objects/:path

Delete an object.


Error Responses

All errors follow a consistent format:

json
{
  "error": {
    "code": "WORKSPACE_NOT_FOUND",
    "message": "Workspace wks_01HXXX not found",
    "correlationId": "corr-abc-123",
    "timestamp": "2024-01-15T10:00:00.000Z"
  }
}

HTTP Status Codes

CodeMeaning
400Bad request (validation error)
401Unauthorized (missing or invalid token)
403Forbidden (insufficient scope/plan)
404Resource not found
409Conflict (duplicate, idempotency replay)
422Unprocessable entity (business rule violation)
429Rate limit exceeded
500Internal server error

Idempotency Replay

When a request with an Idempotency-Key that was already processed is received, the original response is replayed with:

X-Idempotency-Replayed: true

Released under the MIT License.