Skip to content

HTTP API

Every HTTP route the engine mounts when kyma is running. Auth is optional — when KYMA_AUTH_TOKENS is empty the role column is informational and every route accepts any caller. When auth is on, the listed minimum role is required, presented as Authorization: Bearer <token>.

The HTTP server listens on KYMA_HTTP_ADDR (default 0.0.0.0:8080). Arrow Flight runs on its own port (default 0.0.0.0:9090, configurable via KYMA_GRPC_ADDR); OTLP gRPC, when enabled, runs on KYMA_OTLP_ADDR (off by default; conventional port 4317).

Every JSON error response uses the same shape:

json
{ "error": { "code": "...", "message": "...", "request_id": "..." } }

X-Request-ID is set on the request if the client didn't send one, and propagated back on the response. Logs and error bodies share that id.

Health and metrics

Always unauthenticated.

MethodPathResponseNotes
GET/health200 application/json{status, version}Liveness probe.
GET/metrics200 text/plain — Prometheus expositionHistogram buckets tuned for _duration_seconds metrics.

Query

The query surface accepts SQL, KQL, or a query in any frontend the content-type registers. Results stream back as NDJSON — one JSON object per row.

MethodPathMin roleContent-TypeEffect
POST/v1/queryReadapplication/sql (default), application/x-kqlRun a query against the database in X-Database (default default).
GET/v1/catalog/schemaReadTree of databases → tables → columns. Cached server-side (default 5 s).

Query request headers:

HeaderDefaultEffect
X-DatabasedefaultTarget database.
Content-Typeapplication/sqlapplication/x-kql switches to KQL parsing.
X-Kyma-Max-Wall-Clock-Msserver-sidePer-query wall-clock budget; min 10 ms.
X-Kyma-Max-Memory-Bytesserver-sideMemory pool ceiling for the DataFusion run; min 1 MiB.
X-Kyma-Max-Object-Store-Bytesserver-sideBytes the scan may read from object store.

Query response headers:

HeaderMeaning
Content-Typeapplication/x-ndjson; charset=utf-8.
X-Kyma-RowsTotal row count returned.
X-Request-IDEcho of the request id.

Status codes: 200 (rows in body), 400 (parse error / empty body), 404 (database empty or unknown), 413 (body > 16 MiB), 429 (budget exceeded — X-Kyma-Budget-Limit header included), 500 (execution error).

Ingest

MethodPathMin roleContent-TypeEffect
POST/v1/ingestWriteapplication/x-ndjsonAppend rows to a table. NDJSON body, max 64 MiB.
POST/v1/admin/databases/{database}/tables/{table}WriteIdempotent table provisioning.
GET/v1/admin/databases/{database}/tables/{table}WriteReturn columns + row count for the table.

Ingest request headers:

HeaderDefaultEffect
X-DatabasedefaultTarget database.
X-TablerequiredTarget table.
X-Idempotency-KeyReplay-safe key. A repeated request with the same key returns the original ack with replayed: true.
X-Auto-CreatetrueCreate the database + table on first write. Set false to require pre-provisioning.
X-Schema-EvolvetrueAdd new columns mid-batch. Set false to drop unknown fields silently.

Ingest response (200 application/json):

json
{
  "snapshot_id": "...",
  "extent_count": 1,
  "rows_ingested": 123,
  "bytes_written": 4567,
  "replayed": false
}

Status codes: 200 (committed), 400 (missing X-Table, malformed NDJSON), 404 (table not found with X-Auto-Create: false), 413 (body > 64 MiB), 500 (commit failed).

Agent

MethodPathMin roleContent-TypeEffect
POST/v1/agent/askReadapplication/jsonRun one agent turn. Streams Server-Sent Events.
GET/v1/agent/runs/{run_id}ReadLook up a persisted run by uuid.

POST /v1/agent/ask body:

json
{ "question": "...", "database": "default", "include_thinking": false }

The SSE response carries seven event names: run_started, thinking_delta (only when include_thinking: true), answer_delta, tool_call, tool_result, answer_final, run_error, run_finished. run_finished is always the last frame. See Agent endpoint for the full event payload reference.

Run wall-clock cap: 60 s. Per-run tool-call cap: 12. Both surface as run_error codes (timeout and tool_loop) before the stream ends.

Dashboards

MethodPathMin roleEffect
GET/v1/dashboardsReadList all dashboards.
POST/v1/dashboardsWriteCreate a dashboard. Body: {name, description?, panels?}.
GET/v1/dashboards/{id}ReadFetch a dashboard with all panels.
PATCH/v1/dashboards/{id}WriteUpdate name / description, or atomically replace the panel set.
DELETE/v1/dashboards/{id}WriteDelete the dashboard and its panels.

{id} is a uuid. 404 for missing ids.

Cleanup (hard-delete GC)

MethodPathMin roleEffect
POST/v1/database/{db}/table/{table}/cleanupWriteHard-delete soft-deleted extents whose deleted_at is strictly before ?before=.

Required query param: before=<RFC3339> (e.g. 2025-01-01T00:00:00Z). Response body is the aggregate count: {extents_deleted, rows_freed, bytes_freed}.

Connectors

The connector admin surface manages periodic / scheduled connectors (Prometheus today; Postgres / MySQL / Mongo land with DB-M1+).

MethodPathMin roleEffect
POST/v1/connectorsWriteCreate a connector. Body: {name, type, target_database, target_table, schedule_ms, config}.
GET/v1/connectorsWriteList connectors (id, name, type, enabled).
GET/v1/connectors/{id}WriteRead a connector. Secret-shaped fields in config are scrubbed to ***.
PATCH/v1/connectors/{id}WriteUpdate name / schedule / enabled / config.
DELETE/v1/connectors/{id}WriteDelete the connector.
POST/v1/connectors/{id}/pauseWriteDisable the connector (disabled_reason="manual").
POST/v1/connectors/{id}/resumeWriteRe-enable.
POST/v1/connectors/{id}/triggerWriteEnqueue an immediate tick. Returns 202 Accepted.

schedule_ms must be in the range [100, 86400000] (100 ms → 24 h). See Connectors for the typed config shape per connector type.

Arrow Flight (gRPC)

Separate port — default :9090, configurable via KYMA_GRPC_ADDR (set to off to disable). Auth on the gRPC surface is not yet enforced; treat it as deployment-firewalled.

The Flight do_get ticket is a JSON envelope:

json
{ "database": "default", "query": "SELECT ...", "language": "sql" }

language is "sql" (default) or "kql". The server returns a streaming sequence of FlightData messages — Arrow IPC framing, zero-copy from kyma's columnar buffers to the wire. See Arrow Flight for client examples.

handshake, get_flight_info, get_schema, do_put, do_exchange, do_action, list_actions, list_flights return Unimplemented for now.

When the engine is built with the web-ui feature, Flight is also nested under the HTTP router at /flight/* as gRPC-web (auth on, Role::Read). Browsers reach the same surface without a separate gRPC client.

OTLP gRPC (logs)

Separate gRPC server on KYMA_OTLP_ADDR (default off; conventional port 4317). Phase A is logs-only; received batches land in KYMA_OTLP_DATABASE (default default) in a fixed otel_logs table. See OTLP gRPC.