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

# Test Case Results

> Retrieve historical test case execution results and submit new test run outcomes with pass/fail status and metrics for data quality monitoring using the Collate REST API.

# Test Case Results

Retrieve test case execution results or add new results programmatically. Each result includes a status, timestamp, and detailed result values.

## Get Test Case Results

**fqn** `string` *required*

Fully qualified name (FQN) returned when creating the test case. URL-encode it when necessary.

**startTs** `integer`

Start timestamp (epoch milliseconds) to filter results.

**endTs** `integer`

End timestamp (epoch milliseconds) to filter results.

Each result also includes `duration`, the time the run took in milliseconds, and, for a run that an error aborted, `errorDetails`. See [Add a Test Case Result](#add-a-test-case-result) for both fields.

## Add a Test Case Result

Use `POST /v1/dataQuality/testCases/testCaseResults/{fqn}` to add a new test result.

**fqn** `string` *required*

Fully qualified name (FQN) returned when creating the test case. URL-encode it when necessary.

### Body Parameters

**timestamp** `integer` *required*

Epoch timestamp (milliseconds) of the test execution.

**testCaseStatus** `string` *required*

Status of the test execution: `Success`, `Failed`, `Aborted`, or `Queued`.

**result** `string`

Human-readable summary of the test result.

**testResultValue** `array` *required*

Array of detailed result values produced by the test.

**properties**

**name** `string` *required*

Name of the result metric.

**value** `string` *required*

Value of the result metric.

**duration** `number`

Wall-clock time that the test case run took, in milliseconds.

**errorDetails** `object`

Details of the error that aborted the run. Collate shows them in the **Execution error** section of the **Run Details** card.

**properties**

**errorType** `string`

Type of the error, for example the exception class name.

**message** `string`

Human-readable error message.

**stackTrace** `string`

Formatted stack trace of the error.

```bash GET /v1/dataQuality/testCases/testCaseResults/{fqn} theme={null}
# Get test results
curl "{base_url}/api/v1/dataQuality/testCases/testCaseResults/sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between" \
  -H "Authorization: Bearer {access_token}"

# Get results with time range
curl "{base_url}/api/v1/dataQuality/testCases/testCaseResults/sample_data.ecommerce_db.shopify.dim_address.shop_id.column_value_max_to_be_between?startTs=1769900000000&endTs=1769990000000" \
  -H "Authorization: Bearer {access_token}"

# Add a test result
curl -X POST "{base_url}/api/v1/dataQuality/testCases/testCaseResults/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" \
  -d '{
    "timestamp": 1769982800000,
    "testCaseStatus": "Success",
    "result": "Max value 42 is between 1 and 100",
    "testResultValue": [
      {"name": "maxValue", "value": "42"}
    ]
  }'
```

```json Response (Get Results) theme={null}
{
  "data": [
    {
      "timestamp": 1769982800000,
      "testCaseStatus": "Success",
      "result": "Max value 42 is between 1 and 100",
      "testResultValue": [
        {
          "name": "maxValue",
          "value": "42"
        }
      ]
    },
    {
      "timestamp": 1769896400000,
      "testCaseStatus": "Failed",
      "result": "Max value 150 is not between 1 and 100",
      "testResultValue": [
        {
          "name": "maxValue",
          "value": "150"
        }
      ]
    }
  ],
  "paging": {
    "total": 2
  }
}
```

***

## Returns

**Get results** returns a list of test case result objects for the requested FQN and time range.

**Add result** returns the test case result object that was created.

## Response

**data** `array`

Array of test case result objects.

**properties**

**timestamp** `integer`

Epoch timestamp (milliseconds) of the test execution.

**testCaseStatus** `string`

Status of the test: `Success`, `Failed`, or `Aborted`.

**result** `string`

Human-readable summary of the test result.

**testResultValue** `array`

Detailed result values.

**properties**

**name** `string`

Name of the result metric.

**value** `string`

Value of the result metric.

**paging** `object`

Pagination information.

**properties**

**total** `integer`

Total count of results.

***

## Test Case Status Values

| Status | Description |
| - | - |
| `Success` | The test passed all assertions |
| `Failed` | The test failed one or more assertions |
| `Aborted` | The test was aborted due to an error or timeout |

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to view or add test results |
| `404` | `NOT_FOUND` | Test case with given FQN does not exist |


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