Skip to main content
Empirical keeps two kinds of files for a project:
  • Project files: screenshots, videos, documents and HTML pages that you or Empirical’s agents upload. Each one has a handle like file@6526 and a link on empirical.run/files/.
  • Report artifacts: what a test run produces, such as the Playwright report (summary.json), trace.zip, screenshots and videos. Their links are on report hosts: reports-us.empirical.run, reports-in.empirical.run and reports-r2.empirical.run.
Both kinds of link open only for people and API keys with access to the project. Empirical’s agents read file and report links with their session’s credentials. Pass links to a session as they are.

Download files from a script

To download files in CI or a script, send a project API key as a Bearer token. Create a key under Settings → API keys. A key reads only its own project’s files and report artifacts. Get a run’s report link from the API, then download it with the same key:
Attachment paths in summary.json (traces, screenshots, videos) are full links, so download them with the same header. Range requests work too, for tools that read part of a trace.zip. Code coverage downloads every coverage attachment of a run this way.

Download files with the CLI

After empirical login, the CLI sends your sign-in. It takes a handle, a file link or a report link:
Add -o - to write to stdout. Run empirical files download --help for every option.

Upload a project file

With the CLI, empirical files upload <path> uploads a file and prints its link. Add --json to print the whole file record, including its ID. With the API, an upload takes three requests:
  1. Create the file with POST /api/files, sending name, mime_type and size_bytes. The response has the file record and an upload_url that is valid for 1 hour.
  2. PUT the file body to upload_url, with a Content-Type header equal to mime_type.
  3. Confirm the upload with PATCH /api/files/{id} and {"status": "uploaded"}.
See Create a file in the API reference.

Share a file outside Empirical

To embed a file where a sign-in can’t be sent, such as an image in a Google Doc, create a share link. Anyone with the link can open the file for up to 1 hour.
The API equivalent is POST /api/files/{id}/share-link with expires_in in seconds, from 60 to 3600. Share links can’t be revoked, so create one only for a link you send or embed outside Empirical. Share links work for project files only. To share a report screenshot, download it and upload it as a project file:

Troubleshooting