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
Browser session ID (UUID).
Body
File name (up to 255 characters). Must not contain path separators (/, \) and cannot be . or ...
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 stored in the session’s uploads directory.
Size in bytes of the stored file.
ISO 8601 timestamp of when the upload was persisted.
Example Response:
{
"filename": "resume.pdf",
"size": 20813,
"uploadedAt": "2026-04-24T09:12:44Z"
}
Error Responses
| Status | Description |
|---|
400 | Invalid body — missing filename/file, filename contains path separators, or file is not valid base64. |
401 | Unauthorized — invalid or missing API key. |
404 | Session not found or not owned by the caller. |
413 | Decoded file exceeds the 50 MiB maximum. |