Skip to main content
GET
/
sandboxes
/
{sandbox_id}
/
files
/
info
File Info
curl --request GET \
  --url https://api.declaw.ai/sandboxes/{sandbox_id}/files/info \
  --header 'X-API-Key: <api-key>'
{
  "name": "<string>",
  "path": "<string>",
  "type": "<string>",
  "size": 123
}
Returns metadata about a specific file or directory: its name, full path, type, and size in bytes. Proxies the envd response status code — returns 404 if the path does not exist.

Path Parameters

sandbox_id
string
required
The sandbox identifier. Format: sbx-<8 chars>.

Query Parameters

path
string
required
Absolute path of the file or directory to inspect.Example: /home/user/script.py

Response

name
string
Filename or directory name (not the full path).
path
string
Full absolute path inside the sandbox.
type
string
Entry type: "file", "dir", or "symlink".
size
integer
Size in bytes. 0 for directories.

Example

curl "https://api.declaw.ai/sandboxes/sbx-a1b2c3d4/files/info?path=/home/user/script.py" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "name": "script.py",
  "path": "/home/user/script.py",
  "type": "file",
  "size": 1024
}

Error Responses

StatusCause
401Missing or invalid API key
404Path not found or sandbox not found
502envd daemon unreachable
503Sandbox has no VM