# Fetch Testset Revision To File

Source: https://agenta.ai/docs/reference/api/fetch-testset-revision-to-file

`POST /testsets/revisions/{testset_revision_id}/download`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Fetch Testset Revision To File

## Parameters

- `testset_revision_id` (in path, string (uuid), required)
- `file_type` (in query, string, one of: "csv", "json"): File type to download. Supported: 'csv' or 'json'. Default: 'csv'.
- `file_name` (in query, string): Optional custom filename for the download.

## Response schemas

### 200: Successful Response

- any

### 422: Validation Error

- `detail` (array of object)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (Context)
