Skip to main content
PATCH
https://sandbox.getcollate.io/api
/
v1
/
dataQuality
/
testCases
/
{id}
PATCH /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"
)

# Retrieve, modify, and update
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
tc.description = "Updated: Validates shop_id max value stays between 1 and 200"
tc.parameterValues = [
    {"name": "minValueForMaxInCol", "value": "1"},
    {"name": "maxValueForMaxInCol", "value": "200"}
]
updated = TestCases.update(tc)

print(f"Updated to version {updated.version}")
{
  "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",
  "description": "Updated: Validates shop_id max value stays between 1 and 200",
  "version": 0.2,
  "updatedAt": 1769982800000,
  "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": "200"}
  ],
  "deleted": false,
  "owners": []
}

Update a Test Case

Update a test case’s properties using JSON Merge Patch. You can update by ID or by fully qualified name.

Update by ID

id
string
required
UUID of the test case to update.

Update by Name

Use PATCH /v1/dataQuality/testCases/name/{fqn} to update by fully qualified name.
fqn
string
required
Fully qualified name of the test case.

Body Parameters

Send a JSON object with the fields to update. Only provided fields are changed.
description
string
Updated description in Markdown format.
parameterValues
array
Updated parameter values.
owners
array
Updated list of owner references.
PATCH /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"
)

# Retrieve, modify, and update
tc = TestCases.retrieve("c1bce355-fa2f-48c6-ab4d-fad722a56ed7")
tc.description = "Updated: Validates shop_id max value stays between 1 and 200"
tc.parameterValues = [
    {"name": "minValueForMaxInCol", "value": "1"},
    {"name": "maxValueForMaxInCol", "value": "200"}
]
updated = TestCases.update(tc)

print(f"Updated to version {updated.version}")
{
  "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",
  "description": "Updated: Validates shop_id max value stays between 1 and 200",
  "version": 0.2,
  "updatedAt": 1769982800000,
  "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": "200"}
  ],
  "deleted": false,
  "owners": []
}

Returns

Returns the updated test case object with the new version number.

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.
description
string
Updated description.
version
number
Incremented version number.

Error Handling

CodeError TypeDescription
400BAD_REQUESTInvalid JSON patch or malformed request
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to update this test case
404NOT_FOUNDTest case with given ID or FQN does not exist
409CONFLICTConcurrent modification detected