> For the complete documentation index, see [llms.txt](https://docs.api.intratool.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.intratool.de/introduction/query-manipulation/constraints.md).

# Constraints

Constraints filter `GET` results by the existence or contents of relations. Unlike [Value Filters](/introduction/query-manipulation/value-filters.md), they operate on relation-level conditions instead of comparing only one field value.

All constraints use the `filter` query parameter and can be combined with value filters.

{% hint style="info" %}
Relation constraints and Value Filters can be combined in the same request.
{% endhint %}

## Syntax

* `{route}` - Endpoint from which records are retrieved.
* `?filter` - Query parameter containing the constraint.
* `[{constraint}]` - Constraint key documented below.
* `[{field}]` - Relation or relation field to which the constraint applies.
* `[{valueFilter}]` - Optional Value Filter for related records.
* `{value}` - Value required by the selected constraint or filter.

<mark style="color:green;">`GET`</mark> `/api/{route}?filter[{constraint}][{field}][{valueFilter}]={value}`

## Does Not Have

The `doesnt_have` constraint returns records that do not have the specified relation.

Pass `1` when no additional field condition is required.

<mark style="color:green;">`GET`</mark> `/api/{route}?filter[doesnt_have][{field}]={value}`

## Has

The `has` constraint returns records that have the specified relation.

Pass `1` when no additional field condition is required.

<mark style="color:green;">`GET`</mark> `/api/{route}?filter[has][{field}]={value}`

## Where One of

The `where_one_of` constraint returns records that have at least one of the specified relations.

Pass the relations as a comma-separated list. Value Filters can add field conditions for the affected relations.

<mark style="color:green;">`GET`</mark> `/api/{route}?filter[where_one_of][{fields}]={value}`
