Skip to main content
A volume is a folder your team owns that outlives any single browser session. Mount it into a session and everything the browser downloads is written to it; upload files to it beforehand and the browser can use them; read the results back through the API afterwards. Several sessions can mount the same volume at once and see each other’s files immediately. For the full endpoint list, see the interactive API documentation: Volumes for creating and managing volumes, and Volume Files for the files inside them.

How it works

  • Files live under the volume root. The browser saves downloads into its downloads/ folder, so a file downloaded in a session shows up as downloads/<name> in the volume.
  • Uploads through the API appear inside running sessions within seconds. Files written by a session appear in the API about a minute after the session stops writing to them.
  • A volume can be mounted by any number of sessions, read-write or read-only.
1

Create a volume

Names are unique within your team and may contain letters, numbers, _ and -. If the response says creating, poll get volume until it is ready.
2

Upload files the browser should have (optional)

Send a multipart request with the file and the destination path. Put files under downloads/ if a page in the session will upload them.
Multipart uploads are limited to 10 MB. For larger files request a pre-signed URL with create upload URL and PUT the file to it, sending the returned headers unchanged.
3

Start a session with the volume mounted

Add browser.volume to the session configuration.
The session starts once the volume is mounted, which adds a few seconds to session creation.
4

Download in the browser

Nothing changes in how you drive the browser. Any download lands in the volume’s downloads/ folder.
To download PDF files instead of viewing them in the browser, set browser.pdf_viewer.active to false when creating the session.
5

Use a volume file in a web form

Files under downloads/ can be attached to a file input by their /downloads/<name> path through CDP, whether they were uploaded through the API or downloaded by another session.
6

Read the results after the session

List the folder, then fetch a file through its pre-signed URL.
Files written by a session become visible here about a minute after the session stops writing to them, so poll the listing if the session just finished.

Sharing a volume between sessions

Sessions that mount the same volume share it live: a file downloaded in one session can be used in another a few seconds later, without going through the API. Mount the volume read-only in sessions that should only consume files.

Managing volumes

Deleting a volume is refused while a running session has it mounted; end those sessions first.

Limits

  • Up to 10 volumes per team.
  • One volume per session.
  • Multipart uploads up to 10 MB; pre-signed uploads up to 5 GB.
  • Paths are relative to the volume root and cannot contain ...
  • Volumes are not available for batch sessions.