---
title: "Turn a sentence into a filter"
description: "Return the complete filter to apply, given the table's fields, visible example values, and existing filter; return a plain-word refusal when the sentence is not about narrowing rows."
canonical: "https://grid82.com/docs/app-api/filters/suggest"
updated: "2026-11-13"
---

# Turn a sentence into a filter

`POST https://your-suite.grid82.app/your-app/v1/tables/{tableId}/filters/suggest`

Return the complete filter to apply, given the table's fields, visible example values, and existing filter; return a plain-word refusal when the sentence is not about narrowing rows.

> **Note: Generic contract**
>
> Your own version of this operation, with your tables and the fields you can read, is in
> your app's document: `https://{suite}.grid82.app/{app}/v1/openapi.json`, behind your credential.
> [Why each person gets their own](/docs/start/studio-and-runtime#why-an-app-has-an-api-of-its-own).

This is a small model call, not the assistant, and costs credits.

Requires the `records:read` scope. Operation `filters.suggest`. MCP tool `filters_suggest`. CLI: `grid82 filters suggest` (`npx grid82`).

## Path parameters

| Name      | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `tableId` | string | yes      |             |

## Headers

| Name              | Type   | Required | Description                                                                                                                                                                                                                                                        |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Idempotency-Key` | string | no       | Any unique string. Sending the same key with the same request again returns the first response (marked `Idempotency-Replayed: true`) instead of running it twice. Reusing it for a different request is refused with 409. Kept for 24 hours. Up to 255 characters. |

## Request body

| Field      | Type             | Required | Description           |
| ---------- | ---------------- | -------- | --------------------- |
| `sentence` | string           | yes      | Up to 600 characters. |
| `current`  | FilterGroupInput | no       |                       |

**Authorizations**

- `Authorization` (bearer, in header, required)

## Response

**200**: Success

- `data` (`object`, required)
- `data.ok` (`boolean`, required)
- `data.filter` (`object`, required)
- `data.filter.id` (`string`, required, length: `1–64 chars`)
- `data.filter.kind` (`string`, required)
- `data.filter.mode` (`enum<string>`, required, one of: `and, or`)
- `data.filter.children` (`object[]`, required, items: `≤ 50 items`)
- `data.filter.children.id` (`string`, required, length: `1–64 chars`)
- `data.filter.children.kind` (`string`, required)
- `data.filter.children.fieldId` (`string`, required, pattern: `^[a-z][a-z0-9_]{0,62}$`)
- `data.filter.children.op` (`enum<string>`, required, one of: `contains, not_contains, starts_with, ends_with, is, is_not, is_empty, is_not_empty, gt, lt, gte, lte, before, after, on_or_before, on_or_after, is_any_of, is_none_of, has_any_of, has_all_of, has_none_of, is_checked, is_unchecked`)
- `data.filter.children.value` (`object`)

```json
{
  "data": {
    "ok": true,
    "filter": {
      "id": "<string>",
      "kind": "<string>",
      "mode": "and",
      "children": [
        {
          "id": "<string>",
          "kind": "<string>",
          "fieldId": "<string>",
          "op": "contains",
          "value": null
        }
      ]
    }
  }
}
```

**4XX**: Refused

- `error` (`object`, required)
- `error.code` (`enum<string>`, required, one of: `not_found, forbidden, unauthenticated, validation_failed, conflict, rate_limited, payment_required, not_implemented, internal`)
- `error.message` (`string`, required)
- `error.details` (`Record<string, unknown>`)

```json
{
  "error": {
    "code": "not_found",
    "message": "<string>",
    "details": {}
  }
}
```

**Example request**

```bash
curl --request POST \
  --url 'https://your-suite.grid82.app/your-app/v1/tables/<tableId>/filters/suggest' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "sentence": "<string>"
}'
```
