Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

List Records Input

Record data to query for a list view.
Example
This example uses a request body to query a list view named All Accounts.
1POST /services/data/v67.0/ui-api/list-records/Account/AllAccounts
1{
2  "fields": ["Name", "Type", "AnnualRevenue", "CreatedDate"],
3  "pageSize" : 10,
4  "sortBy": ["CreatedDate"],
5  "searchTerm" : "United",
6  "where": "{AnnualRevenue: { gt: 1000000}}"
7}
This example uses the special __Recent list view API name to get the record data for the most recently used (MRU) list view for accounts.
1POST /services/data/v67.0/ui-api/list-records/Account/__Recent
Properties
Name Type Description Required or Optional Available Version
fields String[] Additional fields queried for the records returned. These fields don’t create visible columns. If the field isn’t available to the user, an error occurs. Optional 61.0
optionalFields String[] Additional fields queried for the records returned. These fields don’t create visible columns. If the field isn’t available to the user, no error occurs and the field isn’t included in the records. Optional 61.0
pageSize Integer The number of list records viewed at one time. The default value is 50. Value can be 1–2000. Optional 61.0
pageToken String A token that represents the page offset. To indicate where the page starts, use this value with the pageSize parameter. The maximum offset is 2000 and the default is 0. Optional 61.0
searchTerm String Search term to filter the results. Wildcards are supported. Optional 61.0
sortBy String[] The API names of the fields the list view is sorted by. If the name is preceded with -, the sort order is descending. For example, Name sorts by name in ascending order. -CreatedDate sorts by created date in descending order.

In API version 63.0 and later, you can sort by up to five fields.

Optional 61.0
where String The filter applied to returned records, in GraphQL syntax. For example, { and: [ { StageName: { eq: \"Prospecting\" } }, { Account: { Name: { eq: \"Dickenson plc\" } } } ] } filters an Opportunity related list to show only opportunities in the Prospecting stage that are linked to the “Dickenson plc” account. Optional 61.0