Skip to content

Sorting

Sorting of resources is defined in the JSON:API specification.

So let's take an example resource named Book. Let's assume it has the mandatory identifier id, an attribute title.

The following requests MAY be supported:

  • /books/?sort=id
  • /books/?sort=-name
  • /books/?sort=name,id

Info

When an endpoint supports sorting, it's explicitly mentioned in the documentation, along with supported attributes.