Skip to main content
The sort query is encoded JSON to sort resources on list requests. For any property, the options are asc (ascending) and desc (descending). For nulls, the options are first and last.
{
    "updatedAt": { 
        "sort": "asc", 
        "nulls": "last" 
    }
}
GET https://api.obselite.com/v0/labels?sort=%7B%22updatedAt%22%3A%7B%22sort%22%3A%22asc%22%2C%22nulls%22%3A%22last%22%7D%7D
By default, lists are sorted by createdAt in descending order. Relationships are not sorted.

Relationships

You can sort by the properties of a related resource. For example, the following query sorts by the author’s email address:
{
    "author": {
        "email": "asc"
    }
}

Relation aggregate value

Sort by the count of related resources with the _count property:
{
    "tickets": {
        "_count": "desc"
    }
}