Skip to main content

Sorting

Notation follows the APIs index.

APIs that support sorting MUST do so using a single query parameter named sort whose value is a comma-delimited list of field names to sort by. Any field preceded by a hyphen MUST be interpreted as descending.

Examples

ExampleDescription
sort=nameSort by the user's name ascending.
sort=-nameSort by the user's name descending.
sort=name,emailSort by the user's name and then by email.
sort=name,-creationDateSort by the user's name and then by most recently created first.

The sort parameter is credited to JSON:API.