Skip to content

Records API

The records API is the main surface for client apps. Every base/auth/view collection exposes the same shape under /api/<collection_name>.

GET /api/<col>

Query params:

ParamTypeDefaultNotes
pageint11-based
perPageint30max enforced server-side
filterexprRule expression language
sortstring-created_atcomma-sep; - prefix = DESC; aliases created/updated
expandstringcomma-sep relation field paths; nested via .
fieldsstringcomma-sep field whitelist for the response
skipTotal1/truefalseomit count for faster paging

Response:

{
"data": [ { "id": "...", ... } ],
"page": 1,
"perPage": 30,
"totalItems": 42, // -1 if skipTotal
"totalPages": 2 // -1 if skipTotal
}
Terminal window
?filter=published=true
?filter=author.id=u1 || author.id=u2
?filter=title~"hello" && created>1730000000

Quote string literals with double-quotes. Operators: = != > >= < <= ~ (substring), &&, ||, parentheses.

Terminal window
?sort=-created # newest first
?sort=author,-created # by author asc, then newest first
?sort=-updated # last-modified first

Inline relation targets nested in the response under expand:

Terminal window
?expand=author # one hop
?expand=author.profile # two hops
?expand=author,comments # multiple
{
"id": "p1", "title": "...", "author": "u1",
"expand": {
"author": { "id": "u1", "email": "...", "expand": { "profile": { ... } } }
}
}
Terminal window
?fields=id,title

Returns only id and title for each row. id is always included.

GET /api/<col>/<id>

Returns { data: {...} } or 404.

POST /api/<col>
Content-Type: application/json
{ "title": "hello", "body": "world" }

Returns the created record (with id, created, updated). Validation errors return 422 with details: { fieldName: message }.

view collections return 405.

PATCH /api/<col>/<id>
Content-Type: application/json
{ "title": "new title" }

Partial update — fields not in the body stay unchanged. view collections return 405.

DELETE /api/<col>/<id>

Returns { data: null }. View collections → 405. Records referenced by restrict-mode relations → 409 with details listing the blockers.

Pass a Bearer token (user or admin):

Authorization: Bearer <jwt>

@request.auth.id, @request.auth.email, @request.auth.type are then available in API rules.

CodeWhen
200OK (list, get, update, delete)
201Created — POST only
400Malformed request
401Unauthorized (missing/invalid token where required)
403Forbidden (rule failed)
404Collection or record not found
405Write attempted on a view collection
409Delete blocked by a restrict cascade
422Validation failed (details per field)
429Rate limit exceeded
  • Rules — gating list/view/create/update/delete
  • Files — uploads attached to records
  • Realtime — live updates over WebSocket
  • Batch API — atomic multi-op transactions