Browser Sessions

Upload files directly to a browser session for use with web forms and file inputs.

Files are saved to the session's uploads directory and can be referenced in CDP commands (for example DOM.setFileInputFiles). The saved paths are returned in file_paths.

A .zip upload is unpacked into the uploads directory by default and the archive itself is not kept. Pass extract=false to store the archive as-is, for example to attach the zip itself to a file input.

post/v1/sessions/{sessionId}/uploads

Request

  • Base URL
    https://api.anchorbrowser.io
  • Auth
    API key in header anchor-api-key

Path parameters

sessionIdstring uuid required

The browser session ID

Query parameters

extract'true' | 'false'

Whether a .zip upload is unpacked into the uploads directory. Defaults to true. Set to false to keep the archive itself so it can be attached to a file input as-is. Any other value is treated as true. Has no effect on non-zip files.

Request body multipart/form-data

filestring binary required

File to upload to the browser session

Response

File uploaded successfully

Changes

    • info

      added the new optional query request parameter extract

    • info

      added the optional property / to the response with the status