Collections, filters and lookup
Page, count, filter and find v2 records within the caller's permitted scope.
V2 collections use records and, for paginated lists, meta.pagination. Read the operation's schema on your instance for its filter fields, sorts and page limits. These rules differ from v1 pagination.
Choose a pagination mode
| Request | Behavior |
|---|---|
page=1&per_page=50 | Offset page with exact count and pages. |
cursor=&per_page=50 | Start a cursor walk where the requested sort supports it. |
| Neither selector | The collection's default strategy; inspect meta.pagination.strategy. |
Both page and cursor, even empty | 400 invalid_query. |
Follow the returned next value and retain filters, sort and brand across the walk. Page mode uses page numbers; cursor mode uses opaque tokens. The metadata key for the other direction is previous, rather than v1's prev.
For page mode, a request beyond the end returns an empty page. Invalid limits are rejected rather than silently clamped. The hard page-size ceiling is 500, and an operation can set a lower maximum. Deep page walks are limited; use a supported cursor sort when the response says the page is too deep.
Cursor mode omits exact counts and total pages. A cursor is bound to the authorized scope, brand, sort, filters and saved-view conditions. Changed queries return 400 invalid_query with query_changed; malformed cursors return invalid. Restart deliberately rather than reusing a token for a different query.
Cursor ordering has a public-ID tie breaker, but the walk is not a database snapshot. Concurrent changes can affect what you see. Persist progress only after your destination has durably processed the page, tolerate replays and reconcile separately where completeness matters.
Count without downloading rows
curl 'https://YOUR_BRAND_HOST/api/v2/data/users?page=1&per_page=0' \
-H 'Authorization: Bearer YOUR_API_KEY'The result has records: [], exact meta.pagination.count, pages: 0 and no adjacent pages. Filters, saved views and permissions still narrow the count. This is a count of accessible matching records, not an unrestricted tenant total.
Counting requires page mode and page 1. Combining per_page=0 with cursor or a later page returns 400 invalid_query.
Filter and sort
curl --get 'https://YOUR_BRAND_HOST/api/v2/data/tickets' \
-H 'Authorization: Bearer YOUR_API_KEY' \
--data-urlencode 'page=1' \
--data-urlencode 'filter[starts_at][gteq]=2026-10-01T00:00:00Z' \
--data-urlencode 'sort=-starts_at'Each field declares its permitted operators and value type. Relationship filters use public UUIDs. Unknown fields, unsupported operators, invalid values and invalid filter_join values return 400 invalid_query.
filter_join=and is the default; or combines direct predicates differently. admin_view_id applies a visible saved view's conditions as an additional intersection. A public saved view does not expand record access. Grouped expressions belong to saved views.
sort=starts_at is ascending and sort=-starts_at descending. Only one declared sort is accepted. Explicit sort takes precedence over saved-view sort, then the collection default. A mutable sort can be page-only; requesting cursor mode with it is an error. An unsortable collection rejects sort.
Find by a unique field
Where supported, discover eligible fields before issuing a lookup:
GET /api/v2/data/tickets/find_by/fields
GET /api/v2/data/tickets/find_by?field=reference&value=ORDER-42&scope[ticket_category_id]=CATEGORY_UUIDThe discovery response lists field names, case sensitivity and required scope combinations. A unique validation rule does not automatically make every field findable. Custom attributes must also be API-visible for the current brand.
Pin required category or user scope with public UUIDs. An unpinned required scope returns 422 field_not_findable; invalid scope values return 400 invalid_query. No match is 404 not_found; multiple matches are 409 multiple_matches. Historical duplicates can exist even when a rule now requires uniqueness.
Lookup intersects the same authorized scope as collection reads and creates nothing. Use explicit reconciliation logic before deciding whether a missing record should be created.