---
title: "Turn a sentence into a filter, as the builder"
description: "Generate a complete filter to apply from the table's fields, example values, and current filter, or return a plain-language refusal."
canonical: "https://grid82.com/docs/builder-api/data/filters-suggest"
updated: "2026-11-13"
---

# Turn a sentence into a filter, as the builder

`POST https://studio.grid82.app/v1/apps/{appId}/tables/{tableId}/filters/suggest`

Generate a complete filter to apply from the table's fields, example values, and current filter, or return a plain-language refusal.

Costs the organisation credits.

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

## Path parameters

| Name      | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `appId`   | string | yes      |             |
| `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`  | FilterGroup | 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://studio.grid82.app/v1/apps/<appId>/tables/<tableId>/filters/suggest' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "sentence": "<string>"
}'
```
