Skip to main content

Sorting responses

Many list endpoints in the API allow you to sort the results based on specific fields using the order query parameter. The syntax for the order parameter is a comma-separated list of fields, where each field can optionally be followed by a sort direction. The available fields for sorting vary depending on the endpoint.

  • To sort in ascending order (default), simply provide the field name:

    ?order=name
  • To sort in descending order, append ,DESC to the field name:

    ?order=severity,DESC

You can also sort by multiple fields. The results will be sorted by the first field, and then by subsequent fields if there are ties:

?order=ipAddress,ASC,port,DESC
info

The API reference section of the documentation includes a comprehensive list of the fields you can sort for each endpoint.