Skip to main content
GET
/
prod
/
v1
/
directories
Get all directories
curl --request GET \
  --url https://api.orion.file.ai/prod/v1/directories \
  --header 'x-api-key: <api-key>'
{
  "directories": [
    {
      "id": "68e4a80a0e79a0744ac72943",
      "name": "Smart folder 4",
      "description": "Smart folder 4",
      "status": "active",
      "createdAt": "2025-10-07T05:41:30.472Z",
      "updatedAt": "2025-10-07T05:41:30.472Z",
      "depth": 0,
      "metadata": {
        "userId": "68e387848a36d1dd65fa064e",
        "organizationId": "68e387848a36d1dd65fa0653",
        "workspaceId": "68e387848a36d1dd65fa064f"
      },
      "isFromAutomatedRule": false,
      "breadcrumbs": [
        {
          "id": "68e4a80a0e79a0744ac72943",
          "name": "Smart folder 4"
        }
      ],
      "subfolders": []
    },
    {
      "id": "68e4a79e0e79a0744ac7293d",
      "name": "Smart folder 3",
      "description": "Smart folder 3",
      "status": "active",
      "createdAt": "2025-10-07T05:39:42.819Z",
      "updatedAt": "2025-10-07T05:39:42.819Z",
      "depth": 0,
      "metadata": {
        "userId": "68e387848a36d1dd65fa064e",
        "organizationId": "68e387848a36d1dd65fa0653",
        "workspaceId": "68e387848a36d1dd65fa064f"
      },
      "isFromAutomatedRule": false,
      "breadcrumbs": [
        {
          "id": "68e4a79e0e79a0744ac7293d",
          "name": "Smart folder 3"
        }
      ],
      "subfolders": [
        {
          "id": "68e4a8060e79a0744ac72941",
          "name": "Smart folder 4",
          "description": "Smart folder 4",
          "status": "active",
          "createdAt": "2025-10-07T05:41:26.853Z",
          "updatedAt": "2025-10-07T05:41:26.853Z",
          "parentId": "68e4a79e0e79a0744ac7293d",
          "depth": 1,
          "metadata": {
            "userId": "68e387848a36d1dd65fa064e",
            "organizationId": "68e387848a36d1dd65fa0653",
            "workspaceId": "68e387848a36d1dd65fa064f"
          },
          "isFromAutomatedRule": false,
          "breadcrumbs": [
            {
              "id": "68e4a79e0e79a0744ac7293d",
              "name": "Smart folder 3"
            },
            {
              "id": "68e4a8060e79a0744ac72941",
              "name": "Smart folder 4"
            }
          ],
          "subfolders": []
        }
      ]
    }
  ],
  "count": 4,
  "currentPage": 1
}
Retrieve all directories (folders) in the workspace with hierarchical structure. This endpoint returns a paginated list of directories including their nested subfolders with breadcrumb navigation for easy hierarchy tracking.

Use Cases

Folder Management

Browse and manage your workspace folder structure programmatically

File Organization

Understand folder hierarchy for automated file routing and organization

Navigation Systems

Build custom navigation interfaces with breadcrumb support

Automation Rules

Identify folders created by automation rules for workflow tracking

Query Parameters

ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number for pagination
limitnumberNo100Number of items per page
sortBystringNocreatedAtField to sort by
sortOrderstringNoASCSort direction (ASC or DESC)

Response Structure

Directory Object

Each directory object contains:
FieldTypeDescription
idstringUnique directory identifier
namestringDirectory name
descriptionstringDirectory description
statusstringDirectory status (e.g., “active”)
parentIdstringParent directory ID (null for root directories)
depthnumberDepth level in hierarchy (0 for root)
metadataobjectUser, organization, and workspace IDs
isFromAutomatedRulebooleanWhether directory was created by automation
breadcrumbsarrayFull path from root to current directory
subfoldersarrayNested subdirectories (recursive structure)
createdAtstringISO 8601 timestamp of creation
updatedAtstringISO 8601 timestamp of last update

Understanding the Hierarchy

The depth field indicates how deep a folder is in the hierarchy:
  • depth: 0 - Root level folders
  • depth: 1 - First level subfolders
  • depth: 2 - Second level subfolders, and so on
The subfolders array contains nested directories recursively. Each subfolder has the same structure as the parent directory, allowing you to traverse the entire hierarchy.
Folders created by automation rules are marked with isFromAutomatedRule: true. This helps distinguish manually created folders from those generated by workflow automation.

Authorizations

x-api-key
string
header
required

API key for authentication

Query Parameters

page
number
default:1

Page number

Example:

1

limit
number
default:100

Number of items per page

Example:

100

sortBy
string
default:createdAt

Field to sort by

Example:

"createdAt"

sortOrder
enum<string>
default:ASC

Sort direction

Available options:
ASC,
DESC
Example:

"ASC"

Response

The directories are retrieved

directories
object[]
count
number
currentPage
number