GETapi.synup.com/api/v4/folders/flat
List all folders
This API returns a flat list of all active folders accessible to the user.
Response Includes:
- Basic folder information (ID, name)
- Parent folder details (if applicable)
- Number of locations within each folder
- Hierarchy level of each folder
Requires an API key. Send it as
Authorization: API <your-key> — see Getting started.Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type | string | optional |
Request
Request
curl -X GET 'https://api.synup.com/api/v4/folders/flat' \
-H 'Authorization: API YOUR_API_KEY' \
-H 'Content-Type: application/json'const res = await fetch('https://api.synup.com/api/v4/folders/flat', {
method: 'GET',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
});
const data = await res.json();import requests
res = requests.get(
"https://api.synup.com/api/v4/folders/flat",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
)
data = res.json()req, _ := http.NewRequest("GET", "https://api.synup.com/api/v4/folders/flat", nil)
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 retrieved folders list |
Example response
{
"data": {
"getUserFolders": [
{
"id": "401228fe-8ee9-4914-a08a-db7cda490ec9",
"level": 0,
"locationCount": 2749,
"name": "root",
"parentFolderId": null,
"parentFolderName": null
},
{
"id": "0360d778-1bfb-4795-8c11-b278f3a65970",
"level": 1,
"locationCount": 1,
"name": "demo_1",
"parentFolderId": "401228fe-8ee9-4914-a08a-db7cda490ec9",
"parentFolderName": "root"
}
]
}
}Response body
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.getUserFolders | array of object | optional | |
data.getUserFolders[].id | string | optional | Unique identifier of the folder |
data.getUserFolders[].name | string | optional | Name of the folder |
data.getUserFolders[].level | integer | optional | Hierarchical level of the folder (0 for root) |
data.getUserFolders[].locationCount | integer | optional | Number of locations in this folder |
data.getUserFolders[].parentFolderId | string | optional | ID of the parent folder (null for root folder) |
data.getUserFolders[].parentFolderName | string | optional | Name of the parent folder (null for root folder) |