Skip to content

Sorting

The order or direction to sort results by.

ValueDescription
ascAscending order (e.g., low to high or A to Z)
descDescending order (e.g., high to low or Z to A)

A JSON example of this model.

"asc"
Version Changes
0.1.0
  • Added SortOrder enum

Query parameters for sorting. These parameters should be used on GET routes that support sorting.

ParameterTypeDescription
sortByunknownThe field to sort by, should be an enum for individual routes
customSortBystringAn implementation-defined sort key
sortOrderSortOrderThe order to sort by

A JSON example of this model.

{
"sortBy": "lastModifiedAt",
"customSortBy": "customField",
"sortOrder": "asc"
}
Version Changes
0.1.0
  • Added SortQueryParams model

Body parameters for sorting. These parameters should be used on POST and PUT routes that support sorting.

ParameterTypeDescription
sortByunknownThe field to sort by, should be an enum for individual routes
customSortBystringAn implementation-defined sort key
sortOrderSortOrderThe order to sort by

A JSON example of this model.

{
"sortBy": "lastModifiedAt",
"customSortBy": "customField",
"sortOrder": "asc"
}
Version Changes
0.1.0
  • Added SortBodyParams model

Information about the sort order of the items returned. This model should be included in responses that support sorting.

ParameterTypeDescription
sortBystringThe field to sort by
customSortBystringAn implementation-defined sort key
sortOrderSortOrderThe order to sort by
errorsArray<string>The errors that occurred during sorting

A JSON example of this model.

{
"sortBy": "lastModifiedAt",
"sortOrder": "asc",
"customSortBy": "customField",
"errors": [
"Sample string value"
]
}
Version Changes
0.1.0
  • Added SortedResultsInfo model