searchRepoCustomRecordsAtBranch
Search a custom model's records at the branch's working state. Body: { where?, sort?, limit?, cursor?, explain? }. Answers { data, next_cursor, total }: total counts every record where holds at the revision read (on a branch, as of this request), on every page, so for "how many ...?" send limit: 1 and read total. where is a tree whose nodes each have one kind key: {and:[...]}, {or:[...]}, {not:{...}}; {field, op, value} compares a custom field by API name; {field, op:"matches", where} holds when the record a reference field points at matches where; {tag: tagId} holds for records carrying the tag or a tag beneath it (ids from listRepoTagsAtBranch); {ids: [recordId, ...]} holds for the records with those ids; {referenced_by:{model, field, where?}} holds when at least one record of model points here through its reference field (and matches where); add count: one of {eq|ne|gt|gte|lt|lte: n} to compare how many do ({gt:1} more than one, {eq:0} none), or use every:{...} alone for "every such record matches" (true when none do). Operators by field type, as each field's filter.operators in listRepoCustomModelsAtBranch also lists them: text and rich_text: eq, ne, in, not_in, contains, not_contains, starts_with, ends_with, is_empty, is_not_empty; integer, decimal, currency, percent, date, datetime and duration: eq, ne, gt, gte, lt, lte, between, in, not_in, is_empty, is_not_empty; boolean: eq, ne, is_empty, is_not_empty; picklist and user: eq, ne, in, not_in, is_empty, is_not_empty; multi_picklist: eq, ne, has_any, has_all, has_none, is_empty, is_not_empty; geo, attachment and multi_attachment: is_empty, is_not_empty; reference: eq, ne, in, not_in, is_empty, is_not_empty, matches. between takes [low, high]; a multi_picklist's eq is the exact set. Values are in their write form: currency integer cents (5000000 is $50,000), percent basis points (1500 is 15%), date YYYY-MM-DD, datetime epoch milliseconds, duration seconds, references and users by id, picklists by option key. A formula field filters as the type it infers. Every condition is true or false: ne, not_in, not_contains, has_none, and not match records whose value is empty; every other comparison never does. Match empty values with is_empty or is_not_empty; null is refused. in: [] matches nothing. Text compares ignoring the case of ASCII letters only. sort: up to 3 keys {field, direction?: "asc"|"desc", nulls?: "first"|"last"}; empty values sort last by default either way, text ignoring case, a picklist in option order, and ties by record id. Page with limit (at most 1000, the default) and by passing next_cursor back as cursor with the same where and sort. explain: true adds explain, the filter as read with each field's type and operators. Caps: 160 nodes, nesting 7 deep, 3 nested matches/referenced_by and 16 in all, 1000 values in a list, 256 bytes in a text value. Errors: InvalidRecordFilter (400) lists up to 20 problems as { path, reason } and counts the rest in more_problems; RecordSearchLimitExceeded (400) names the cap, its maximum, and the actual count; InvalidCursor (400) says whether the cursor is from another search or the schema changed. A body past 65536 bytes is refused with RequestBodyTooLarge.
/repos/{repo_id}/branches/{branch}/custom-models/{model_api_name}/records/searchPath parameters
Request body JSON required
Returns
200
CustomRecordSearchPage
- referencesarray ofobjectrequired
The records in this repo that the page's reference fields hold, at the revision the page reads. live holds a record's model and label, the value of its primary field, or its model's name and the end of its id when that is empty; live is null for a deleted record. A record the caller can't read has no entry. A reference to another repo's record has none either: ask that repo's searchRepoCustomRecordLabelsAtBranch.
400
InvalidCursor | InvalidRecordFilter | RecordSearchLimitExceeded | InvalidRequest | RequestBodyTooDeep
One of the following:
- InvalidCursorEncoded
- InvalidRecordFilterEncoded
- RecordSearchLimitExceededEncoded
- InvalidRequestEncoded
- RequestBodyTooDeepEncoded
403
Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired
One of the following:
- ForbiddenEncoded
- ForbiddenOriginEncoded
- RequiresPersonalSessionEncoded
- RunBranchRequiredEncoded
404
BranchNotFound | CustomModelNotFound | RepoNotFound
One of the following:
- BranchNotFoundEncoded
- CustomModelNotFoundEncoded
- RepoNotFoundEncoded
413
RequestBodyTooLarge
503
SessionUnavailable | RateLimitUnavailable
One of the following:
- SessionUnavailableEncoded
- RateLimitUnavailableEncoded