curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"old_path": "/src/utils.ts", "new_path": "/src/helpers.ts"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"old_path": "/src/utils.ts", "new_path": "/src/helpers.ts"},
)
data = response.json()
print(f"Renamed {data['old_path']} → {data['new_path']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
old_path: "/src/utils.ts",
new_path: "/src/helpers.ts",
}),
}
);
const data = await response.json();
console.log(`Renamed ${data.old_path} → ${data.new_path}`);
{
"old_path": "/src/utils.ts",
"new_path": "/src/helpers.ts"
}
Files
Rename File
Rename or move a file within the sandbox
POST
/
api
/
sessions
/
{session_id}
/
file
/
rename
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"old_path": "/src/utils.ts", "new_path": "/src/helpers.ts"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"old_path": "/src/utils.ts", "new_path": "/src/helpers.ts"},
)
data = response.json()
print(f"Renamed {data['old_path']} → {data['new_path']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
old_path: "/src/utils.ts",
new_path: "/src/helpers.ts",
}),
}
);
const data = await response.json();
console.log(`Renamed ${data.old_path} → ${data.new_path}`);
{
"old_path": "/src/utils.ts",
"new_path": "/src/helpers.ts"
}
Renames or moves a file from one path to another within the sandbox.
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
Current file path (e.g.
/src/utils.ts).string
required
New file path (e.g.
/src/helpers.ts).Response
string
Previous file path.
string
New file path.
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"old_path": "/src/utils.ts", "new_path": "/src/helpers.ts"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"old_path": "/src/utils.ts", "new_path": "/src/helpers.ts"},
)
data = response.json()
print(f"Renamed {data['old_path']} → {data['new_path']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/rename",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
old_path: "/src/utils.ts",
new_path: "/src/helpers.ts",
}),
}
);
const data = await response.json();
console.log(`Renamed ${data.old_path} → ${data.new_path}`);
{
"old_path": "/src/utils.ts",
"new_path": "/src/helpers.ts"
}