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

# Test Definitions

> Define reusable data quality validation rules for tables and columns

# Test Definitions

A **Test Definition** describes a reusable data quality validation rule. It defines what to check, what parameters it accepts, and which data types it supports.

<Info>
  OpenMetadata ships with 25+ built-in test definitions. You can also create custom test definitions for organization-specific validations.
</Info>

## Built-in vs Custom

* **Built-in** test definitions are provided by the system (`provider: "system"`) and cover common checks like null counts, value ranges, and uniqueness.
* **Custom** test definitions are created via the API for organization-specific validation logic.

## Entity Type

Each test definition targets either a **table** or a **column**:

| Entity Type | Description                       | Example                   |
| ----------- | --------------------------------- | ------------------------- |
| `TABLE`     | Validates table-level properties  | Row count between X and Y |
| `COLUMN`    | Validates column-level properties | Column values match regex |

## Fully Qualified Name

The FQN for a test definition is simply its name:

```
columnValueLengthsToBeBetween
```

***

## API Endpoints

| Method | Endpoint                                      | Description                                                                                    |
| ------ | --------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `POST` | `/v1/dataQuality/testDefinitions`             | [Create a custom test definition](/v1.12.x/api-reference/data-quality/test-definitions/create) |
| `GET`  | `/v1/dataQuality/testDefinitions`             | [List test definitions](/v1.12.x/api-reference/data-quality/test-definitions/list)             |
| `GET`  | `/v1/dataQuality/testDefinitions/{id}`        | [Get by ID](/v1.12.x/api-reference/data-quality/test-definitions/retrieve)                     |
| `GET`  | `/v1/dataQuality/testDefinitions/name/{name}` | [Get by name](/v1.12.x/api-reference/data-quality/test-definitions/retrieve)                   |
