Upload Workspace Files
Get presigned PUT URLs for uploading files to a workspace.
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>', contentType: 'application/octet-stream', size: 2}]})
};
fetch('https://api.browser-use.com/api/v3/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/v3/workspaces/{workspace_id}/files/upload \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"files": [
{
"name": "<string>",
"contentType": "application/octet-stream",
"size": 2
}
]
}
'import requests
url = "https://api.browser-use.com/api/v3/workspaces/{workspace_id}/files/upload"
payload = { "files": [
{
"name": "<string>",
"contentType": "application/octet-stream",
"size": 2
}
] }
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"files": [
{
"name": "<string>",
"uploadUrl": "<string>",
"path": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
application/json
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>', contentType: 'application/octet-stream', size: 2}]})
};
fetch('https://api.browser-use.com/api/v3/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/v3/workspaces/{workspace_id}/files/upload \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '
{
"files": [
{
"name": "<string>",
"contentType": "application/octet-stream",
"size": 2
}
]
}
'import requests
url = "https://api.browser-use.com/api/v3/workspaces/{workspace_id}/files/upload"
payload = { "files": [
{
"name": "<string>",
"contentType": "application/octet-stream",
"size": 2
}
] }
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"files": [
{
"name": "<string>",
"uploadUrl": "<string>",
"path": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}