Database API
SQL query execution and schema inspection
REST API endpoints for Database. 7 operations.
Detect database anomalies
POST /api/v1/anomaliesAnalyzes recent activity and returns a report of detected database anomalies.
Auth: Bearer API key
Responses
| Status | Description |
|---|---|
200 | Anomaly report |
401 | Missing or invalid API key |
500 | Internal error |
operationId: detectAnomalies
Translate natural language to SQL
POST /api/v1/nl-to-sqlGenerates a SQL statement from a natural-language description of the desired query.
Auth: Bearer API key
Responses
| Status | Description |
|---|---|
200 | Generated SQL |
401 | Missing or invalid API key |
500 | Internal error |
operationId: naturalLanguageToSql
Get query optimization suggestions
POST /api/v1/optimizeAnalyzes the tenant's database and returns indexing and query optimization suggestions.
Auth: Bearer API key
Responses
| Status | Description |
|---|---|
200 | Optimization suggestions |
401 | Missing or invalid API key |
500 | Internal error |
operationId: optimizeQuery
List recent query logs
GET /api/v1/query-logs/{tenant_id}Returns recent query-log entries for a tenant, newest first.
Auth: Bearer API key
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | path | string | Yes | Tenant id (UUID) |
limit | query | integer (int64) | No | Max entries to return (default 100, max 1000) |
Responses
| Status | Description |
|---|---|
200 | Recent query log entries |
401 | Missing or invalid API key |
500 | Internal error |
operationId: listQueryLogs
Get scaling suggestions
GET /api/v1/scalingReturns capacity and scaling recommendations for the tenant's database.
Auth: Bearer API key
Responses
| Status | Description |
|---|---|
200 | Scaling suggestions |
401 | Missing or invalid API key |
500 | Internal error |
operationId: getScalingSuggestions
Execute a SQL query
POST /api/v1/sqlRuns a parameterized SQL statement against the tenant's database and returns the result set.
Auth: Bearer API key
Request body
application/json (required) — schema SqlRequest.
Responses
| Status | Description |
|---|---|
200 | Query results |
400 | Invalid SQL |
401 | Missing or invalid API key |
429 | Rate limit exceeded |
500 | Internal error |
operationId: executeSql
Execute a batch of SQL queries
POST /api/v1/sql/batchRuns multiple SQL statements in one request; each query executes independently and returns its own result set.
Auth: Bearer API key
Request body
application/json (required) — schema BatchSqlRequest.
Responses
| Status | Description |
|---|---|
200 | Array of query results |
401 | Missing or invalid API key |
500 | Internal error |
operationId: batchSql