# ContentId Sort Clause

> For the complete documentation index, see [llms.txt](https://doc.ibexa.co/en/saas/llms.txt).

ContentId Sort Clause

The `ContentId` Sort Clause sorts search results by the content items' IDs.

## Arguments

- (optional) sorting direction, either `ascending` (default) or `descending`

## Example

You can use this Sort Clause over the REST API, in the `SortClauses` element of the payload of the [`POST /views`](https://doc.ibexa.co/en/saas/api/rest_api/rest_api_reference/rest_api_reference.html#tag/Views/operation/ibexa.rest.views.create) request:

**XML**

```xml
<Query>
    <SortClauses>
        <ContentId>ascending</ContentId>
    </SortClauses>
</Query>
```

**JSON**

```json
"Query": {
    "SortClauses": {
        "ContentId": "ascending"
    }
}
```
