Skip to Content

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

MethodPathDescription
GET/api/v1/workspaces/{id}/foldersList folders, flat
POST/api/v1/workspaces/{id}/foldersCreate 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}/folderFile an audience in a folder
PUT/api/v1/workspaces/{id}/journeys/{journeyId}/folderFile an orchestration in a folder
PUT/api/v1/workspaces/{id}/splits/{splitId}/folderFile an A/B test in a folder

Permissions

ActionPermission
List and get foldersfolders.read
Create, rename and move foldersfolders.write
Delete foldersfolders.delete
File an audience or an A/B testaudiences.write
File an orchestrationjourneys.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:

moduleHolds
audiencesAudiences and A/B tests
journeysOrchestrations

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

FieldTypeDescription
idstring (UUID)Folder ID
workspace_idstring (UUID)Workspace the folder belongs to
parent_idstring (UUID)The folder this one sits in. Absent on a top-level folder
modulestringaudiences or journeys
namestringFolder name
created_bystring (UUID)Account that created the folder
created_atstring (ISO 8601)Creation timestamp
updated_atstring (ISO 8601)Last update timestamp
view_onlybooleanList 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

ParameterRequiredDescription
moduleaudiences 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" }
FieldRequiredDescription
nameyesLeading and trailing spaces are removed. At most 100 characters, counted in bytes, so names with accented or non-Latin characters allow fewer
parent_idThe folder to create this one in. Omit it, or send null or "", for a top-level folder. You need edit access to the parent
moduleaudiences (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 Retail and retail can sit side by side. The same name under a different parent, or in the other tree, is fine. A taken name returns 409.
  • 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" }
FieldRequiredDescription
nameyesSame rules as on create
parent_idThe 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: module is 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 409 and 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" }
FieldRequiredDescription
folder_idThe 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 audiences folder for audiences and A/B tests, a journeys folder 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

StatusWhen
400The 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
403You lack the permission the action needs, or you have view-only access to a folder the action changes
404The folder or item does not exist, belongs to another workspace, or sits in a folder you cannot reach
409A 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

Last updated on