Query records legacy
POST /v1/organisations/{organisation_id}/workspaces/{workspace_id}/collections/{name}/records/query Deprecated
Queries a collection's records by their indexed fields.
Authentication
Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work
Scope the API key needs: records:read
Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)
Parameters
-
organisation_idpathstringrequired -
workspace_idpathstringrequired -
namepathstringrequired
Request body
application/json RecordQuery required
-
countbooleanCount the records that match, across every page.
-
count_bystring|nullCount them by the value of an indexed
enum,personorbooleanfield too. -
cursorstring|nullA previous page's
next_cursor, with the same filter and sort. -
filterobject|null{"all": [...]}: conditions on indexed fields that all hold, each{field, op, value}or{"any": [...]}of such conditions; at most 10.opiseq,ne,gt,gte,lt,lte,contains,in,is_emptyornot_empty. -
limitinteger (int32)|null1 to 500, 100 when left out.
minimum 0 -
qstring|nullOnly records whose title starts with this, ignoring case.
-
sortSortKey[]Up to 2; ties go by record id. Oldest first when left out.
Responses
-
A page of the records that match, in the order asked. A page can hold fewer than
limitrecords, even none, whilenext_cursorsays more may remain -
unauthenticated -
workspace_content_restricted,insufficient_scope -
No such space,
collection_missing, or collections are off -
collection_detached -
validation_failed:field_missing,field_not_indexed,field_not_sortable,invalid_value,query_too_broad, the cursor or the limit -
rate_limited: the API key's requests per minute are used up; retry afterRetry-Afterseconds -
internal -
unavailable: the database is briefly unavailable; retry afterRetry-Afterseconds
Error codes
Errors come back as an ErrorBody whose code is one of these.
- 401
unauthenticated - 403
workspace_content_restrictedinsufficient_scope - 404
collection_missing - 409
collection_detached - 422
validation_failedfield_not_indexedfield_not_sortableinvalid_valuequery_too_broad - 429
rate_limited - 500
internal - 503
unavailable
Examples
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/workspaces/$WORKSPACE_ID/collections/$NAME/records/query" \
-H "Authorization: Bearer $IVY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' import { client, queryRecordsLegacy } from "@spacivapp/ivy-sdk";
client.setConfig({
baseUrl: process.env.IVY_API_URL,
headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});
const { data, error, response } = await queryRecordsLegacy({
path: { organisation_id: organisationId, workspace_id: workspaceId, name },
body: {},
}); {
"count": false,
"count_by": "string",
"cursor": "string",
"filter": {},
"limit": 0,
"q": "string",
"sort": [
{
"dir": "asc",
"field": "string"
}
]
} {
"counts": {
"by": {},
"complete": false,
"total": 0
},
"items": [
{
"collection": "string",
"collection_id": "collection_123",
"created_at": "2026-01-15T09:30:00Z",
"created_by": {
"id": "id_123",
"type": {}
},
"fields": {},
"id": "id_123",
"origin": {
"ask_id": "ask_123",
"index": 0,
"kind": "ask",
"run_id": "run_123"
},
"problems": [
{
"code": "not_found",
"field": "string"
}
],
"ranks": {},
"revision": 0,
"schema": "string",
"source": {
"provider": "ivy"
},
"sync": {
"conflict": {},
"error": {},
"pending": {},
"remote_updated_at": "2026-01-15T09:30:00Z"
},
"updated_at": "2026-01-15T09:30:00Z",
"updated_by": {
"id": "id_123",
"type": {}
}
}
],
"next_cursor": "string"
}