Skip to content

Sorting

Sorting is layered on top of pagination. A request specifies the field to sort by and a direction; the response carries the resolved sort key back so clients can verify or display it.

Query parameters for sorting.

PropertyTypeRequiredDescription
sortByunknownYesThe field to sort by.
customSortBystringNoImplementation-defined sort key.
sortOrderSortOrderNoThe order to sort by.
{
"sortBy": "lastModifiedAt",
"customSortBy": "customField",
"sortOrder": "asc"
}

Sorting parameters included in the request body.

PropertyTypeRequiredDescription
sortByunknownYesThe field to sort by.
customSortBystringNoImplementation-defined sort key.
sortOrderSortOrderNoThe order to sort by.
{
"sortBy": "lastModifiedAt",
"customSortBy": "customField",
"sortOrder": "asc"
}

Information about the sort order of the items returned.

PropertyTypeRequiredDescription
sortBystringYesThe field results are sorted by, or "custom" if an implementation-defined sort key is used.
customSortBystringNoImplementation-defined sort key used to sort the results, if applicable.
sortOrderSortOrderYesThe order in which the results are sorted (ascending or descending).
errorsstring[]NoNon-fatal errors that occurred during sorting.
{
"sortBy": "lastModifiedAt",
"customSortBy": "customField",
"sortOrder": "asc",
"errors": [
"string"
]
}

Direction in which to sort a list of items.

ValueDescription
ascAscending order (A→Z, 0→9, oldest→newest).
descDescending order (Z→A, 9→0, newest→oldest).
"asc"