POSTapi.synup.com/api/v4/folders/create
Create a new folder
This API creates a new folder to help organize locations within an account. The folder name must be unique across the account.
If a parent folder ID (parentFolder) or parent folder name (parentFolderName) is not provided, the folder will be created under the root folder.
Folders support a hierarchical structure, allowing subfolders to be organized within parent folders.
Requires an API key. Send it as
Authorization: API <your-key> — see Getting started.Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type | string | optional |
Body
| Name | Type | Required | Description |
|---|---|---|---|
input | object | required | |
input.name | string | required | Unique name for the folder |
input.parentFolderName | string | optional | Name of the parent folder (optional) |
input.parentFolder | string | optional | UUID of the parent folder (optional) |
Request
Request
curl -X POST 'https://api.synup.com/api/v4/folders/create' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"input": {
"name": "franchise",
"parentFolderName": "all_franchise"
}
}'const res = await fetch('https://api.synup.com/api/v4/folders/create', {
method: 'POST',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"input": {
"name": "franchise",
"parentFolderName": "all_franchise"
}
}),
});
const data = await res.json();import requests
res = requests.post(
"https://api.synup.com/api/v4/folders/create",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"input": {
"name": "franchise",
"parentFolderName": "all_franchise"
}
},
)
data = res.json()req, _ := http.NewRequest("POST", "https://api.synup.com/api/v4/folders/create", 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 | Folder created successfully |
Example response (generated from the schema)
{
"data": {
"createFolder": {
"clientMutationId": "string",
"errors": [
{
"message": "string",
"code": "string",
"contextInfo": [
{
"key": null,
"value": null
}
]
}
],
"folder": {
"accountId": 0,
"archived": true,
"createdAt": "string",
"id": "string",
"locationCount": 0,
"name": "string",
"root": true
},
"success": true
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.createFolder | object | optional | |
data.createFolder.clientMutationId | string | optional | |
data.createFolder.errors | array of object | optional | |
data.createFolder.errors[].message | string | optional | |
data.createFolder.errors[].code | string | optional | |
data.createFolder.errors[].contextInfo | array of object | optional | |
data.createFolder.errors[].contextInfo[].key | string | optional | |
data.createFolder.errors[].contextInfo[].value | string | optional | |
data.createFolder.folder | object | optional | |
data.createFolder.folder.accountId | integer | optional | ID of the account owning this folder |
data.createFolder.folder.archived | boolean | optional | Whether the folder is archived |
data.createFolder.folder.createdAt | string | optional | UTC timestamp of folder creation |
data.createFolder.folder.id | string | optional | Unique identifier (UUID) of the folder |
data.createFolder.folder.locationCount | integer | optional | Number of locations in this folder |
data.createFolder.folder.name | string | optional | Name of the folder |
data.createFolder.folder.root | boolean | optional | Whether this is the root folder |
data.createFolder.success | boolean | optional |