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

# Update a Test Case

> Create or update a test case with a full request body

# Update a Test Case

Create a test case or update it if it already exists, using `PUT /v1/dataQuality/testCases` with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use `PATCH` with a JSON Patch array and the `application/json-patch+json` content type, as shown in the PATCH examples below.

## Body Parameters

**name** `string` *required*

Name of the test case. Must be unique within the target entity scope.

**testDefinition** `string` *required*

Fully qualified name (FQN) of the test definition to use. For example, `columnValueMaxToBeBetween`.

**entityLink** `string` *required*

Entity link to the target table or column. Format: `<#E::table::tableFQN>` for table-level or `<#E::table::tableFQN::columns::colName>` for column-level.

**parameterValues** `array`

Array of parameter name/value pairs as defined by the test definition.

**properties**

**name** `string` *required*

Parameter name. Must match a parameter in the test definition.

**value** `string` *required*

Parameter value. Always provide it as a string.

**description** `string`

Description of the test case in Markdown format.

**displayName** `string`

Human-readable display name for the test case.

**reviewers** `array`

Array of reviewer references (users or teams). Each item accepts the same fields as `owners`.

**computePassedFailedRowCount** `boolean`

Compute the passed and failed row count for the test case. Defaults to `false`.

**useDynamicAssertion** `boolean`

Use dynamic assertion to evaluate the test case, if the test definition supports it. Defaults to `false`.

**dimensionColumns** `array`

Names of the columns to group test results by. When set, the test runs overall and grouped by these columns. Defaults to `[]`.

**topDimensions** `integer`

Number of top dimension values to show before the rest are grouped as `Others`. Accepts 1 to 50. Defaults to 5.

**dataQualityDimension** `string`

Name of the data quality dimension for this test case. Defaults to the dimension of the test definition. Accepts a built-in dimension or any custom dimension registered in **Settings** > **Preferences** > **Data Quality**.

**owners** `array`

Array of owner references (users or teams) to assign.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Owner entity type, such as `user` or `team`.

**name** `string`

Name of the owner entity.

```bash PUT /v1/dataQuality/testCases theme={null}
curl -X PUT "{base_url}/api/v1/dataQuality/testCases" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "column_value_max_to_be_between",
    "testDefinition": "columnValueMaxToBeBetween",
    "entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::shop_id>",
    "parameterValues": [
      {"name": "minValueForMaxInCol", "value": "1"},
      {"name": "maxValueForMaxInCol", "value": "100"}
    ],
    "description": "Validates shop_id max value stays between 1 and 100"
  }'
```

```python PATCH /v1/dataQuality/testCases/{id} theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import TestCases

configure(
    host="https://your-company.open-metadata.org/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.root}")
```

```java PATCH /v1/dataQuality/testCases/{id} theme={null}
// client is an initialized OpenMetadataClient.
var testCaseId = "c1bce355-fa2f-48c6-ab4d-fad722a56ed7";
var testCase = client.testCases().get(testCaseId);
testCase.setDescription("Updated: Validates shop_id max value stays between 1 and 200");

var updated = client.testCases().update(testCaseId, testCase);
```

```bash PATCH /v1/dataQuality/testCases/{id} theme={null}
# Update by ID
curl -X PATCH "{base_url}/api/v1/dataQuality/testCases/c1bce355-fa2f-48c6-ab4d-fad722a56ed7" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Updated: Validates shop_id max value stays between 1 and 200"},
    {"op": "replace", "path": "/parameterValues", "value": [{"name": "minValueForMaxInCol", "value": "1"}, {"name": "maxValueForMaxInCol", "value": "200"}]}
  ]'

# Update by name
curl -X PATCH "{base_url}/api/v1/dataQuality/testCases/name/sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Updated description"}
  ]'
```

```json Response theme={null}
{
  "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

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid or malformed request body |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to update this test case |
| `409` | `CONFLICT` | Concurrent modification detected |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.