Skip to main content
POST
The typed record query: a filter, sorts, aggregates and a group over every match, text search, and an ids-only mode. The path names the type; a body naming another is refused. Without sorts, aggregates or group it pages by record id: a write between pages never moves another record across a boundary, and total_count is on the first page. A sorted or summarizing query pages by offset and is live: a write between pages can.

Authorizations

Authorization
string
header
required

An API key issued with object_model scopes: Authorization: Bearer sk_…. The scopes: object_model:records:read, object_model:records:write, object_model:facts:read, object_model:facts:write, object_model:model:read, object_model:model:configure, object_model:actions:run, object_model:changes:read. An operation's security lists the scopes it needs; several entries mean any one of them will do. A person field (ref(user), ref_list(user)) holds a user id: look people up by email or id with GET /v1/users, outside this API, with a key that also has users:read.

Scopes

object_model:records:read

Path Parameters

type_id
string
required

Body

application/json

A query names at most 64 distinct fields in all, across filter, sorts, aggregates (field and fallback_field), group and search.fields; a field named twice counts once. Past that it is refused (422 too_many_fields, path the first field past the bound).

aggregates
object[]

Summaries over every match, not only this page, answered in summary.aggregates in the order asked.

cursor
string

The previous page's next_cursor. Leave it out to start at the first record.

filter
object

Which records: a record filter (see its schema). Leave it out for every record you can read.

group
object

Group the matches by a field's value: answered in summary.groups.

limit
integer

Records per page: 1 to 200. Default 50. On a query, select: ids takes up to 5,000, and a text search up to 50.

A text search: only records whose named fields match text.

select
enum<string>

records (the default) answers the matching records; ids answers only their ids, up to 5,000 a page.

Available options:
records,
ids
sorts
object[]

The order, by field, first sort first. Without sorts, records come in id order.

type_id
string

Named by the path: leave it out, or send the same id.

Response

Answered.

deleted_id
string

A delete's answer: the id removed, once it is gone.

disposition
string

A create's answer: created, or existing when unique_by matched a record, which is answered unchanged.

next_cursor
string

Send it as cursor for the next page. Empty on the last page.

records
object[]

The records: a page of a listing or query, or the one record a get or write answers.

summary
object

With aggregates or group: {"aggregates": [{"field", "op", "value", "error"}], "groups": [{"value", "count", "aggregates": […]}], "groups_truncated"}. aggregates are in the order asked, over every match, not only this page. A count is 0 when nothing matches; a sum, average, min or max is null when no match has a value. groups has one entry per value of the group field, in ascending order (records with no value form a group whose value is null), at most 200, with groups_truncated set past that. Sent again on every page.

total_count

How many records the query matched in all, as a string. An unsorted listing or query sends it on its first page only; a sorted or summarizing query sends it on every page. Absent on a get or a write.

written_id
string

A create's or update's answer: the record written. Also in records, unless the write itself took the record out of your sight.