Skip to content

Sorting ​

Use the sort query parameter to control the order of results returned by the list endpoint.

Basic sorting ​

Sort by a single field in ascending order:

GET /v2/resources/posts?sort=title

Prefix with - for descending order:

GET /v2/resources/posts?sort=-created_at

Multi-field sorting ​

Sort by multiple fields using a comma-separated list. Priority follows the order of fields:

GET /v2/resources/posts?sort=-published_at,title

This sorts by published_at descending first, then by title ascending for resources with the same publication date.

Sortable fields ​

System fields ​

FieldDescription
created_atResource creation date
updated_atLast modification date
published_atPublication date

Blueprint fields ​

Any field defined in the blueprint can be used for sorting. Use the field's slug as the sort key:

GET /v2/resources/products?sort=-price
GET /v2/resources/posts?sort=title

Default sort ​

If no sort parameter is provided, results are sorted by created_at descending (newest first).

Diggama Documentation