POSTapi.synup.com/api/v4/locations/folders/rename
Rename a folder
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 (_).
Requires an API key. Send it as
Authorization: API <your-key> — see Getting started.Parameters
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 |
Request
Request
curl -X POST 'https://api.synup.com/api/v4/locations/folders/rename' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '""'const res = await fetch('https://api.synup.com/api/v4/locations/folders/rename', {
method: 'POST',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify(""),
});
const data = await res.json();import requests
res = requests.post(
"https://api.synup.com/api/v4/locations/folders/rename",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
json="",
)
data = res.json()req, _ := http.NewRequest("POST", "https://api.synup.com/api/v4/locations/folders/rename", bytes.NewBufferString(payload))
req.Header.Set("Authorization", "API YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Responses
| Status | Description |
|---|---|
200 | Successfully renamed the folder |
400 | Bad request - invalid input parameters |
404 | Folder not found |
409 | New folder name already exists |
Example response
{
"data": {
"renameFolder": {
"clientMutationId": null,
"errors": null,
"folder": {
"accountId": 16154,
"archived": false,
"createdAt": "2025-02-02 15:27:00 UTC",
"id": "098ba54d-3659-46fa-9c17-4af4329ce421",
"locationCount": null,
"name": "2feb2025855pm_2",
"root": false
},
"success": true
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.renameFolder | object | optional | |
data.renameFolder.errors | array of string | optional | Array of error messages if the operation failed |
data.renameFolder.folder | object | optional | |
data.renameFolder.folder.accountId | integer | required | ID of the account that owns the folder |
data.renameFolder.folder.archived | boolean | required | Indicates if the folder is archived |
data.renameFolder.folder.id | string | required | Unique identifier of the folder |
data.renameFolder.folder.name | string | required | The new name of the folder |
data.renameFolder.folder.root | boolean | required | Indicates if this is a root folder |