HTTP API Reference
Reference for Axil Studio's own JSON endpoints - data, table rows with sort and filters, schema, read-only query, request proxy, exports and QR.
On this page8
The Studio page is rendered entirely from these JSON endpoints, served on the Studio port (app port + 1). You can call them from scripts or tests while Studio is running, for example curl http://localhost:3001/api/studio/schema.
Note
These endpoints are for local tooling and follow the same rules as the UI: requests must use an allowed Host header (otherwise 403 Invalid Host header), and CORS is only granted to local origins. See Configuration.
Summary
| Method | Path | Returns |
|---|---|---|
GET | / or /studio | The Studio HTML page |
GET | /api/studio/data | Routes, realtime channels and tables |
GET | /api/studio/table/:name | One page of rows |
GET | /api/studio/schema | Tables with foreign keys and indexes |
POST | /api/studio/query | Result of a read-only SQL query |
POST | /api/studio/proxy | Your app's response to a proxied request |
GET | /api/studio/export/:format | Postman, Insomnia or OpenAPI JSON |
GET | /api/studio/qr | A QR code as a data URL |
OPTIONS requests get 204. Unknown paths get 404 Not found (plain text). An unexpected server error returns 500 with { "error": "..." }.
GET /api/studio/data
Re-collects everything (bypassing the 5-second cache) and returns a StudioData object:
1{
2 "appName": "shop-api",
3 "appUrl": "http://localhost:3000",
4 "studioUrl": "http://localhost:3001",
5 "dbDriver": "sqlite",
6 "routes": [
7 { "method": "GET", "path": "/users/:id", "handler": "users.get", "middleware": ["authenticate"] }
8 ],
9 "websockets": [{ "path": "/ws", "events": ["connection", "message"] }],
10 "sse": [{ "path": "/events", "events": ["message", "error", "close"] }],
11 "tables": [
12 {
13 "name": "users",
14 "rowCount": 137,
15 "columns": [
16 { "name": "id", "type": "INTEGER", "nullable": true, "primary": true, "unique": false, "default": null }
17 ]
18 }
19 ],
20 "startedAt": "2026-11-11T09:30:00.000Z"
21}| Field | Type | Notes |
|---|---|---|
dbDriver | string or null | The configured driver, or null |
routes[] | RouteInfo | method, path, handler, middleware[], optional description |
websockets[], sse[] | { path, events[] } | Detected realtime endpoints |
tables[] | TableInfo | name, rowCount, columns[] (name, type, nullable, primary, unique, default) |
startedAt | string | ISO time the data was collected |
tables is empty when no database is connected.
GET /api/studio/table/:name
One page of rows from a table. The table name is URL-encoded in the path.
| Query parameter | Default | Description |
|---|---|---|
limit | 50 | Rows per page, capped at 1000 (invalid values fall back to 50) |
offset | 0 | Rows to skip |
sort | none | Column to order by |
dir | asc | asc or desc (used with sort) |
q | none | Case-insensitive "contains" search across every column |
filter | none | URL-encoded JSON array of { "column", "op", "value" } |
Filter operators: eq, neq, contains, starts, gt, gte, lt, lte, null, notnull. contains and starts are case-insensitive; null and notnull take no value. All filters must match (AND).
Response 200:
{ "rows": [{ "id": 812, "user_id": 7, "status": "paid", "total": 149.5 }], "total": 64 }total is the number of rows matching the search and filters. An unknown table, or no database connection, returns { "rows": [], "total": 0 }.
Response 400 (bad input):
{ "error": "Unknown column \"stauts\" in filter", "rows": [], "total": 0 }Returned when filter is not a JSON array, an item is not an object, a sort or filter column doesn't exist, an operator is unknown, dir is not asc/desc, or the database rejects a filtered or searched query (for example comparing text with an integer column on PostgreSQL).
Identifiers are validated against the table's columns and quoted; every value is a bound parameter.
GET /api/studio/schema
Tables with constraints, used by the Structure and Relations tabs and the ER diagram.
1{
2 "driver": "sqlite",
3 "tables": [
4 {
5 "name": "orders",
6 "rowCount": 260,
7 "columns": [{ "name": "user_id", "type": "INTEGER", "nullable": false, "primary": false, "unique": false }],
8 "foreignKeys": [{ "column": "user_id", "refTable": "users", "refColumn": "id" }],
9 "indexes": [{ "name": "idx_orders_user", "columns": ["user_id"], "unique": false }]
10 }
11 ]
12}driver is null and tables is empty when no database is connected. A column covered by a single-column unique index is reported with unique: true. If constraint introspection fails for a table, it is still listed with empty foreignKeys and indexes.
POST /api/studio/query
Runs one read-only SQL statement.
Request body: { "sql": string }.
Response: always { "rows": [...], "affected": number }, plus error when the query was not run or failed. Errors use status 200, except an oversized body.
| Situation | Response |
|---|---|
| Success | 200 { "rows": [...], "affected": 0 } |
Not a SELECT / WITH / SHOW / DESCRIBE / EXPLAIN / PRAGMA | 200 { "error": "Only SELECT queries are allowed in Studio", ... } |
Contains OUTFILE or DUMPFILE | 200 { "error": "INTO OUTFILE / DUMPFILE is not allowed in Studio", ... } |
| No database | 200 { "error": "No database connected", ... } |
Missing sql | 200 { "error": "Missing sql field", ... } |
| Database error | 200 { "error": "<database message>", ... } |
Body larger than maxBodyBytes | 413 { "error": "Request body too large", ... } |
See SQL console › Read-only rules for how each database runs the query.
POST /api/studio/proxy
Sends a request to your app and returns the complete response. This is what the API Explorer's Send uses.
The request must have Content-Type: application/json (otherwise 415).
| Field | Type | Description |
|---|---|---|
method | string | GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS |
path | string | Absolute path on the app, starting with / (not //), e.g. /users/1 |
query | object | Optional; appended to the URL as query parameters |
headers | object | Optional; hop-by-hop headers (host, connection, content-length, transfer-encoding, ...) and invalid names are dropped |
body | string | Optional; ignored for GET and HEAD |
Response 200 (whatever status your app returned):
1{
2 "status": 201,
3 "statusText": "Created",
4 "headers": { "content-type": "application/json" },
5 "body": "{\"status\":201,\"code\":\"HTTP_201_CREATED\",...}",
6 "truncated": false,
7 "timeMs": 12,
8 "size": 118,
9 "url": "/users"
10}The target is always http://localhost: plus the app port. Redirects are returned, not followed. body is cut at 5 MB (truncated: true), while size is the full byte length.
| Status | When |
|---|---|
400 | Body is not JSON, method is not allowed, or path is not an absolute app path |
413 | Body larger than maxBodyBytes |
415 | Content-Type is not application/json |
502 | The app could not be reached, or didn't answer within 30 s: { "error": "...", "timeMs": ... } |
GET /api/studio/export/:format
:format is postman, insomnia or openapi. Returns the generated JSON (Postman Collection v2.1, Insomnia export v4, or OpenAPI 3.0.3). See Export Collections for the contents.
GET /api/studio/qr
| Query parameter | Default | Description |
|---|---|---|
url | The Studio URL (http://localhost: plus the Studio port) | Text to encode |
Response: { "qrDataUrl": "data:image/png;base64,..." }, a 300 px PNG. qrDataUrl is an empty string if the QR code could not be generated.
Was this page helpful?