---
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:3001/api`
- URL: `http://localhost:3001/api/cases/download`
- Auth: none declared

## Request body `application/x-www-form-urlencoded`

- 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 to be downloaded

## Response `200`

OK

## Other responses

- `500`: Internal server error

## Changes

- **2021-06-08** `cbb44c39f792`: 2 info
  - added the new optional request property `format`
  - added the new optional request property `limit`
- **2021-06-08** `9495989cce19`: 2 warning
  - removed the request property `format`
  - removed the request property `limit`
- **2021-06-08** `519a588b07f6`: 2 info
  - added the new optional request property `format`
  - added the new optional request property `limit`

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

---

[API](https://skmtc.dev/globaldothealth/apis/global-health-curator-service-api.md) - [All operations](https://skmtc.dev/globaldothealth/apis/global-health-curator-service-api/llms.txt) - [OpenAPI document](https://skmtc.dev/globaldothealth/apis/global-health-curator-service-api/revisions/5b1151265235?raw)
