> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zangtable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filters and validation

> How list filters, bulk where clauses, and common validation rules work.

Filters are used anywhere you want ZangTable to select matching rows instead of working with every row in a table. The most common places are:

* Listing records, for example "only active recipes" or "orders for customer 42".
* Bulk updating records, for example "archive every draft older than January 1".
* Bulk deleting records, for example "delete rows where `deleted_at` is already set".
* Creating exports that include only matching rows.

## Shared validation

| Field                              | Rule                                                                                                  |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `{project}`                        | Project slug / Project ID: `^[a-z0-9_-]+$`, normalized to lowercase                                   |
| `{table}` / `{column}` / `{index}` | Names use `^[A-Za-z][A-Za-z0-9_]*$`; some endpoints also accept numeric IDs where documented          |
| `column_type`                      | `INTEGER`, `REAL`, `TEXT`, `BLOB`, `ANY`; omitted column types default to `TEXT`                      |
| Boolean-like fields                | booleans, integer `1`, or strings `1`, `true`, `yes`, `on` count as true; other values count as false |

## Simple filter object

Use this when every condition is an exact match.

```json theme={null}
{"status":"active","owner_id":42}
```

Common usage:

```bash theme={null}
curl "$BASE_URL/projects/$PROJECT/records/recipes?filters=%7B%22status%22%3A%22active%22%7D" \
  -H "Authorization: Bearer $ZANGTABLE_TOKEN"
```

## Condition array

Use this when you need operators like greater-than, `like`, `in`, or null checks.

```json theme={null}
[
  {"column":"status","op":"=","value":"active"},
  {"column":"created_at","op":">=","value":"2026-01-01"},
  {"column":"tag","op":"in","value":["dinner","dessert"]},
  {"column":"deleted_at","op":"is_null"}
]
```

Supported operators: `=`, `!=`, `>`, `>=`, `<`, `<=`, `like`, `in`, `is_null`, `not_null`.

## Bulk update example

```bash theme={null}
curl -X PATCH "$BASE_URL/projects/$PROJECT/records/recipes" \
  -H "Authorization: Bearer $ZANGTABLE_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{
    "data": {"status":"archived"},
    "where": [
      {"column":"status","op":"=","value":"draft"},
      {"column":"updated_at","op":"<","value":"2026-01-01"}
    ]
  }'
```

Use condition arrays for precise updates/deletes. Use the simple object format for everyday exact-match filtering.
