---
title: "Add locations to a folder"
method: POST
path: "/locations/folders"
tags: ["Organizing locations"]
---

# Add locations to a folder

`POST /locations/folders`

## Request

- Base URL: `https://api.synup.com/api/v4`
- URL: `https://api.synup.com/api/v4/locations/folders`
- Auth: none required
- TypeScript: <https://skmtc.dev/synup/apis/synup-api/docs/locations/folders/post.ts> (a function with typed inputs; its response is checked against the schema)

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.

## Headers

- `Authorization` string

## Request body

- object
  - `input` object
    - `name` string, required: Name of the folder to add locations to
    - `locationIds` string[]: Array of location IDs to add to the folder

## Response `200`

Successfully added locations to folder

- object
  - `data` object
    - `addLocationsToFolder` object
      - `errors` unknown
      - `folder` object
        - `accountId` integer
        - `archived` boolean
        - `id` string
        - `name` string
        - `root` boolean

---

[API](https://skmtc.dev/synup/apis/synup-api.md) - [All operations](https://skmtc.dev/synup/apis/synup-api/llms.txt) - [OpenAPI document](https://skmtc.dev/synup/apis/synup-api/revisions/67de2d51c22e?raw)
