Upload files to environments for persistent access, or upload standalone files for temporary use
When your agent needs to work with files — submitting a PDF to a form, importing a spreadsheet, or uploading an image — you upload them first and then reference them by fileId in your tasks.Files can be uploaded in two modes:
Mode
Behavior
Persistent
Attached to an environment. Available to any session on that environment. Only deleted when you explicitly remove them.
Orphan
No environment attached. Automatically deleted after 1 hour. Can be promoted to an environment later.
Include environmentId in the form data to attach the file permanently to an environment. Any session using that environment can access the file at any time.
An orphan file is automatically promoted to an environment when you pass its fileId in a session or task that also includes an environmentId. Once the session runs, the file is persisted to that environment and won’t expire.
Reference uploaded files by fileId when starting a task. Pass them in the files array alongside environmentId to use the environment’s browser profile and persist orphan files at the same time.
List or delete files attached to an environment using the Environments API:
# List all files in an environmentcurl https://connect.webrun.ai/environments/<ENV_ID>/files \ -H "Authorization: Bearer enig_iMM4HaeRczq0sGnyXB8JxhvnYli2pRu6"# Delete a specific filecurl -X DELETE https://connect.webrun.ai/environments/<ENV_ID>/files/<FILE_ID> \ -H "Authorization: Bearer enig_iMM4HaeRczq0sGnyXB8JxhvnYli2pRu6"