One change
files
managed-agents/files
Nearest release: v2.1.239, published 2 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
managed-agents/files Changed · +15 / -14 lines
from line 24
``` ```bash CLI - FILE_ID=$(ant files upload \ - --file data.csv \ - --transform id --raw-output) + FILE_ID=$(ant files upload --file data.csv --transform id --raw-output) ``` ```python Python
from line 69
``` ```php PHP - // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs. - $file = $client->beta->files->upload( - FileParam::fromResource(fopen($csvPath, 'r'), filename: 'data.csv', contentType: 'text/csv'), + $file = $client->files->upload( + file: FileParam::fromResource(fopen($csvPath, 'r'), filename: 'data.csv', contentType: 'text/csv'), ); echo "File ID: {$file->id}\n"; ```
from line 314
```php PHP $resources = [ - ['type' => 'file', 'file_id' => 'file_abc123', 'mount_path' => '/data.csv'], - ['type' => 'file', 'file_id' => 'file_def456', 'mount_path' => '/config.json'], - ['type' => 'file', 'file_id' => 'file_ghi789', 'mount_path' => '/src/main.py'], + ['type' => 'file', 'fileID' => 'file_abc123', 'mountPath' => '/data.csv'], + ['type' => 'file', 'fileID' => 'file_def456', 'mountPath' => '/config.json'], + ['type' => 'file', 'fileID' => 'file_ghi789', 'mountPath' => '/src/main.py'], ]; ```
from line 535
## Listing and downloading session files -Use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) to list files scoped to a session and download them. Filtering by `scope_id` requires the `managed-agents-2026-04-01` beta header, so the list examples use the `beta` files namespace and pass that header explicitly. +Use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) to list files scoped to a session and download them. Files the agent writes to `/mnt/session/outputs/` appear in the list shortly after the agent finishes writing them, sometimes a few seconds after the session goes idle. If an output file you expect is missing, list again after a short delay; once it appears in the list, its upload has finished. +Filtering by `scope_id` requires the `managed-agents-2026-04-01` beta header, so the list examples use the `beta` files namespace and pass that header explicitly. + <CodeGroup> ```bash cURL # List files associated with a session
from line 556
```bash CLI # List files associated with a session - ant beta:files list --scope-id sesn_abc123 \ - --beta managed-agents-2026-04-01 + ant beta:files list --scope-id sesn_abc123 --beta managed-agents-2026-04-01 # Download a file ant files download --file-id "$FILE_ID" --output output.txt
from line 649
``` ```php PHP - // The PHP SDK exposes the Files API under the beta namespace; field names can differ from other SDKs. // List files associated with a session $files = $client->beta->files->list( scopeID: 'sesn_abc123', betas: ['managed-agents-2026-04-01'], ); + foreach ($files->getItems() as $file) { + echo "{$file->id} {$file->filename}\n"; + } // Download a file - $content = $client->beta->files->download($files->data[0]->id); + $content = $client->files->download($files->getItems()[0]->id); file_put_contents('output.txt', $content); ```
from line 696
* If you omit `mount_path`, the file is placed at `/mnt/session/uploads/<file_id>` * Parent directories are created automatically * Paths should be absolute (starting with `/`) +* Files the agent writes to `/mnt/session/outputs/` become available through the Files API, scoped to the session; see [Listing and downloading session files](https://platform.claude.com/docs/en/managed-agents/files#listing-and-downloading-session-files)