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
string
required
The session ID (e.g.
ses_abc123).Query Parameters
string
default:"/"
Directory path to list (e.g.
/src).boolean
default:"false"
When
true, lists files recursively.Headers
string
required
Bearer token. Example:
Bearer runtm_xxxResponse
array
Array of file/directory entries.
string
File or directory name.
string
Full path within the sandbox.
string
Entry type:
file or directory.integer
File size in bytes (0 for directories).
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 }
]
}