ORM Studio

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.

7 min readUpdated DocumentationEdit this page
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

MethodPathReturns
GET/ or /studioThe Studio HTML page
GET/api/studio/dataRoutes, realtime channels and tables
GET/api/studio/table/:nameOne page of rows
GET/api/studio/schemaTables with foreign keys and indexes
POST/api/studio/queryResult of a read-only SQL query
POST/api/studio/proxyYour app's response to a proxied request
GET/api/studio/export/:formatPostman, Insomnia or OpenAPI JSON
GET/api/studio/qrA 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:

JSON
JSON
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}
FieldTypeNotes
dbDriverstring or nullThe configured driver, or null
routes[]RouteInfomethod, path, handler, middleware[], optional description
websockets[], sse[]{ path, events[] }Detected realtime endpoints
tables[]TableInfoname, rowCount, columns[] (name, type, nullable, primary, unique, default)
startedAtstringISO 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 parameterDefaultDescription
limit50Rows per page, capped at 1000 (invalid values fall back to 50)
offset0Rows to skip
sortnoneColumn to order by
dirascasc or desc (used with sort)
qnoneCase-insensitive "contains" search across every column
filternoneURL-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).

Terminal
❯curl -G http://localhost:3001/api/studio/table/orders \
--data-urlencode 'limit=25' \
--data-urlencode 'sort=created_at' --data-urlencode 'dir=desc' \
--data-urlencode 'filter=[{"column":"status","op":"eq","value":"paid"},{"column":"total","op":"gte","value":100}]'

Response 200:

JSON
JSON
{ "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):

JSON
JSON
{ "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.

JSON
JSON
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.

Terminal
❯curl -X POST http://localhost:3001/api/studio/query \
-H 'Content-Type: application/json' \
-d '{"sql":"SELECT status, COUNT(*) AS n FROM orders GROUP BY status"}'

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.

SituationResponse
Success200 { "rows": [...], "affected": 0 }
Not a SELECT / WITH / SHOW / DESCRIBE / EXPLAIN / PRAGMA200 { "error": "Only SELECT queries are allowed in Studio", ... }
Contains OUTFILE or DUMPFILE200 { "error": "INTO OUTFILE / DUMPFILE is not allowed in Studio", ... }
No database200 { "error": "No database connected", ... }
Missing sql200 { "error": "Missing sql field", ... }
Database error200 { "error": "<database message>", ... }
Body larger than maxBodyBytes413 { "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).

FieldTypeDescription
methodstringGET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS
pathstringAbsolute path on the app, starting with / (not //), e.g. /users/1
queryobjectOptional; appended to the URL as query parameters
headersobjectOptional; hop-by-hop headers (host, connection, content-length, transfer-encoding, ...) and invalid names are dropped
bodystringOptional; ignored for GET and HEAD
Terminal
❯curl -X POST http://localhost:3001/api/studio/proxy \
-H 'Content-Type: application/json' \
-d '{"method":"POST","path":"/users","headers":{"Content-Type":"application/json"},"body":"{\"name\":\"Ada\"}"}'

Response 200 (whatever status your app returned):

JSON
JSON
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.

StatusWhen
400Body is not JSON, method is not allowed, or path is not an absolute app path
413Body larger than maxBodyBytes
415Content-Type is not application/json
502The 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 parameterDefaultDescription
urlThe 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?

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY