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

# Classification

> Restrict a field to a set of categories.

The **Classification** formatter restricts a field to a list of categories you define. It is how you keep a field like document type or status to a fixed vocabulary that downstream systems can rely on.

Common uses are document type (`Invoice`, `Receipt`, `Credit note`) and yes/no states (`Signed`, `Not signed`).

## Options

| Option | What it does |
| - | - |
| **Categories** | The allowed values. Each one can be given a description, which tells the model what belongs in that category. |
| **Default value** | A category to fall back on when the extracted value is not one of the others. Optional. |

Descriptions are worth filling in when the category name alone is ambiguous. For a `Credit note` category, a description such as *"a negative invoice that refunds an earlier one"* gives the model something to go on.

## How values are handled

| Extracted value | Without a default value | With default value `Unknown` |
| - | - | - |
| `Invoice` — an exact category | `Invoice` | `Invoice` |
| `Faktura` — not a category | Error, field cleared | `Unknown` |

Matching is exact, so the value must be one of the categories as written. If you also need to fold variations and spellings into a category, use [Match & Map](/core-concepts/ai-model/match-and-map), which does fuzzy matching.

## When it fails

Without a default value, a value outside the category list clears the field and reports an error listing the allowed categories, which sends the document to human review. With a default value set, nothing fails — unrecognized values become the default, so make sure that is what you want before setting one.
