> ## Documentation Index
> Fetch the complete documentation index at: https://api.contractorscloud.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Filtering and sorting

> Narrow and order list results with filter and sort query parameters.

List endpoints accept `filter` and `sort` query parameters to narrow and order results. Each endpoint defines its own set of allowed filters and sortable fields, listed on the endpoint's reference page.

## Filtering

Apply a filter with the `filter[<field>]=<value>` syntax. Repeat the parameter to combine filters; results must match every filter you supply.

```bash theme={null}
curl "https://api.contractorscloud.com/api/v1/users?filter[status]=1&filter[search]=jane" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
```

The request above returns active users matching the search term `jane`. Most filters match exactly, while some, such as `search`, match fuzzily across several fields. Exact-match filters also accept a comma-separated list of values to match any of them, for example `filter[id]=12,34,56`. Each endpoint's reference page lists its filters and how each one matches.

## Sorting

Order results with the `sort` parameter. Prefix a field with `-` for descending order. Sort by multiple fields by separating them with commas; results are ordered by each field in turn.

```bash theme={null}
# Sort by last name, ascending
?sort=last_name

# Sort by status descending, then by last name ascending
?sort=-status,last_name
```

Each endpoint documents the fields you can sort by and its default sort order.

> [!TIP]
>
> Combine filters and sorts with [pagination](https://api.contractorscloud.com/docs/pagination.md) to page through a focused, predictably ordered result set.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.