> ## 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.

# List Test Definitions

> List all test definitions with optional filtering and pagination

# List Test Definitions

List all test definitions with optional filtering and pagination.

## Query Parameters

<ParamField query="limit" type="integer" default="10">
  Maximum number of results to return (max: 1000000).
</ParamField>

<ParamField query="before" type="string">
  Cursor for backward pagination.
</ParamField>

<ParamField query="after" type="string">
  Cursor for forward pagination.
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated list of fields to include: `owners`.
</ParamField>

<ParamField query="include" type="string" default="non-deleted">
  Include `all`, `deleted`, or `non-deleted` entities.
</ParamField>

<ParamField query="testPlatform" type="string">
  Filter by test platform (e.g., `OpenMetadata`).
</ParamField>

<ParamField query="entityType" type="string">
  Filter by entity type: `TABLE` or `COLUMN`.
</ParamField>

<ParamField query="supportedDataType" type="string">
  Filter by supported data type (e.g., `STRING`, `INT`, `DOUBLE`).
</ParamField>

<RequestExample dropdown>
  ```python GET /v1/dataQuality/testDefinitions theme={null}
  from metadata.sdk import configure
  from metadata.sdk.entities import TestDefinitions

  configure(
      host="https://your-company.open-metadata.org/api",
      jwt_token="your-jwt-token"
  )

  # List first page
  definitions = TestDefinitions.list(limit=50)
  for td in definitions.data:
      print(f"{td.name} ({td.entityType})")

  # List all with auto-pagination
  for td in TestDefinitions.list_all():
      print(f"{td.name}: {td.description}")

  # Filter by entity type
  column_defs = TestDefinitions.list(
      entityType="COLUMN",
      fields=["owners"],
      limit=50
  )

  for td in column_defs.data:
      print(f"{td.name} - supports: {td.supportedDataTypes}")
  ```

  ```java GET /v1/dataQuality/testDefinitions theme={null}
  import static org.openmetadata.sdk.fluent.TestDefinitions.*;

  // List first page
  var result = TestDefinitions.list()
      .limit(50)
      .execute();

  for (var td : result.getData()) {
      System.out.println(td.getName() + " (" + td.getEntityType() + ")");
  }

  // Filter by entity type
  var result = TestDefinitions.list()
      .entityType("COLUMN")
      .limit(50)
      .execute();
  ```

  ```bash GET /v1/dataQuality/testDefinitions theme={null}
  # List all
  curl "{base_url}/api/v1/dataQuality/testDefinitions?limit=50" \
    -H "Authorization: Bearer {access_token}"

  # Filter by entity type
  curl "{base_url}/api/v1/dataQuality/testDefinitions?entityType=COLUMN&limit=50" \
    -H "Authorization: Bearer {access_token}"

  # Filter by supported data type
  curl "{base_url}/api/v1/dataQuality/testDefinitions?supportedDataType=STRING&limit=50" \
    -H "Authorization: Bearer {access_token}"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "id": "a636d153-f1e8-45be-86d3-52aa6b71730d",
        "name": "columnValueLengthsToBeBetween",
        "displayName": "Column Value Lengths To Be Between",
        "fullyQualifiedName": "columnValueLengthsToBeBetween",
        "description": "This test definition validates that the lengths of column values are between a specified range...",
        "version": 0.1,
        "updatedAt": 1769982618104,
        "updatedBy": "admin",
        "testPlatforms": ["OpenMetadata"],
        "supportedDataTypes": ["STRING", "VARCHAR", "CHAR", "TEXT"],
        "parameterDefinition": [
          {
            "name": "minLength",
            "dataType": "INT",
            "required": false,
            "description": "The min length"
          },
          {
            "name": "maxLength",
            "dataType": "INT",
            "required": false,
            "description": "The max length"
          }
        ],
        "entityType": "COLUMN",
        "provider": "system",
        "deleted": false
      }
    ],
    "paging": {
      "after": "...",
      "total": 25
    }
  }
  ```
</ResponseExample>

***

## Returns

Returns a paginated list of test definition objects. Use the `fields` parameter to request additional data.

## Response

<ResponseField name="data" type="array">
  Array of test definition objects.

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Unique identifier for the test definition (UUID format).
    </ResponseField>

    <ResponseField name="name" type="string">
      Test definition name.
    </ResponseField>

    <ResponseField name="fullyQualifiedName" type="string">
      Fully qualified name (same as name for test definitions).
    </ResponseField>

    <ResponseField name="displayName" type="string">
      Human-readable display name.
    </ResponseField>

    <ResponseField name="description" type="string">
      Description of what the test validates.
    </ResponseField>

    <ResponseField name="entityType" type="string">
      Target entity type: `TABLE` or `COLUMN`.
    </ResponseField>

    <ResponseField name="testPlatforms" type="array">
      Supported test platforms (e.g., `OpenMetadata`).
    </ResponseField>

    <ResponseField name="supportedDataTypes" type="array">
      Data types this test can be applied to.
    </ResponseField>

    <ResponseField name="parameterDefinition" type="array">
      Parameters accepted by this test definition.

      <Expandable title="properties">
        <ResponseField name="name" type="string">
          Parameter name.
        </ResponseField>

        <ResponseField name="dataType" type="string">
          Data type of the parameter (e.g., `INT`, `STRING`, `BOOLEAN`).
        </ResponseField>

        <ResponseField name="required" type="boolean">
          Whether this parameter is required.
        </ResponseField>

        <ResponseField name="description" type="string">
          Description of the parameter.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="provider" type="string">
      Whether the definition is `system` (built-in) or `user` (custom).
    </ResponseField>

    <ResponseField name="owners" type="array" optional>
      List of owners. Only included when `fields` contains `owners`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="paging" type="object">
  Pagination information.

  <Expandable title="properties">
    <ResponseField name="total" type="integer">
      Total count of test definitions matching the query.
    </ResponseField>

    <ResponseField name="after" type="string" optional>
      Cursor for the next page of results.
    </ResponseField>

    <ResponseField name="before" type="string" optional>
      Cursor for the previous page of results.
    </ResponseField>
  </Expandable>
</ResponseField>

***

## Error Handling

| Code  | Error Type     | Description                                    |
| ----- | -------------- | ---------------------------------------------- |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token        |
| `403` | `FORBIDDEN`    | User lacks permission to list test definitions |
