Connections
Admin — relay management
Section titled “Admin — relay management”| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/v1/relays | Admin | Register relay |
| GET | /api/v1/relays | Admin | List relays |
| GET | /api/v1/relays/{id} | Admin | Relay details |
| DELETE | /api/v1/relays/{id} | Admin | Deregister relay |
Register: POST /api/v1/relays with {"name": "NYC Office"} returns {"id": "...", "token": "rl_..."}. Save the token — it is shown only once.
Relay protocol
Section titled “Relay protocol”| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/v1/relay/events | Relay token | SSE stream (query jobs) |
| POST | /api/v1/relay/register | Relay token | Register connections |
| POST | /api/v1/relay/results/{rid} | Relay token | Post query results |
These endpoints are used by the relay binary, not by users.
User — querying
Section titled “User — querying”| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/v1/connections | JWT | List available connections |
| POST | /api/v1/connections/{id}/query | JWT | Execute SQL |
| POST | /api/v1/connections/{id}/introspect | JWT | Schema introspection |
POST /api/v1/connections/{id}/query
Section titled “POST /api/v1/connections/{id}/query”Query: {"sql": "SELECT * FROM revenue WHERE quarter = 'Q4'"}
Response: {"columns": ["id", "amount", "quarter"], "rows": [["1", 50000, "Q4"], ...]}
POST /api/v1/connections/{id}/introspect
Section titled “POST /api/v1/connections/{id}/introspect”Introspect: {"action": "list_tables"} or {"action": "describe_table", "table": "revenue"} or {"action": "table_schema", "table": "revenue"}