Skip to main content
POST
/
browser
/
sessions
/
{id}
/
clipboard
/
write
Clipboard Write
curl --request POST \
  --url https://api.example.com/browser/sessions/{id}/clipboard/write \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>"
}
'
{
  "success": true,
  "bytes": 123
}

Overview

Places UTF-8 text on the operating system clipboard inside the session’s sandbox. The value survives navigation, tab switches, and page reloads, and can be written before any page has loaded. Maximum payload is 1 MiB, measured as UTF-8 byte length.

Path Parameters

id
string
required
Browser session ID (UUID). Create via POST /browser/sessions.

Body

text
string
required
UTF-8 text to place on the session clipboard. Maximum 1 MiB (1,048,576 bytes).

Example Request

curl -X POST "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/clipboard/write" \
  -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "hello world"
  }'

Response

Success Response (200)

success
boolean
True when the clipboard contents were replaced successfully.
bytes
integer
Number of bytes written (UTF-8 encoded length of text).
Example Response:
{
  "success": true,
  "bytes": 11
}

Error Responses

StatusDescription
400Invalid body — text missing, not a string, or exceeds 1 MiB.
401Unauthorized — invalid or missing API key.
404Session not found or not owned by the caller.