Create Directories
POST
/v1/sandbox/{sandbox_id}/directoriesPOST
/v1/sandbox/{'{sandbox_id}'}/directoriesYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Description
Creates one or more directories inside the sandbox filesystem. Intermediate parent directories are created automatically (equivalent to mkdir -p). If a directory already exists the operation is a no-op for that path.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sandbox_id | string | Yes | Sandbox ID or name |
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
paths | string[] | Yes | List of absolute directory paths to create inside the sandbox |
Responses
201 Success
| Property | Type | Description |
|---|---|---|
status | string | Always "created" on success |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
Request
curl -X POST "https://your-instance.example.com/v1/sandbox/sb_abc123/directories" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"paths":["/repo/src","/repo/tests"]}'const response = await fetch(
"https://your-instance.example.com/v1/sandbox/sb_abc123/directories",
{
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
paths: ["/repo/src", "/repo/tests"],
}),
}
);
const data = await response.json();
console.log(data); // { status: "created" }import requests
response = requests.post(
"https://your-instance.example.com/v1/sandbox/sb_abc123/directories",
headers={"Authorization": "Bearer <token>"},
json={"paths": ["/repo/src", "/repo/tests"]},
)
print(response.json()) # {"status": "created"}Response
{"status": "created"}{"code": 0, "message": "string", "details": [{"@type": "string"}]}
