Skip to main content
POST
Create a new directory (folder)
Create a new directory (folder) to organize your files within the workspace. Directories can be nested by providing a parentId to create subdirectories.
The system enforces a maximum directory depth limit (configurable via system settings, default is 1 level).

Use Cases

File Organization

Create folders to organize uploaded files by category, project, or type

Nested Structure

Build hierarchical folder structures with parent-child relationships

Workflow Automation

Programmatically create folders as part of automated workflows

Team Collaboration

Set up shared folder structures for team-based file management

Request Parameters

Request Body

The request body must contain a JSON object with the following properties:
If parentId is not provided, the directory will be created at the root level.

Directory Properties

Automatic Fields

The following fields are automatically set by the system:

Depth Calculation

Directories created without a parentId are placed at the root level with depth: 0.
When you provide a parentId, the system automatically calculates the depth by incrementing the parent’s depth by 1.
The system enforces a maximum depth limit (default: 1 level). Attempting to create directories beyond this limit will result in a 400 error.
This endpoint accepts an optional Idempotency-Key request header so a retry cannot apply the change twice. See Idempotent requests.

Authorizations

x-api-key
string
header
required

API key for authentication

Headers

Idempotency-Key
string

Optional opaque key (max 255 chars, UUIDv4 recommended) making this request idempotent for 24h: a retry with the same key and body replays the original response with Idempotent-Replayed: true.

Body

application/json
name
string
required

Directory name

Example:

"Directory 1"

description
string

Directory description

Example:

"Description"

parentId
string

Parent directory id

Example:

"649e2d2d2d2d2d2d2d2d2d2d"

isActive
boolean
default:true

Is active

Example:

true

Response

The directory is created

success
boolean
directory
object