curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"path": "/src/components"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"path": "/src/components"},
)
print(f"Created: {response.json()['path']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({ path: "/src/components" }),
}
);
const data = await response.json();
console.log(`Created: ${data.path}`);
{
"path": "/src/components"
}
Files
Create Directory
Create a directory in the sandbox
POST
/
api
/
sessions
/
{session_id}
/
file
/
mkdir
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"path": "/src/components"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"path": "/src/components"},
)
print(f"Created: {response.json()['path']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({ path: "/src/components" }),
}
);
const data = await response.json();
console.log(`Created: ${data.path}`);
{
"path": "/src/components"
}
Creates a directory at the specified path in the sandbox. Parent directories are created automatically if they don’t exist.
Required scope:
sessions:write
Path Parameters
string
required
The session ID (e.g.
ses_abc123).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxBody
string
required
Directory path to create (e.g.
/src/components).Response
string
Path of the created directory.
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"path": "/src/components"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"path": "/src/components"},
)
print(f"Created: {response.json()['path']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/mkdir",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({ path: "/src/components" }),
}
);
const data = await response.json();
console.log(`Created: ${data.path}`);
{
"path": "/src/components"
}