curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/files?path=/src&recursive=true" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/files",
headers={"Authorization": "Bearer runtm_xxx"},
params={"path": "/src", "recursive": True},
)
for f in response.json()["files"]:
print(f"{f['type']:9s} {f['path']} ({f['size']} bytes)")
const params = new URLSearchParams({ path: "/src", recursive: "true" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/files?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { files } = await response.json();
files.forEach((f) => console.log(`${f.type} ${f.path} (${f.size} bytes)`));
{
"files": [
{ "name": "index.ts", "path": "/src/index.ts", "type": "file", "size": 1024 },
{ "name": "utils", "path": "/src/utils", "type": "directory", "size": 0 },
{ "name": "helpers.ts", "path": "/src/utils/helpers.ts", "type": "file", "size": 512 }
]
}
Files
List Files
List files and directories in the session sandbox
GET
/
api
/
sessions
/
{session_id}
/
files
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/files?path=/src&recursive=true" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/files",
headers={"Authorization": "Bearer runtm_xxx"},
params={"path": "/src", "recursive": True},
)
for f in response.json()["files"]:
print(f"{f['type']:9s} {f['path']} ({f['size']} bytes)")
const params = new URLSearchParams({ path: "/src", recursive: "true" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/files?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { files } = await response.json();
files.forEach((f) => console.log(`${f.type} ${f.path} (${f.size} bytes)`));
{
"files": [
{ "name": "index.ts", "path": "/src/index.ts", "type": "file", "size": 1024 },
{ "name": "utils", "path": "/src/utils", "type": "directory", "size": 0 },
{ "name": "helpers.ts", "path": "/src/utils/helpers.ts", "type": "file", "size": 512 }
]
}
Returns a list of files and directories at the given path in the sandbox.
Required scope:
sessions:read
Path Parameters
Query Parameters
Headers
Response
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/files?path=/src&recursive=true" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/files",
headers={"Authorization": "Bearer runtm_xxx"},
params={"path": "/src", "recursive": True},
)
for f in response.json()["files"]:
print(f"{f['type']:9s} {f['path']} ({f['size']} bytes)")
const params = new URLSearchParams({ path: "/src", recursive: "true" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/files?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { files } = await response.json();
files.forEach((f) => console.log(`${f.type} ${f.path} (${f.size} bytes)`));
{
"files": [
{ "name": "index.ts", "path": "/src/index.ts", "type": "file", "size": 1024 },
{ "name": "utils", "path": "/src/utils", "type": "directory", "size": 0 },
{ "name": "helpers.ts", "path": "/src/utils/helpers.ts", "type": "file", "size": 512 }
]
}