Skip to content
Navigation

searchRepoCustomRecordsAtCommit

Search a custom model's records at the commit. 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.

POST
/repos/{repo_id}/commits/{commit_id}/custom-models/{model_api_name}/records/search

Path parameters

  • repo_id
    string
    required
    pattern: ^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • commit_id
    string
    required
    pattern: ^commit_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • model_api_name
    string
    required
    minLength: 1

Request body JSON required

  • where
    optional

    One of the following:

    • RecordFilter
    • null
  • sort
    optional
    array of
    object
    • field
      string
      required

      The custom field's API name.

      minLength: 1
    • direction
      optional
      asc
      or
      desc
    • nulls
      optional
      first
      or
      last
  • limit
    optional
    integer
    maximum: 1000 · minimum: 1
  • cursor
    optional

    One of the following:

    • PageCursor
    • null
  • explain
    optional
    boolean

Returns

200

CustomRecordSearchPage

JSON
  • data
    array of
    object
    required
    • id
      string
      required
      pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
    • fields
      map of
      any of
      required
    • formulas
      map of
      string
      required
  • next_cursor
    required

    One of the following:

    • PageCursor
    • null
  • references
    array of
    object
    required

    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.

    • record_id
      string
      required
      pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
    • live
      required

      One of the following:

      • LiveReferencedRecord
        • model_api_name
          string
          required
          minLength: 1
        • label
          string
          required
          minLength: 1
      • null
  • users
    array of
    object
    required

    The users that the page's user fields name, with their display names.

    • id
      string
      required
      pattern: ^(?:user|extension)_[0-7][0-9a-hjkmnp-tv-z]{25}$
    • display_name
      string
      required
      minLength: 1
  • total
    integer
    required

    How many records the search holds at the revision read, on every page; on a branch, as of this request.

    maximum: 9007199254740991 · minimum: -9007199254740991
  • explain
    optional
    object
    • where
      required

      One of the following:

      • Option 1
      • null
    • sort
      array of
      object
      required
      • field
        string
        required
      • type
        string
        required
      • direction
        asc
        or
        desc
        required
      • nulls
        first
        or
        last
        required

400

InvalidCursor | InvalidRecordFilter | RecordSearchLimitExceeded | InvalidRequest | RequestBodyTooDeep
JSON

One of the following:

  • InvalidCursorEncoded
    • _tag
      InvalidCursor
      required
    • reason
      string
      required
      minLength: 1
  • InvalidRecordFilterEncoded
    • _tag
      InvalidRecordFilter
      required
    • problems
      array of
      object
      required
      • path
        array of
        required

        One of the following:

        • string
        • integer
      • reason
        string
        required
        minLength: 1
    • more_problems
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991
  • RecordSearchLimitExceededEncoded
    • _tag
      RecordSearchLimitExceeded
      required
    • limit
      nodes
      or
      depth
      or
      relation_hops
      or
      relations
      or
      list_values
      or
      text_value_bytes
      +1 more
      required
    • maximum
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991
    • actual
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991
  • InvalidRequestEncoded
    • _tag
      InvalidRequest
      required
    • part
      path
      or
      query
      or
      headers
      or
      body
      required
    • issues
      array of
      object
      required
      • path
        array of
        required

        One of the following:

        • string
        • integer
      • message
        string
        required
  • RequestBodyTooDeepEncoded
    • _tag
      RequestBodyTooDeep
      required
    • max_depth
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991

401

InvalidCredentials
JSON
  • _tag
    InvalidCredentials
    required

403

Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired
JSON

One of the following:

  • ForbiddenEncoded
    • _tag
      Forbidden
      required
    • message
      string
      required
  • ForbiddenOriginEncoded
    • _tag
      ForbiddenOrigin
      required
  • RequiresPersonalSessionEncoded
    • _tag
      RequiresPersonalSession
      required
  • RunBranchRequiredEncoded
    • _tag
      RunBranchRequired
      required
    • branch
      string
      required
      minLength: 1
    • message
      string
      required

404

CommitNotFound | CustomModelNotFound | RepoNotFound
JSON

One of the following:

  • CommitNotFoundEncoded
    • _tag
      CommitNotFound
      required
    • commit_id
      string
      required
      pattern: ^commit_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • CustomModelNotFoundEncoded
    • _tag
      CustomModelNotFound
      required
    • api_name
      string
      required
      minLength: 1
  • RepoNotFoundEncoded
    • _tag
      RepoNotFound
      required

413

RequestBodyTooLarge
JSON
  • _tag
    RequestBodyTooLarge
    required
  • max_bytes
    integer
    required
    maximum: 9007199254740991 · minimum: -9007199254740991

429

RateLimited
JSON
  • _tag
    RateLimited
    required

500

RepoFailure
JSON
  • _tag
    RepoFailure
    required
  • reason
    string
    required

503

SessionUnavailable | RateLimitUnavailable
JSON

One of the following:

  • SessionUnavailableEncoded
    • _tag
      SessionUnavailable
      required
  • RateLimitUnavailableEncoded
    • _tag
      RateLimitUnavailable
      required

Type to search…

↑↓ navigate↵ selectEsc close