Skip to content

Metafield definition validations

View as Markdown

A Metafield definition validation is a single validation rule on a Metafield definition - for example “max length 500”. It references the metafieldDefinition it belongs to, a name (the validation type), 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. An incompatible rule is rejected with 422.

The Metafield definition validation object

Section titled “The Metafield definition validation object”
PropertyTypeRequiredDescription
idstring-The resource's unique identifier (UUID).
metafieldDefinitionstringrequiredThe metafield definition this validation belongs to
namestringrequiredThe type of validation rule
valuestringrequiredThe validation parameter value. Format depends on the validation type.

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 with Content-Type: application/merge-patch+json.