> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Read a file from a sandbox

> File content, base64-encoded

### Path parameters

<ParamField path="id" type="string (uuid)" required>
  Sandbox identifier
</ParamField>

### Query parameters

<ParamField query="path" type="string" required>
  File path within /workspace
</ParamField>

### Response

`FileContent`

<ResponseField name="path" type="string" />

<ResponseField name="content" type="string (byte)">
  Base64-encoded file content
</ResponseField>

<ResponseField name="size" type="integer">
  File size in bytes
</ResponseField>

### Status codes

| Code  | Meaning                      |
| ----- | ---------------------------- |
| `200` | File content, base64-encoded |
| `404` | Sandbox not found            |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.sandbox.stateset.app/api/v1/sandbox/{id}/files/read' \
    --header "Authorization: Bearer $STATESET_SANDBOX_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "path": "string",
    "content": "aGVsbG8=",
    "size": 1
  }
  ```
</ResponseExample>
