Get File Info
GET
/v1/sandbox/{sandbox_id}/files/infoGET
/v1/sandbox/{'{sandbox_id}'}/files/infoYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Description
Returns metadata for one or more files or directories within a sandbox. Multiple path query parameters can be provided to retrieve information for several files in a single request.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sandbox_id | string | Yes | Sandbox ID or name |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Path of the file or directory to inspect. Can be repeated for multiple paths |
Responses
200 Success
| Property | Type | Description |
|---|---|---|
files | object[] | Array of file metadata objects |
files[].path | string | Absolute path of the file |
files[].size | integer | File size in bytes |
files[].is_dir | boolean | Whether the path is a directory |
files[].modified_at | string | Last modification timestamp (ISO 8601) |
files[].created_at | string | Creation timestamp (ISO 8601) |
files[].owner | string | Owning user name |
files[].group | string | Owning group name |
files[].mode | integer | Unix file permission bits (e.g., 644) |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
Request
curl -X GET "https://your-instance.example.com/v1/sandbox/sb_abc123/files/info?path=/repo/main.go&path=/repo/README.md" \
-H "Authorization: Bearer <token>"const params = new URLSearchParams();
params.append("path", "/repo/main.go");
params.append("path", "/repo/README.md");
const response = await fetch(
`https://your-instance.example.com/v1/sandbox/sb_abc123/files/info?${params}`,
{
method: "GET",
headers: {
Authorization: "Bearer <token>",
},
}
);
const data = await response.json();
console.log(data.files);import requests
response = requests.get(
"https://your-instance.example.com/v1/sandbox/sb_abc123/files/info",
params=[("path", "/repo/main.go"), ("path", "/repo/README.md")],
headers={"Authorization": "Bearer <token>"},
)
print(response.json())Response
{
"files": [
{
"path": "/repo/main.go",
"size": 1234,
"is_dir": false,
"modified_at": "2025-01-01T00:00:00Z",
"created_at": "2025-01-01T00:00:00Z",
"owner": "root",
"group": "root",
"mode": 644
}
]
}{"code": 0, "message": "string", "details": [{"@type": "string"}]}
