# Rename a folder

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

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 (_).

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

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `input` | object | optional |  |
| `input.name` | string | required | The new name for the folder |
| `input.oldName` | string | required | The current name of the folder to be renamed |

## Example request

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

## Responses

| Status | Description |
| --- | --- |
| `200` | Successfully renamed the folder |
| `400` | Bad request - invalid input parameters |
| `404` | Folder not found |
| `409` | New folder name already exists |
