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

# Rename a folder

`POST /locations/folders/rename`

## Request

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

This API updates the name of an existing folder to a new name.

**Important Notes:**
- The new folder name must be unique within your account.
- Root folders cannot be renamed.
- The folder being renamed must exist in your account.
- Special characters in the new name will be converted to underscores (_).

## Headers

- `Authorization` string

## Request body

- object
  - `input` object
    - `name` string, required: The new name for the folder
    - `oldName` string, required: The current name of the folder to be renamed

## Response `200`

Successfully renamed the folder

- object
  - `data` object
    - `renameFolder` object
      - `errors` string[], nullable: Array of error messages if the operation failed
      - `folder` object
        - `accountId` integer, required: ID of the account that owns the folder
        - `archived` boolean, required: Indicates if the folder is archived
        - `id` string, uuid, required: Unique identifier of the folder
        - `name` string, required: The new name of the folder
        - `root` boolean, required: Indicates if this is a root folder

## Other responses

- `400`: Bad request - invalid input parameters
- `404`: Folder not found
- `409`: New folder name already exists

---

[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)
