> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcollate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate & Results

> Validate data contracts and manage execution results

# Validate & Results

Run on-demand validation of data contracts and manage execution results. Validation checks schema compliance, semantics rules, quality expectations, and SLA targets.

## Validate a Contract

Trigger on-demand validation of a data contract. Returns a `DataContractResult` with status for each validation dimension.

`POST /v1/dataContracts/{id}/validate`

**id** `string` *required*

UUID of the data contract.

## Validate by Entity

Validate the effective contract for a specific entity. If the entity only has an inherited contract from a data product, a local contract is materialized to store results.

`POST /v1/dataContracts/entity/validate`

**entityId** `string` *required*

UUID of the entity.

**entityType** `string` *required*

Type of the entity, for example `table`, `topic`.

```python POST /v1/dataContracts/{id}/validate theme={null}
from metadata.sdk import client, configure
from metadata.sdk.entities import DataContracts

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

# Validate a specific contract
result = rest.post("/dataContracts/f7a1b2c3-d4e5-6789-0abc-def123456789/validate")
print(f"Status: {result['contractExecutionStatus']}")

# Validate by entity
result = DataContracts.validate_by_entity(
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "table"
)
print(f"Status: {result.contractExecutionStatus}")
```

```java POST /v1/dataContracts/{id}/validate theme={null}
import static org.openmetadata.sdk.fluent.DataContracts.*;
import org.openmetadata.schema.entity.datacontract.DataContractResult;

// client is an initialized OpenMetadataClient.
setDefaultClient(client);

// Validate a contract
DataContractResult result = forContract(contractId).validate();
System.out.println("Status: " + result.getContractExecutionStatus());

// Or from a loaded contract
FluentDataContract contract = find(contractId).fetch();
DataContractResult sameResult = contract.validate();
```

```bash POST /v1/dataContracts/{id}/validate theme={null}
# Validate a contract
curl -X POST "{base_url}/api/v1/dataContracts/f7a1b2c3-d4e5-6789-0abc-def123456789/validate" \
  -H "Authorization: Bearer {access_token}"

# Validate by entity
curl -X POST "{base_url}/api/v1/dataContracts/entity/validate?entityId=a1b2c3d4-e5f6-7890-abcd-ef1234567890&entityType=table" \
  -H "Authorization: Bearer {access_token}"
```

```json Response (Validation Result) theme={null}
{
  "id": "e1f2a3b4-c5d6-7890-ef12-345678901234",
  "dataContractFQN": "sample_data.ecommerce_db.shopify.sales_orders.dataContract_sales-orders-contract",
  "timestamp": 1769986400000,
  "contractExecutionStatus": "Success",
  "schemaValidation": {
    "passed": 4,
    "failed": 0,
    "total": 4,
    "failedFields": []
  },
  "semanticsValidation": {
    "passed": 3,
    "failed": 0,
    "total": 3,
    "failedRules": []
  },
  "qualityValidation": {
    "passed": 2,
    "failed": 0,
    "total": 2,
    "qualityScore": 100.0
  },
  "slaValidation": {
    "refreshFrequencyMet": true,
    "latencyMet": true,
    "availabilityMet": true
  },
  "executionTime": 1250
}
```

***

## Execution Status Values

| Status | Description |
| - | - |
| `Running` | Validation is in progress |
| `Success` | All validations passed |
| `Failed` | One or more validations failed |
| `PartialSuccess` | Some validations passed, some failed |
| `Aborted` | Validation was aborted due to an error |
| `Queued` | Validation is queued for execution |

***

## List Results

Retrieve execution results for a contract.

`GET /v1/dataContracts/{id}/results`

**id** `string` *required*

UUID of the data contract.

**limit** `integer` (default: 10)

Maximum number of results to return (0–10,000).

**startTs** `integer`

Return results after this epoch timestamp (milliseconds).

**endTs** `integer`

Return results before this epoch timestamp (milliseconds).

## Get Latest Result

`GET /v1/dataContracts/{id}/results/latest`

Returns the most recent validation result.

## Add a Result

`PUT /v1/dataContracts/{id}/results`

Programmatically add a validation result (useful for external validation pipelines).

### Body Parameters

**dataContractFQN** `string` *required*

Fully qualified name of the data contract the result belongs to.

**timestamp** `integer` *required*

Epoch timestamp (milliseconds) of the validation run.

**contractExecutionStatus** `string` *required*

Status: `Running`, `Success`, `Failed`, `PartialSuccess`, `Aborted`, `Queued`.

**result** `string`

Human-readable summary message.

**schemaValidation** `object`

Schema validation details.

**properties**

**passed** `integer`

Number of fields that passed.

**failed** `integer`

Number of fields that failed.

**total** `integer`

Total fields checked.

**failedFields** `array`

List of field names that failed validation.

**semanticsValidation** `object`

Semantics validation details.

**properties**

**passed** `integer`

Number of rules that passed.

**failed** `integer`

Number of rules that failed.

**total** `integer`

Total rules checked.

**failedRules** `array`

List of rule names that failed.

**qualityValidation** `object`

Quality validation details.

**properties**

**passed** `integer`

Number of quality tests that passed.

**failed** `integer`

Number of quality tests that failed.

**total** `integer`

Total quality tests.

**qualityScore** `number`

Quality score (0-100).

**slaValidation** `object`

SLA validation details.

**properties**

**refreshFrequencyMet** `boolean`

Whether refresh frequency target was met.

**latencyMet** `boolean`

Whether latency target was met.

**availabilityMet** `boolean`

Whether availability target was met.

**actualLatency** `integer`

Actual observed latency in milliseconds.

**executionTime** `integer`

Total validation execution time in milliseconds.

```python Add Result theme={null}
from metadata.sdk import client, configure

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

# Add a validation result
rest.put("/dataContracts/f7a1b2c3-d4e5-6789-0abc-def123456789/results", data={
    "dataContractFQN": "sample_data.ecommerce_db.shopify.sales_orders.dataContract_sales-orders-contract",
    "timestamp": 1769986400000,
    "contractExecutionStatus": "Success",
    "schemaValidation": {"passed": 4, "failed": 0, "total": 4},
    "semanticsValidation": {"passed": 3, "failed": 0, "total": 3},
    "executionTime": 850
})
```

```java Add Result theme={null}
import static org.openmetadata.sdk.fluent.DataContracts.*;

// client is an initialized OpenMetadataClient.
setDefaultClient(client);

// Add a result using fluent API
forContract(contractId)
    .addResult()
    .success()
    .withMessage("All validations passed")
    .withExecutionTime(850L)
    .execute();
```

```bash Add Result theme={null}
curl -X PUT "{base_url}/api/v1/dataContracts/f7a1b2c3-d4e5-6789-0abc-def123456789/results" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "dataContractFQN": "sample_data.ecommerce_db.shopify.sales_orders.dataContract_sales-orders-contract",
    "timestamp": 1769986400000,
    "contractExecutionStatus": "Success",
    "schemaValidation": {"passed": 4, "failed": 0, "total": 4, "failedFields": []},
    "semanticsValidation": {"passed": 3, "failed": 0, "total": 3, "failedRules": []},
    "executionTime": 850
  }'
```

## Delete Results

`DELETE /v1/dataContracts/{id}/results/{timestamp}` — Delete a result at a specific timestamp.

`DELETE /v1/dataContracts/{id}/results/before/{timestamp}` — Delete all results before a timestamp.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission |
| `404` | `NOT_FOUND` | Data contract not found |


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