# Filter Object

### AlertBoolExpression

This object represents `where` argument on the `alerts` node.

<table data-header-hidden><thead><tr><th width="150">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>Field</td><td>Type</td><td>Description</td></tr><tr><td>id</td><td><a href="/pages/-MYo89LEURUopkIrvgBC#idcomparisonexpression">IDComparisonExpression</a></td><td>Allows filtering <code>alerts</code> output by ID of the Alert entities</td></tr><tr><td>dataset</td><td><a href="/pages/-MYo89LEURUopkIrvgBC#stringcomparisonexpression">StringComparisonExpression</a></td><td>Allows filtering Alerts by <code>dataset</code></td></tr><tr><td>class</td><td><a href="/pages/-MYo89LEURUopkIrvgBC#alertclasscomparisonexpression">AlertClassComparisonExpression</a></td><td>Allows filtering Alerts by <code>class.code</code></td></tr><tr><td>company</td><td><a href="/pages/-MYo89LEURUopkIrvgBC#alertcompanycomparisonexpression">AlertCompanyComparisonExpression</a></td><td>Allows filtering Alerts by <code>company.id</code> or <code>relatedCompanies.id</code> (with logical "OR"). Alerts with <code>relatedCompanies</code> will be matched if any of the <code>relatedCompanies</code> matches the given comparison expression</td></tr><tr><td>resource</td><td><a href="#alertresourcecomparisonexpression">AlertResourceComparisonExpression</a></td><td>Allows filtering Alerts by <code>resource.id</code> and <code>resource.type</code></td></tr><tr><td>polarity</td><td><a href="#intcomparisonexpression">IntComparisonExpression</a></td><td>Allows filtering Alerts by the value of <code>polarity</code> field </td></tr><tr><td>publishedAt</td><td><a href="/pages/-MYo89LEURUopkIrvgBC#datecomparisonexpression">DateComparisonExpression</a></td><td>Allows chronological filtering of Alerts</td></tr></tbody></table>

### IDComparisonExpression

| Field | Type   | Description                                                     |
| ----- | ------ | --------------------------------------------------------------- |
| eq    | ID     | When specified, API will return Alert with this particular id   |
| in    | \[ID!] | Allows fetching a set of Alerts by a given array of identifiers |

### StringComparisonExpression

| Field | Type       | Description                                                                        |
| ----- | ---------- | ---------------------------------------------------------------------------------- |
| eq    | String     | Will match values exactly equal to the given one                                   |
| in    | \[String!] | Will match values from the given array, using the same comparison as `eq` operator |
| nin   | \[String!] | Inversion of the `in` operator                                                     |

### IntComparisonExpression <a href="#intcomparisonexpression" id="intcomparisonexpression"></a>

| Field  | Type    | Description                                                                        |
| ------ | ------- | ---------------------------------------------------------------------------------- |
| eq     | Int     | Will match values exactly equal to the given one                                   |
| neq    | Int     | Will match values that are strictly not equal to the given one                     |
| gt     | Int     | Will match values that are greater than the given  one                             |
| gte    | Int     | Will match values that are greater or equal to the given one                       |
| lt     | Int     | Will match values that are less than the given value                               |
| lte    | Int     | Will match values that are less than or equal to the given one                     |
| in     | \[Int!] | Will match values from the given array, using the same comparison as `eq` operator |
| nin    | \[Int!] | Inversion of the `in` operator                                                     |
| isNull | Boolean | Will match values testing their equality to `null`                                 |

### AlertClassComparisonExpression

| Field | Type                       | Description                                                        |
| ----- | -------------------------- | ------------------------------------------------------------------ |
| code  | StringComparisonExpression | Will match Alerts where the given value matches Alert's class code |

### AlertCompanyComparisonExpression

<table data-header-hidden><thead><tr><th width="150">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>Field</td><td>Type</td><td>Description</td></tr><tr><td>id</td><td>IDComparisonExpression</td><td>Will match Alerts where Company ID matches the given expression</td></tr></tbody></table>

### AlertResourceComparisonExpression

<table data-header-hidden><thead><tr><th width="150">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>Field</td><td>Type</td><td>Description</td></tr><tr><td>id</td><td>StringComparisonExpression</td><td>Will match Alerts where Resource ID matches the given expression</td></tr><tr><td>type</td><td>StringComparisonExpression</td><td>Will match Alerts where Resource Type matches the given expression</td></tr></tbody></table>

### DateComparisonExpression

All the values must be specified using ISO 8601 date or date with time formats.

| Field | Type       | Description                                                                                                                          |
| ----- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| eq    | String     | Will match values with a date matching the given value exactly. Please, be aware that "2021-01-01" is equal to "2021-01-01T00:00:00" |
| neq   | String     | Inversion of the `eq` field                                                                                                          |
| gt    | String     | Will match values greater than given one                                                                                             |
| gte   | String     | Will match values greater than or equal to the given one                                                                             |
| lt    | String     | Will match values less than given one                                                                                                |
| lte   | String     | Will match values less than or equal to the given one                                                                                |
| in    | \[String!] | Will match values from the given array, using the same comparison as `eq` operator                                                   |
| nin   | \[String!] | Inversion of the `in` field                                                                                                          |


---

# 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.craft.co/alerts-api/alerts-api-reference/filter-object.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.
