Skip to main content
GET
https://sandbox.getcollate.io/api
/
v1
/
dataQuality
/
testDefinitions
/
{id}
GET /v1/dataQuality/testDefinitions/{id}
from metadata.sdk import configure
from metadata.sdk.entities import TestDefinitions

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# Get by ID
td = TestDefinitions.retrieve("a636d153-f1e8-45be-86d3-52aa6b71730d")
print(f"{td.name}: {td.description}")

# Get by ID with fields
td = TestDefinitions.retrieve(
    "a636d153-f1e8-45be-86d3-52aa6b71730d",
    fields=["owners"]
)

# Get by name
td = TestDefinitions.retrieve_by_name("columnValueLengthsToBeBetween")
print(f"Entity type: {td.entityType}")
print(f"Parameters: {[p.name for p in td.parameterDefinition]}")
{
  "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
}

Retrieve a Test Definition

Get a single test definition by its unique ID or name.

Get by ID

id
string
required
UUID of the test definition to retrieve.
fields
string
Comma-separated list of fields to include (e.g., owners).
include
string
default:"non-deleted"
Include all, deleted, or non-deleted entities.

Get by Name

Use GET /v1/dataQuality/testDefinitions/name/{name} to retrieve by name.
name
string
required
Name of the test definition (e.g., columnValueLengthsToBeBetween).
fields
string
Comma-separated list of fields to include: owners.
include
string
default:"non-deleted"
Include all, deleted, or non-deleted entities.
GET /v1/dataQuality/testDefinitions/{id}
from metadata.sdk import configure
from metadata.sdk.entities import TestDefinitions

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# Get by ID
td = TestDefinitions.retrieve("a636d153-f1e8-45be-86d3-52aa6b71730d")
print(f"{td.name}: {td.description}")

# Get by ID with fields
td = TestDefinitions.retrieve(
    "a636d153-f1e8-45be-86d3-52aa6b71730d",
    fields=["owners"]
)

# Get by name
td = TestDefinitions.retrieve_by_name("columnValueLengthsToBeBetween")
print(f"Entity type: {td.entityType}")
print(f"Parameters: {[p.name for p in td.parameterDefinition]}")
{
  "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
}

Returns

Returns a test definition object with all requested fields populated.

Response

id
string
Unique identifier for the test definition (UUID format).
name
string
Test definition name.
fullyQualifiedName
string
Fully qualified name (same as name for test definitions).
displayName
string
Human-readable display name.
description
string
Description of what the test validates.
entityType
string
Target entity type: TABLE or COLUMN.
testPlatforms
array
Supported test platforms.
supportedDataTypes
array
Data types this test can be applied to.
parameterDefinition
array
Parameters accepted by this test definition.
provider
string
Whether the definition is system (built-in) or user (custom).
version
number
Version number for the entity.
owners
array
List of owners. Only included when fields contains owners.

Error Handling

CodeError TypeDescription
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to view this test definition
404NOT_FOUNDTest definition with given ID or name does not exist