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
Browser session ID (UUID). Create via POST /browser/sessions.
Body
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)
True when the clipboard contents were replaced successfully.
Number of bytes written (UTF-8 encoded length of text).
Example Response:
{
"success": true,
"bytes": 11
}
Error Responses
| Status | Description |
|---|
400 | Invalid body — text missing, not a string, or exceeds 1 MiB. |
401 | Unauthorized — invalid or missing API key. |
404 | Session not found or not owned by the caller. |