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

# Filtering Results in TeamCare API Requests

> Use the q parameter (a JSON object) in the request body to filter TeamCare API results by date ranges, string values, or array membership.

TeamCare APIs support flexible filtering through a `q` parameter sent in the request body. The `q` parameter is a JSON object that lets you narrow results using comparisons, ranges, and text matching.

## Supported filter specifiers

| Specifier | Meaning                  | Example     |
| --------- | ------------------------ | ----------- |
| `gt`      | Greater than             | `date_gt`   |
| `lt`      | Less than                | `date_lt`   |
| `gteq`    | Greater than or equal to | `date_gteq` |
| `lteq`    | Less than or equal to    | `date_lteq` |
| `in`      | Included in array        | `status_in` |
| `cont`    | Contains (text)          | `name_cont` |
| `eq`      | Equals (exact match)     | `code_eq`   |

Use the date specifiers for filtering by date or numeric ranges. Use `in` to match against an array of allowed values. Use `cont` for partial string matches and `eq` for exact matches.

## Filtering appointments by date range

The example below filters appointments to return only those scheduled between January 1, 2024, and January 31, 2024.

```json theme={null}
{
  "q": {
    "date_gteq": "2024-01-01",
    "date_lteq": "2024-01-31"
  }
}
```

Include this JSON object in the request body when calling endpoints that support filtering, such as `/appointments`, `/patients`, `/treatments`, `/ledger/transactions`, and `/patients/referrals`.

<Tip>
  Combine multiple specifiers in the same `q` object to create precise filters.
</Tip>
