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>"
}
]
}Authorizations
Path Parameters
Query Parameters
Directory prefix to upload into (e.g. "uploads/")
Body
application/json
Request body for generating presigned upload URLs.
Required array length:
1 - 10 elementsShow child attributes
Show child attributes
Response
Successful Response
Presigned upload URLs for the requested files.
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>', 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>"
}
]
}