# Metafield definition validations

> A standalone resource for the validation rules attached to a metafield definition.

A **Metafield definition validation** is a single **validation rule** on a [Metafield definition](/api/product-management/metafield-definitions/) - for example "max length 500". It references the `metafieldDefinition` it belongs to, a `name` (the [validation type](/api/product-management/metafield-definition-validation-types/)), and a `value` (the rule's parameter).

The same rules also appear inline as the `validations` array on a definition. This resource lets you manage them **individually** - create, update or delete one rule without rewriting the whole definition.

The `name` must be one of the types that are compatible with the definition's data type - see [Type compatibility](/api/product-management/metafield-definitions/#type-compatibility). An incompatible rule is rejected with `422`.

## The Metafield definition validation object

## Conventions

All requests require an OAuth 2.0 bearer token and the organization scope header:

```
Authorization: Bearer <token>
X-Flowkiwi-Organization-Id: <organization-id>
```

`PATCH` uses [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7396) with `Content-Type: application/merge-patch+json`.
