While a chat session is active, agents create files in their sandbox workspace — reports, analysis results, code, and more. The session files endpoints let you list and download those files before the sandbox terminates.Documentation Index
Fetch the complete documentation index at: https://docs.case.dev/llms.txt
Use this file to discover all available pages before exploring further.
List files
Endpoint
Response
Response fields
| Field | Type | Description |
|---|---|---|
chatId | string | The chat session ID |
files[].path | string | Relative path from /workspace |
files[].name | string | Filename (last segment of path) |
files[].sizeBytes | integer | File size in bytes |
Download a file
Endpoint
Content-Type and Content-Disposition headers.
:filePath parameter supports nested paths (e.g., output/analysis.pdf).
Response headers
| Header | Example | Description |
|---|---|---|
Content-Type | application/pdf | MIME type based on file extension |
Content-Disposition | attachment; filename="report.md" | Suggested filename for download |
Content-Length | 4821 | File size in bytes |
Error handling
| Status | Condition |
|---|---|
| 400 | Missing or invalid file path, path traversal |
| 401 | Invalid API key |
| 403 | API key does not have agent:read permission |
| 404 | Chat session or file not found |
| 410 | Sandbox has terminated — files no longer exist |
A 410 response means the sandbox has been destroyed. Files created during the session are gone.
Design your workflows to download or upload important files before the session ends.
Authentication
Both endpoints require an API key withagent:read permission. The API key must be the same one that owns the chat session.
