# Constraints

## Introduction

Similar to [Value Filters](/introduction/query-manipulation/value-filters.md), constraints are used to alter the query of a GET Request to fetch the required data for a specific use-case.

They are slightly different from [Value Filters](/introduction/query-manipulation/value-filters.md), as they enable the user to set constraints which are not aimed on a single field value but on relations or many fields.

{% hint style="info" %}
Every constraint can be combined with [Value Filters](/introduction/query-manipulation/value-filters.md) as seen below.
{% endhint %}

### Definition

* `{route}` - The endpoint you want to retrieve data of
* `?filter` - To identify the incoming URL parameter
* `[{constraint}]` - One of the constraints from the listing below
* `[{field}]` - The field (or relation field) on which the constraint should be applied
* `[{valueFilter}]` - (Optional) Field value filters for related entries
* `{value}` - Value depending on applied filters and constraints

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

## Doesn't Have

Constraint that manipulates the Query so that only the entries which doesn't have a relation to the given relation will get returned.

If you want to add a simple doesnt\_have constraint without further conditions on specific field values you can just pass the value `1`.

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

## Has

Constraint that manipulates the Query so that only the entries which have a relation to the given field will get returned.

If you want to add a simple has constraint without further conditions on specific field values you can just pass the value `1`.

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

## Where One Of

Constraint that manipulates the Query, so that only the entries which have a relation to one of the given fields, will get returned.

This can be combined with [Value Filters](/introduction/query-manipulation/value-filters.md) to add conditions on field values of the given relation keys.

Accepts a comma-separated list of relations.

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.api.intratool.de/introduction/query-manipulation/constraints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
