Skip to main content
POST
/
sessions
/
{session_id}
/
files
/
upload
Upload Session 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/sessions/{session_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/sessions/{session_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/sessions/{session_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

X-Browser-Use-API-Key
string
header
required

Path Parameters

session_id
string<uuid>
required

Body

application/json

Request body for generating presigned upload URLs.

files
FileUploadItem · object[]
required
Required array length: 1 - 10 elements

Response

Successful Response

Presigned upload URLs for the requested files.

files
FileUploadResponseItem · object[]
required