Folders API
Folders organize audiences, orchestrations and A/B tests into nested trees. These endpoints create, rename, move and delete folders, list a workspace’s folders so you can build the tree, and file items into a folder.
See Folders for the product behaviour, and Folder and Destination Access for restricting a folder to named groups.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/v1/workspaces/{id}/folders | List folders, flat |
POST | /api/v1/workspaces/{id}/folders | Create a folder |
GET | /api/v1/workspaces/{id}/folders/{folderId} | Get a folder |
PUT | /api/v1/workspaces/{id}/folders/{folderId} | Rename and/or move a folder |
DELETE | /api/v1/workspaces/{id}/folders/{folderId} | Delete a folder, moving its contents up one level |
PUT | /api/v1/workspaces/{id}/audiences/{audienceId}/folder | File an audience in a folder |
PUT | /api/v1/workspaces/{id}/journeys/{journeyId}/folder | File an orchestration in a folder |
PUT | /api/v1/workspaces/{id}/splits/{splitId}/folder | File an A/B test in a folder |
Permissions
| Action | Permission |
|---|---|
| List and get folders | folders.read |
| Create, rename and move folders | folders.write |
| Delete folders | folders.delete |
| File an audience or an A/B test | audiences.write |
| File an orchestration | journeys.write |
The built-in Owner and Admin roles hold all three folder permissions; Member holds folders.read only. A custom role needs folders.delete granted on its own: folders.write does not include it. See Permissions.
Filing an item is an edit to that item, so it follows the item’s own write permission rather than folders.write.
A folder restricted to groups narrows this further. If you cannot reach a folder, every endpoint answers 404 for it. If you have view-only access, a change to the folder, or to anything filed in it, is refused with 403.
Two Trees
Every folder belongs to one of two trees, named by its module:
module | Holds |
|---|---|
audiences | Audiences and A/B tests |
journeys | Orchestrations |
A folder’s subfolders are always in the same tree, and an item can only be filed in a folder of its own tree. Audience syncs have no folder of their own: a sync sits wherever its audience sits.
Folder Object
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Folder ID |
workspace_id | string (UUID) | Workspace the folder belongs to |
parent_id | string (UUID) | The folder this one sits in. Absent on a top-level folder |
module | string | audiences or journeys |
name | string | Folder name |
created_by | string (UUID) | Account that created the folder |
created_at | string (ISO 8601) | Creation timestamp |
updated_at | string (ISO 8601) | Last update timestamp |
view_only | boolean | List responses only. true when you can see the folder but not change it or anything filed in it. Absent otherwise |
List Folders
GET /api/v1/workspaces/{id}/folders
Returns every folder you can see, at every depth, in one response. The list is flat and sorted by name; each folder points at its parent through parent_id, and you build the tree from those links.
Query parameters
| Parameter | Required | Description |
|---|---|---|
module | audiences or journeys to list one tree. Without it, both trees are returned in one list |
Response
[
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000",
"parent_id": "550e8400-e29b-41d4-a716-446655440000",
"module": "audiences",
"name": "Italy",
"created_by": "880e8400-e29b-41d4-a716-446655440000",
"created_at": "2026-08-10T11:04:00Z",
"updated_at": "2026-08-10T11:04:00Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000",
"module": "audiences",
"name": "Retail",
"created_by": "880e8400-e29b-41d4-a716-446655440000",
"created_at": "2026-08-02T08:15:00Z",
"updated_at": "2026-08-02T08:15:00Z"
},
{
"id": "990e8400-e29b-41d4-a716-446655440000",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000",
"parent_id": "550e8400-e29b-41d4-a716-446655440000",
"module": "audiences",
"name": "Spain",
"created_by": "880e8400-e29b-41d4-a716-446655440000",
"created_at": "2026-08-12T09:30:00Z",
"updated_at": "2026-08-12T09:30:00Z",
"view_only": true
}
]A workspace with no folders returns [].
Building the tree
The list is sorted by name, not by depth, so a subfolder can come before its parent (Italy above comes before Retail, the folder it sits in). Index the list by id first, then attach each folder to its parent:
const folders = await res.json();
const byId = new Map(folders.map((f) => [f.id, { ...f, children: [] }]));
const roots = [];
for (const node of byId.values()) {
if (node.parent_id) byId.get(node.parent_id).children.push(node);
else roots.push(node);
}Because the list is in name order, each children array also comes out sorted by name. When you list both trees at once, parent links never cross between them, so group roots by module to get the two trees.
What you can see
If no folder in the workspace is restricted, everyone with folders.read gets every folder. Otherwise the list is trimmed for you:
- A folder you cannot reach is left out, together with every folder below it. A subfolder cannot be visible while its parent is hidden.
- Folders you can see but not change carry
"view_only": true.
Because a hidden folder always takes its whole subtree with it, the trimmed list is still a complete tree: every folder’s parent is in the same response.
Example
curl -X GET "https://agentic.zeotap.com/api/v1/workspaces/{id}/folders?module=audiences" \
-H "Authorization: Bearer <token>" \
-H "X-Workspace-ID: <workspace-id>"Get a Folder
GET /api/v1/workspaces/{id}/folders/{folderId}
Returns one folder object. It never carries view_only; that flag appears only on the list.
Create a Folder
POST /api/v1/workspaces/{id}/folders
Request
{
"name": "Italy",
"parent_id": "550e8400-e29b-41d4-a716-446655440000",
"module": "audiences"
}| Field | Required | Description |
|---|---|---|
name | yes | Leading and trailing spaces are removed. At most 100 characters, counted in bytes, so names with accented or non-Latin characters allow fewer |
parent_id | The folder to create this one in. Omit it, or send null or "", for a top-level folder. You need edit access to the parent | |
module | audiences (the default) or journeys. Under a parent, it must match the parent’s tree |
Rules:
- Unique among siblings. No two folders in the same tree and under the same parent can share a name, including at the top level. Names are compared exactly, so
Retailandretailcan sit side by side. The same name under a different parent, or in the other tree, is fine. A taken name returns409. - At most 50 levels deep. A top-level folder is level 1.
Returns 201 with the created folder object.
Example
curl -X POST https://agentic.zeotap.com/api/v1/workspaces/{id}/folders \
-H "Authorization: Bearer <token>" \
-H "X-Workspace-ID: <workspace-id>" \
-H "Content-Type: application/json" \
-d '{"name": "Italy", "parent_id": "550e8400-e29b-41d4-a716-446655440000"}'Update a Folder
PUT /api/v1/workspaces/{id}/folders/{folderId}
Renames and moves a folder in one call. The body states the folder’s complete new state, so always send parent_id: a body with no parent_id moves the folder to the top level. To rename in place, send the current parent_id back.
Request
{
"name": "Italy (2026)",
"parent_id": "550e8400-e29b-41d4-a716-446655440000"
}| Field | Required | Description |
|---|---|---|
name | yes | Same rules as on create |
parent_id | The folder to move this one into. Omitted, null or "" makes it a top-level folder |
Rules, in addition to those on create:
- You need edit access to the folder and to its new parent.
- A folder cannot be moved into itself or into one of its own subfolders.
- The 50-level limit applies to the folder’s deepest subfolder, so a move that would push anything below it past the limit is refused.
- A top-level folder with a folder data policy attached cannot be moved under another folder. Detach the policy first.
- A folder’s tree cannot change:
moduleis not accepted here.
Returns 200 with the updated folder object.
Delete a Folder
DELETE /api/v1/workspaces/{id}/folders/{folderId}
Deletes the folder and nothing it holds. Its subfolders, audiences, orchestrations and A/B tests move up one level: into the deleted folder’s parent, or to the top level when the folder was top-level itself. An audience canvas that publishes into the deleted folder publishes into that same place from then on.
- The folder’s restrictions go with it. Its group access list and any folder data policy attached to it are removed. What moves up takes on the restrictions and policy of its new place, so items that were hidden or filtered by this folder may stop being so.
- All or nothing. If a subfolder would land next to a folder with the same name, the delete is refused with
409and nothing changes. Rename one of them first.
Requires folders.delete and edit access to the folder. Returns 204 with no body.
Example
curl -X DELETE https://agentic.zeotap.com/api/v1/workspaces/{id}/folders/{folderId} \
-H "Authorization: Bearer <token>" \
-H "X-Workspace-ID: <workspace-id>"File an Item in a Folder
PUT /api/v1/workspaces/{id}/audiences/{audienceId}/folder
PUT /api/v1/workspaces/{id}/journeys/{journeyId}/folder
PUT /api/v1/workspaces/{id}/splits/{splitId}/folder
Moves an audience, an orchestration or an A/B test into a folder, or back to the top level.
Request
{ "folder_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7" }| Field | Required | Description |
|---|---|---|
folder_id | The target folder. null or "" moves the item to the top level (“no folder”) |
Rules:
- The target folder must be in the item’s own tree: an
audiencesfolder for audiences and A/B tests, ajourneysfolder for orchestrations. - You need edit access to the folder the item is in now and to the target folder.
- For an A/B test, you also need edit access to the folder its audience is in.
Returns 200 with the updated item, in the same shape as the Audiences or Orchestrations API returns it. The item’s folder_id is absent when it sits at the top level.
An audience can also be filed when it is created, by sending folder_id on Create Audience.
Example
curl -X PUT https://agentic.zeotap.com/api/v1/workspaces/{id}/audiences/{audienceId}/folder \
-H "Authorization: Bearer <token>" \
-H "X-Workspace-ID: <workspace-id>" \
-H "Content-Type: application/json" \
-d '{"folder_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"}'Errors
| Status | When |
|---|---|
400 | The body is not valid JSON; the name is empty or too long; module is not audiences or journeys; the parent or target folder is in the other tree; a folder would move into itself or a subfolder; a create or move would go past 50 levels; a top-level folder with a data policy would move under another folder |
403 | You lack the permission the action needs, or you have view-only access to a folder the action changes |
404 | The folder or item does not exist, belongs to another workspace, or sits in a folder you cannot reach |
409 | A sibling folder already has that name, or a delete would place two folders with the same name side by side |
Every folder change and every item move is recorded in the workspace audit log.
Next Steps
- Folders: how folders work in the app
- Folder and Destination Access: restrict a folder to named groups
- Folder Data Policies: apply a filter to everything under a top-level folder
- Governance API: folder access lists and folder data policies