Upload Workspace Files
Presigned PUT URLs for input files, placed under uploads/ in the
workspace. The agent pulls them in at the start of every run. URLs are
pinned to the declared Content-Type and exact Content-Length.
POST
/
workspaces
/
{workspace_id}
/
files
/
upload
Upload Workspace Files
const options = {
method: 'POST',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{name: '<string>', size: 26214400, contentType: 'application/octet-stream'}],
allowOverrides: true
})
};
fetch('https://api.browser-use.com/api/v4/workspaces/{workspace_id}/files/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.browser-use.com/api/v4/workspaces/{workspace_id}/files/upload \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"files": [
{
"name": "<string>",
"size": 26214400,
"contentType": "application/octet-stream"
}
],
"allowOverrides": true
}
'import requests
url = "https://api.browser-use.com/api/v4/workspaces/{workspace_id}/files/upload"
payload = {
"files": [
{
"name": "<string>",
"size": 26214400,
"contentType": "application/octet-stream"
}
],
"allowOverrides": True
}
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"files": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"storedName": "<string>",
"path": "<string>",
"willOverride": true,
"uploadUrl": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Path Parameters
Body
application/json
Response
Successful Response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Upload Workspace Files
const options = {
method: 'POST',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{name: '<string>', size: 26214400, contentType: 'application/octet-stream'}],
allowOverrides: true
})
};
fetch('https://api.browser-use.com/api/v4/workspaces/{workspace_id}/files/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.browser-use.com/api/v4/workspaces/{workspace_id}/files/upload \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"files": [
{
"name": "<string>",
"size": 26214400,
"contentType": "application/octet-stream"
}
],
"allowOverrides": true
}
'import requests
url = "https://api.browser-use.com/api/v4/workspaces/{workspace_id}/files/upload"
payload = {
"files": [
{
"name": "<string>",
"size": 26214400,
"contentType": "application/octet-stream"
}
],
"allowOverrides": True
}
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"files": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"storedName": "<string>",
"path": "<string>",
"willOverride": true,
"uploadUrl": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}