Get all directories
Retrieve all directories (folders) in the workspace with hierarchical structure.
This endpoint returns a paginated list of directories including their nested subfolders. Each directory includes breadcrumb navigation for easy hierarchy tracking.
Query Parameters:
-
page (optional): Page number for pagination (default: 1)
-
limit (optional): Number of items per page (default: 10)
Response:
The response includes:
-
directories: Array of directory objects with nested subfolders
-
count: Total number of directories
-
currentPage: Current page number
Use Cases
Folder Management
File Organization
Navigation Systems
Automation Rules
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| page | number | No | 1 | Page number for pagination |
| limit | number | No | 100 | Number of items per page |
| sortBy | string | No | createdAt | Field to sort by |
| sortOrder | string | No | ASC | Sort direction (ASC or DESC) |
Response Structure
Directory Object
Each directory object contains:| Field | Type | Description |
|---|---|---|
| id | string | Unique directory identifier |
| name | string | Directory name |
| description | string | Directory description |
| status | string | Directory status (e.g., “active”) |
| parentId | string | Parent directory ID (null for root directories) |
| depth | number | Depth level in hierarchy (0 for root) |
| metadata | object | User, organization, and workspace IDs |
| isFromAutomatedRule | boolean | Whether directory was created by automation |
| breadcrumbs | array | Full path from root to current directory |
| subfolders | array | Nested subdirectories (recursive structure) |
| createdAt | string | ISO 8601 timestamp of creation |
| updatedAt | string | ISO 8601 timestamp of last update |
Understanding the Hierarchy
Depth Levels
Depth Levels
depth field indicates how deep a folder is in the hierarchy:depth: 0- Root level foldersdepth: 1- First level subfoldersdepth: 2- Second level subfolders, and so on
Breadcrumbs Navigation
Breadcrumbs Navigation
Recursive Subfolders
Recursive Subfolders
subfolders array contains nested directories recursively. Each subfolder has the same structure as the parent directory, allowing you to traverse the entire hierarchy.Automated Folders
Automated Folders
isFromAutomatedRule: true. This helps distinguish manually created folders from those generated by workflow automation.Authorizations
API key for authentication
Query Parameters
Page number
1
Number of items per page
100
Field to sort by
"createdAt"
Sort direction
ASC, DESC "ASC"