Skip to content

Sorting

The order or direction to sort results by.

ValueDescription
ascAscending order
descDescending order

A JSON example of this model is:

"asc"

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

An example URL using these parameters:

/common-grants/opportunities?sortBy=lastModifiedAt&sortOrder=asc

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 is:

Sorting by a protocol-defined field:

{
"sortBy": "lastModifiedAt",
"sortOrder": "asc"
}

Sorting by an implementation-defined field:

{
"sortBy": "custom",
"customSortBy": "customField",
"sortOrder": "asc"
}

Information about the sort order of the items returned. This model should be used to represent the sorting details in responses.

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 is:

{
"sortBy": "lastModifiedAt",
"customSortBy": "customField",
"sortOrder": "asc"
}