POSTapi.synup.com/api/v4/locations/folders
Add locations to a folder
This API adds specified locations to a folder. If the folder does not exist, it will be created automatically.
Behavior:
- If
locationIdsare provided, the locations will be added to the folder. - If
locationIdsis omitted or empty, only the folder will be created.
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 | Name of the folder to add locations to |
input.locationIds | array of string | optional | Array of location IDs to add to the folder |
Request
Request
curl -X POST 'https://api.synup.com/api/v4/locations/folders' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '""'const res = await fetch('https://api.synup.com/api/v4/locations/folders', {
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",
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", 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 added locations to folder |
Example response (generated from the schema)
{
"data": {
"addLocationsToFolder": {
"errors": "string",
"folder": {
"accountId": 10072,
"archived": false,
"id": "0e4cc56e-45f8-4058-a713-ead264fa9318",
"name": "acme",
"root": false
}
}
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.addLocationsToFolder | object | optional | |
data.addLocationsToFolder.errors | object | optional | Array of errors if any occurred |
data.addLocationsToFolder.folder | object | optional | |
data.addLocationsToFolder.folder.accountId | integer | optional | |
data.addLocationsToFolder.folder.archived | boolean | optional | |
data.addLocationsToFolder.folder.id | string | optional | |
data.addLocationsToFolder.folder.name | string | optional | |
data.addLocationsToFolder.folder.root | boolean | optional |