# Add locations to a folder

```http
POST https://api.synup.com/api/v4/locations/folders
```

This API adds specified locations to a folder. If the folder does not exist, it will be created automatically.

Behavior:
- If `locationIds` are provided, the locations will be added to the folder.
- If ` locationIds` is omitted or empty, only the folder will be created.

Source: https://developer.synup.com/api/organizing-locations/add-locations-to-a-folder

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `input` | object | optional |  |
| `input.name` | string | required | Name of the folder to add locations to |
| `input.locationIds` | array of string | optional | Array of location IDs to add to the folder |

## Example request

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

## Responses

| Status | Description |
| --- | --- |
| `200` | Successfully added locations to folder |
