Sorting the list of objects

When you request a list of objects using the GET method, you can specify the parameters to sort the list by. Sorting is set in the request using the sort query parameter.

Note. Lists of objects support various sorting options. For more information about the parameters, see the GET request description for each object.
  1. Sorting direction
  2. Sorting by multiple parameters

Sorting direction

You can sort values in ascending or descending order.

For example, when using sort=id, the list is sorted by identifier values in ascending order. To change the sorting direction to descending, add a hyphen before the parameter: sort=-id.

Sorting by multiple parameters

When sorting, you can use one or multiple parameters at once. Simply specify them separated by a comma: param1,param2.

Note. The order of parameters affects the sorting sequence.

For example, when using sort=param1,param2, the list is sorted in ascending order by the param1 values first, and then by the param2 values. To change the sorting sequence, switch the parameters around: sort=param2,param1.