Skip to main content
GET
/
api
/
v1
/
files
/
list
List a directory
curl --request GET \
  --url https://{sandbox_id_or_name}.sandbox.tensorlake.ai/api/v1/files/list \
  --header 'Authorization: Bearer <token>'
{
  "path": "<string>",
  "entries": [
    {
      "name": "<string>",
      "is_dir": true,
      "size": 123,
      "modified_at": 123
    }
  ]
}
List the contents of a sandbox directory.

Endpoint

GET /api/v1/files/list?path=<absolute-or-relative-path>

Example Request

curl "https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/files/list?path=/workspace" \
  -H "Authorization: Bearer $TENSORLAKE_API_KEY"

Response

Tensorlake returns 200 OK:
{
  "path": "/workspace",
  "entries": [
    {
      "name": "src",
      "is_dir": true,
      "size": null,
      "modified_at": 1710000000000
    },
    {
      "name": "data.csv",
      "is_dir": false,
      "size": 24,
      "modified_at": 1710000001000
    }
  ]
}
Entries are sorted with directories first and then alphabetically. If the path is not a directory, Tensorlake returns 400 Bad Request. Missing paths return 404 Not Found.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

path
string
required

Absolute or relative directory path inside the sandbox.

Response

Directory listing

path
string
required
entries
object[]
required