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

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

# Get by ID
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
print(f"{tc.fullyQualifiedName}: {tc.entityLink}")

# Get by ID with fields
tc = TestCases.retrieve(
    "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
    fields=["owners", "testDefinition", "testCaseResult"]
)

# Get by fully qualified name
tc = TestCases.retrieve_by_name(
    "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between"
)

# Get by name with fields
tc = TestCases.retrieve_by_name(
    "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
    fields=["testCaseResult", "testDefinition"]
)
{
  "id": "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
  "name": "column_value_max_to_be_between",
  "fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
  "version": 0.1,
  "updatedAt": 1769982759035,
  "updatedBy": "admin",
  "testDefinition": {
    "id": "def-id",
    "type": "testDefinition",
    "name": "columnValueMaxToBeBetween",
    "fullyQualifiedName": "columnValueMaxToBeBetween",
    "deleted": false
  },
  "testSuite": {
    "id": "suite-id",
    "type": "testSuite",
    "name": "b5fcae09-02c2-4c0b-8c4a-5b52d650e592",
    "deleted": false
  },
  "entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
  "parameterValues": [
    {"name": "minValueForMaxInCol", "value": "1"},
    {"name": "maxValueForMaxInCol", "value": "100"}
  ],
  "deleted": false,
  "owners": []
}

Retrieve a Test Case

Get a single test case by its unique ID or fully qualified name.

Get by ID

id
string
required
UUID of the test case to retrieve.
fields
string
Comma-separated list of fields to include: owners, testSuite, testDefinition, testCaseResult.
include
string
default:"non-deleted"
Include all, deleted, or non-deleted entities.

Get by Fully Qualified Name

Use GET /v1/dataQuality/testCases/name/{fqn} to retrieve by fully qualified name.
fqn
string
required
Fully qualified name of the test case (e.g., sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between).
fields
string
Comma-separated list of fields to include: owners, testSuite, testDefinition, testCaseResult.
include
string
default:"non-deleted"
Include all, deleted, or non-deleted entities.
GET /v1/dataQuality/testCases/{id}
from metadata.sdk import configure
from metadata.sdk.entities import TestCases

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

# Get by ID
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
print(f"{tc.fullyQualifiedName}: {tc.entityLink}")

# Get by ID with fields
tc = TestCases.retrieve(
    "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
    fields=["owners", "testDefinition", "testCaseResult"]
)

# Get by fully qualified name
tc = TestCases.retrieve_by_name(
    "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between"
)

# Get by name with fields
tc = TestCases.retrieve_by_name(
    "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
    fields=["testCaseResult", "testDefinition"]
)
{
  "id": "c1bce355-fa2f-48c6-ab4d-fad722a56ed7",
  "name": "column_value_max_to_be_between",
  "fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between",
  "version": 0.1,
  "updatedAt": 1769982759035,
  "updatedBy": "admin",
  "testDefinition": {
    "id": "def-id",
    "type": "testDefinition",
    "name": "columnValueMaxToBeBetween",
    "fullyQualifiedName": "columnValueMaxToBeBetween",
    "deleted": false
  },
  "testSuite": {
    "id": "suite-id",
    "type": "testSuite",
    "name": "b5fcae09-02c2-4c0b-8c4a-5b52d650e592",
    "deleted": false
  },
  "entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
  "parameterValues": [
    {"name": "minValueForMaxInCol", "value": "1"},
    {"name": "maxValueForMaxInCol", "value": "100"}
  ],
  "deleted": false,
  "owners": []
}

Returns

Returns a test case object with all requested fields populated.

Response

id
string
Unique identifier for the test case (UUID format).
name
string
Test case name.
fullyQualifiedName
string
Fully qualified name of the test case.
Entity link to the target table or column.
testDefinition
object
Reference to the test definition.
testSuite
object
Reference to the test suite.
parameterValues
array
Parameter values for this test case.
testCaseResult
object
Most recent test result. Only included when fields contains testCaseResult.
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 case
404NOT_FOUNDTest case with given ID or FQN does not exist