- Project files: screenshots, videos, documents and HTML pages that you or Empirical’s agents
upload. Each one has a handle like
file@6526and a link onempirical.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.runandreports-r2.empirical.run.
Who can open a link
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: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
Afterempirical login, the CLI sends your sign-in. It takes a handle, a file link or a report link:
-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:
- Create the file with
POST /api/files, sendingname,mime_typeandsize_bytes. The response has the file record and anupload_urlthat is valid for 1 hour. PUTthe file body toupload_url, with aContent-Typeheader equal tomime_type.- Confirm the upload with
PATCH /api/files/{id}and{"status": "uploaded"}.
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.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: