# Download locations

```http
GET https://api.synup.com/api/v4/locations/download
```

Generates a CSV export of the selected locations and returns a download URL. The export runs asynchronously — the response confirms the request was accepted, and the user is notified by email when the CSV is ready.

Use `selectionType` to choose between all matching locations (`ALL_ITEMS`) or an explicit set (`SELECTED_ITEMS` with `locationIds`). The `filterInput` parameter accepts the same JSON-encoded filter object as Filter locations.

Source: https://developer.synup.com/api/locations/download-locations

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `filterInput` | string | optional | JSON-encoded filter object. Defaults to an empty filter (all locations). |
| `selectionType` | string | optional | Whether to export all matching locations or an explicit selection. |
| `locationIds` | array | optional | Location IDs to export when selectionType is SELECTED_ITEMS. |
| `emails` | array | optional | Email addresses to notify when the CSV is ready. |
| `archived` | boolean | optional | Filter by archived state (true/false). |
| `approved` | boolean | optional | Filter by approved state (true/false). |
| `archivalScheduledAt` | boolean | optional | Return only locations scheduled for archival. |

## Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Synup-Version` | string | required | API version date (YYYY-MM-DD). |

## Example request

```bash
curl -X GET 'https://api.synup.com/api/v4/locations/download' \
  -H 'Authorization: API YOUR_API_KEY' \
  -H 'Content-Type: application/json'
```

## Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Unauthorized - Invalid or missing API key |
