---
title: "Download the processed dataset"
method: GET
path: "/api/v1/datasets/{dataset_id}/download"
tags: ["Dataset"]
---

# Download the processed dataset

`GET /api/v1/datasets/{dataset_id}/download`

## Request

- The document declares no server URL.
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/adaptionlabs/apis/adaption-api/docs/api/v1/datasets/:dataset_id/download/get.ts> (a function with typed inputs; its response is checked against the schema)

Streams the processed rows in the requested file format. Works on datasets with status `ready` (full output) and also on datasets with status `failed` — in the failed case the stream contains only the rows that were successfully processed before the run aborted, which is useful for recovering partial output from interrupted jobs. Returns 422 only when no run has ever started on this dataset.

**Image columns (JSON / JSONL):** Rows may include `original_image` only when the mapped image column is also in `configured_column_mapping.context`. Read `image_column_formats` from `GET /datasets/{dataset_id}` and look up the active image column to determine encoding: `embedded_bytes` → `{ bytes, path: null }` with base64 bytes; `url` or `file_reference` → presigned HTTPS URL string. When images are not surfaced, `original_image` is omitted and internal `s3://` URIs are never returned. See schema `ProcessedDatasetExportOriginalImageFieldDto`. In CSV and Parquet, embedded bytes appear as a JSON string in the cell.

**Response body:** binary in every format. `fileFormat=parquet` returns a gzipped tar archive of one or more Parquet shards (`.tar.gz`), not a single `.parquet` file — extract it before reading. CSV, JSON and JSONL bodies are UTF-8 text and can be decoded directly.

## Path parameters

- `dataset_id` string, required

## Query parameters

- `fileFormat` 'csv' | 'json' | 'jsonl' | 'parquet'

## Response `200`

File download stream. For failed runs, contains partial results (rows processed before failure). For `fileFormat=json` or `jsonl`, each record may include `original_image` per `ProcessedDatasetExportOriginalImageFieldDto` when an image column is mapped and in context.

## Other responses

- `400`: Unsupported `fileFormat`.
- `422`: No run has started on this dataset yet. Adapt it via POST /datasets/{dataset_id}/adapt first.

---

[API](https://skmtc.dev/adaptionlabs/apis/adaption-api.md) - [All operations](https://skmtc.dev/adaptionlabs/apis/adaption-api/llms.txt) - [OpenAPI document](https://skmtc.dev/adaptionlabs/apis/adaption-api/revisions/d4cf908c19a0?raw)
