Skip to main content
POST
/
browser
/
sessions
/
{id}
/
files
Upload Session File
curl --request POST \
  --url https://api.example.com/browser/sessions/{id}/files \
  --header 'Content-Type: application/json' \
  --data '
{
  "filename": "<string>",
  "file": "<string>"
}
'
{
  "filename": "<string>",
  "size": 123,
  "uploadedAt": "<string>"
}

Overview

Uploads a file to the session’s uploads directory. Files land in a private per-session staging area and can be referenced by filename in a subsequent uploadFile task action (for example, to attach a resume to a job application flow). Content is transported as base64 in JSON; maximum decoded size is 50 MiB.

Path Parameters

id
string
required
Browser session ID (UUID).

Body

filename
string
required
File name (up to 255 characters). Must not contain path separators (/, \) and cannot be . or ...
file
string
required
Base64-encoded file content. Decoded size must be 50 MiB or less.

Example Request

curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/files" \
  -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "resume.pdf",
    "file": "SGVsbG8gV29ybGQ="
  }'

Response

Success Response (201)

filename
string
Filename stored in the session’s uploads directory.
size
integer
Size in bytes of the stored file.
uploadedAt
string
ISO 8601 timestamp of when the upload was persisted.
Example Response:
{
  "filename": "resume.pdf",
  "size": 20813,
  "uploadedAt": "2026-04-24T09:12:44Z"
}

Error Responses

StatusDescription
400Invalid body — missing filename/file, filename contains path separators, or file is not valid base64.
401Unauthorized — invalid or missing API key.
404Session not found or not owned by the caller.
413Decoded file exceeds the 50 MiB maximum.