Skip to main content
POST
/
sandboxes
/
{sandbox_id}
/
files
/
mkdir
Make Directory
curl --request POST \
  --url https://api.declaw.ai/sandboxes/{sandbox_id}/files/mkdir \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "path": "<string>",
  "username": "<string>"
}
'
Creates a directory at the specified path, including all necessary parent directories. Equivalent to mkdir -p. If the directory already exists, the operation succeeds silently.

Path Parameters

sandbox_id
string
required
The sandbox identifier. Format: sbx-<8 chars>.

Request Body

path
string
required
Absolute path of the directory to create inside the sandbox. All intermediate directories are created automatically.Example: "/home/user/data/output/results"
username
string
Unix user to own the created directory. Defaults to the envd default user.

Response

Returns the envd mkdir confirmation as a JSON object.

Example

curl -X POST https://api.declaw.ai/sandboxes/sbx-a1b2c3d4/files/mkdir \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "path": "/home/user/data/output" }'

Error Responses

StatusCause
400Invalid request body
401Missing or invalid API key
404Sandbox not found
502envd daemon unreachable
503Sandbox has no VM