---
title: "Streams a CSV, TSV or JSON attachment of cases matching the search query. If caseIds are supplied the CSV only contains cases with those ids. You cannot supply both query and caseIds."
method: POST
path: "/cases/download"
tags: ["Case"]
---

# Streams a CSV, TSV or JSON attachment of cases matching the search query. If caseIds are supplied the CSV only contains cases with those ids. You cannot supply both query and caseIds.

`POST /cases/download`

## Request

- Base URL: `http://localhost:3000/api`
- URL: `http://localhost:3000/api/cases/download`
- Auth: none declared

## Request body

- object
  - `caseIds` string[]: Cases corresponding to these ids will be returned
  - `query` string: Cases matching this query will be returned. This is ignored if empty.
  - `limit` string: Max number of rows that can be downloaded when query is provided
  - `format` string: Format of data

## Response `200`

OK

## Other responses

- `400`: Malformed request
- `422`: Unprocessable entity
- `500`: Internal server error

## Changes

- **2026-07-17** `886deae8a6f9`: 2 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `422`
- **2021-06-08** `47196f12b6d8`: 1 breaking, 2 info
  - the request's body type changed from `object` to no type
  - added the new optional request property `format`
  - added the new optional request property `limit`
- **2021-06-08** `7453480b119d`: 1 breaking, 2 info
  - the request's body type changed from `object` to no type
  - added the new optional request property `format`
  - added the new optional request property `limit`
- **2020-09-21** `5c7a917caf1c`: 1 info
  - removed the pattern `\S+` from the request property `query`
- **2020-09-09** `a14b106f1592`: 2 breaking, 2 warning, 2 info
  - the request's body type changed from no type to `object`
  - added the pattern `\S+` to the request property `query`
  - removed the request property `format`
  - removed the request property `limit`
  - …2 more

[Operation history](https://skmtc.dev/globaldothealth/apis/global-health-data-service/changes/cases/download/post.md)

---

[API](https://skmtc.dev/globaldothealth/apis/global-health-data-service.md) - [All operations](https://skmtc.dev/globaldothealth/apis/global-health-data-service/llms.txt) - [OpenAPI document](https://skmtc.dev/globaldothealth/apis/global-health-data-service/revisions/886deae8a6f9?raw)
