---
title: "Download selected dataset files"
method: POST
path: "/api/Dataset/{datasetId}/files/download_selected"
tags: ["Dataset Management"]
---

# Download selected dataset files

`POST /api/Dataset/{datasetId}/files/download_selected`

Downloads the specified files from the dataset as a single ZIP archive. The downloaded files are redacted based on the dataset configuration.

## Path parameters

- `datasetId` string, required

## Request body

- DownloadSelectedFilesRequest — Request model for downloading a user-selected subset of a dataset's files as a single ZIP archive. Sent as a POST body rather than a query string because a selection can hold hundreds of file ids, which would exceed URL length limits.
  - `fileIds` string[], required — Ids of the dataset files to include in the archive. Ids that do not belong to the dataset are ignored.
  - `jsonDownloadAs` string, nullable — Format for JSON file downloads (Json, Markdown, or Html). Ignored by datasets with Original output format.

## Response `200`

Returns ZIP archive of the selected redacted files

- string, binary

## Other responses

- `400` — Invalid request parameters or download option
- `404` — Dataset not found, or none of the selected files belong to the dataset
- `500` — An unexpected error occurred during processing

---

[API](https://skmtc.net/tonic/apis/textual-api.md) · [All operations](https://skmtc.net/tonic/apis/textual-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tonic/textual-api/revisions/41da8739a690/schema)
