---
title: "List workspace files"
method: GET
path: "/v1/agents/sessions/{session_id}/workspace-files"
tags: ["Sessions"]
---

# List workspace files

`GET /v1/agents/sessions/{session_id}/workspace-files`

## Request

- Base URL: `https://api.sandbase.ai`
- URL: `https://api.sandbase.ai/v1/agents/sessions/{session_id}/workspace-files`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Read immediate file metadata under a normalized /workspace path. This is a read-only directory listing, not an attachment or artifact download. Use next as page with the same path, order and limit; restart from the first page if the cursor expires.

## Query parameters

- `path` string
- `limit` integer
- `order` 'asc' | 'desc'
- `page` string

## Response `200`

List workspace files

- SessionWorkspacePage
  - `object` 'page', required
  - `data` object[], required
    - `path` string, required
    - `size_bytes` integer, required
  - `next` string, nullable, required
  - `has_more` boolean, required

## Other responses

- `400`: invalid_request or workspace_cursor_invalid; restart pagination for an invalid cursor
- `401`: unauthorized
- `402`: spending_limit_exceeded: API key spending limit or organization balance exhausted
- `403`: insufficient_scope or org_disabled
- `404`: not_found: resource not found in this organization
- `409`: workspace_provisioning or workspace_environment_missing
- `503`: workspace_unavailable, authorization_unavailable, or storage_unavailable

---

[API](https://skmtc.dev/sandbase/apis/sandbase-api.md) · [All operations](https://skmtc.dev/sandbase/apis/sandbase-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sandbase/apis/sandbase-api/revisions/d40df2467ba2?raw)
