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

# Export Test Cases

> Export test cases as CSV, with optional filters and paging

# Export Test Cases

Export test cases as a CSV file. Two endpoints are available:

| Endpoint | Behavior |
| - | - |
| `GET /v1/dataQuality/testCases/name/{name}/export` | Runs synchronously and returns the CSV as `text/plain`. |
| `GET /v1/dataQuality/testCases/name/{name}/exportAsync` | Runs as a background job. Returns `202` with a job ID in a `CSVExportResponse`. |

With no query parameters, both endpoints export every test case in scope.

## Path Parameters

**name** `string` *required*

Scope of the export. Use the fully qualified name (FQN) of a table, the FQN of a test suite, or `*` to export every test case in the instance.

## Query Parameters

All query parameters are optional. They use the same filters as the test case list and export only the matching test cases.

**testCaseStatus** `string`

Filter by status: `Success`, `Failed`, `Aborted`, or `Queued`. Pass the parameter more than once, or pass comma-separated values, to match several statuses.

**testCaseType** `string`

Filter by test case type: `column`, `table`, or `all`.

**entityFQN** `string`

Filter by the FQN of the table or column under test. A table FQN includes its column tests. Can't be combined with `entityLink`. When `name` is a table FQN, this value must be inside that table.

**entityLink** `string`

Filter by entity link (URL-encoded). Returns test cases for a specific table or column.

**tags** `string`

Filter by tags, comma-separated.

**tier** `string`

Filter by tier tag FQN.

**owner** `string`

Filter by user or team name. A user also matches the teams they belong to.

**q** `string`

Search text applied to the test cases.

**testPlatforms** `string`

Filter by test platform, comma-separated.

**dataQualityDimension** `string`

Filter by data quality dimension.

**serviceName** `string`

Filter by service name.

**dataProductFqn** `string`

Filter by data product FQN.

**startTimestamp** `integer`

Start of the last-run window, in milliseconds. Set together with `endTimestamp`.

**endTimestamp** `integer`

End of the last-run window, in milliseconds. Set together with `startTimestamp`.

**limit** `integer`

Maximum number of test cases to export. Must be 1 or greater. Omit to export all.

**offset** `integer` (default: 0)

Number of matching test cases to skip. Must be 0 or greater.

## Paging With Domain Access Filtering

`limit` and `offset` apply to the search matches before domain access filtering. A caller restricted to specific domains can therefore receive a short or empty page even when more test cases match later. A short or empty page doesn't mean the end of the results. Advance `offset` by the `limit` you requested until you have paged through all matches.

```bash GET /v1/dataQuality/testCases/name/{name}/export theme={null}
# Export every test case
curl "{base_url}/api/v1/dataQuality/testCases/name/*/export" \
  -H "Authorization: Bearer {access_token}"

# Export failed test cases for a table
curl "{base_url}/api/v1/dataQuality/testCases/name/sample_data.ecommerce_db.shopify.dim_address/export?testCaseStatus=Failed" \
  -H "Authorization: Bearer {access_token}"

# Export the second page of 100 test cases
curl "{base_url}/api/v1/dataQuality/testCases/name/*/export?limit=100&offset=100" \
  -H "Authorization: Bearer {access_token}"
```

***

## Error Handling

The endpoints return the following errors.

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | The request is invalid. Causes: `limit` is less than 1, `offset` is less than 0, `testCaseStatus` or `testCaseType` has an invalid value, both `entityFQN` and `entityLink` are set, `entityFQN` is outside the table in `name`, `name` is neither a table nor a test suite, or only one of `startTimestamp` and `endTimestamp` is set. |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to view the test cases |


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