Skip to main content
Create a directory in the sandbox. Parent directories are created automatically if needed.

Endpoint

POST /files/mkdir

Request

Headers

Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json

Body Parameters

ParameterTypeRequiredDescription
pathstringYesDirectory path to create

Example Request

curl -X POST https://sandbox_abc123xyz.hopx.dev/files/mkdir \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "/workspace/project/src"
  }'

Response

Success (200 OK)

{
  "path": "/workspace/project/src",
  "message": "Directory created successfully"
}

Status Codes

CodeDescription
200Directory created
401Unauthorized
403Path not allowed

Use Cases

Setup Project Structure

for DIR in "src" "tests" "docs" "data"; do
  curl -X POST https://sandbox_abc123xyz.hopx.dev/files/mkdir \
    -H "Authorization: Bearer YOUR_JWT_TOKEN" \
    -H "Content-Type: application/json" \
    -d "{\"path\": \"/workspace/project/$DIR\"}"
done

Next Steps