Skip to content

Query records: filter AST + sorts + q + keyset cursor (the workhorse)

POST
/api/v1/workspaces/{ws}/databases/{db}/records/query
db
required
string
Media typeapplication/json
object
filter
Any of:
object
field
required
string
>= 1 characters
op
required
string
Allowed values: eq neq contains not_contains gt gte lt lte before after within has has_none category_is category_is_not is_empty not_empty
value
disabled
boolean
pinned
boolean
label
string
<= 120 characters
icon
string
<= 40 characters
sorts
Array<object>
default: <= 3 items
object
field
required
string
>= 1 characters
direction
string
default: asc
Allowed values: asc desc
nulls
string
Allowed values: first last
q
string
<= 200 characters
limit
integer
default: 50 >= 1 <= 200
cursor
string
Media typeapplication/json
object
data
required
Array<object>
object
id
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
number
required
integer
nullable >= -9007199254740991 <= 9007199254740991
identifier
required
string
nullable
title
required
string
values
required
object
key
additional properties
position
required
string
created_by
required
string
nullable
created_at
required

ISO timestamp

string
updated_at
required

ISO timestamp

string
computed_values
required

Computed values keyed by field id, with per-field siblings for an AI field: <field_id> is the last good value; <field_id>:computed_at the ISO timestamp it was computed; <field_id>:error the last failure, if any (the last good value is kept); <field_id>:pending_at the ISO timestamp a recompute was QUEUED, present only while one is in flight, and dropped once older than five minutes so a crashed worker cannot leave a cell “computing” for ever. Read the marker with aiPendingAt() from @storyos/schemas rather than building the key by hand.

object
key
additional properties
next_cursor
required
string
nullable
has_more
required
boolean
Examplegenerated
{
"data": [
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"number": 1,
"identifier": "example",
"title": "example",
"values": {
"additionalProperty": "example"
},
"position": "example",
"created_by": "example",
"created_at": "example",
"updated_at": "example",
"computed_values": {
"additionalProperty": "example"
}
}
],
"next_cursor": "example",
"has_more": true
}