v13

OpenAPI 3.0.32026-07-31359869.4 MB
sandboxes

Create a directory

Creates a new directory in a session's filesystem. By default, parent directories are created recursively if they don't exist (similar to mkdir -p).

post/v2/sandboxes/sessions/{sessionId}/fs/mkdir

Path parameters

sessionIdstring required

The unique identifier of the session to create the directory in.

Example:sbx_abc123

The unique identifier of the session to create the directory in.

Query parameters

teamIdstring
Example:team_1a2b3c4d5e6f7g8h9i0j1k2l

The Team identifier to perform the request on behalf of.

slugstring
Example:my-team-url-slug

The Team slug to perform the request on behalf of.

Request body

cwdstring

The base directory for resolving relative paths. If not specified, paths are resolved from the sandbox home directory.

pathstring required

The path of the directory to create. Can be absolute or relative to the working directory.

recursiveboolean

If true, creates parent directories as needed (like mkdir -p). If false, fails if parent directories do not exist.

Example request

{
  "cwd": "/home/vercel-sandbox",
  "path": "src/components"
}

Response

The directory was created successfully.

object required