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

Overview

Pastes into the page by dispatching a native Ctrl+V keystroke (Cmd+V on macOS targets) against the session. If selector is provided the target element is focused first; otherwise the keystroke is delivered to whatever element is currently focused. If text is provided it is placed on the clipboard immediately before the paste event fires, so this endpoint can both set and paste in a single call.

Path Parameters

id
string
required
Browser session ID (UUID).

Body

selector
string
CSS selector of the element to paste into. Defaults to the currently focused element.
text
string
Optional text to place on the clipboard right before pasting. Maximum 1 MiB.

Example Request

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

Response

Success Response (200)

success
boolean
True when the paste event was dispatched.
Example Response:
{
  "success": true
}

Error Responses

StatusDescription
400Invalid body — selector didn’t match, or text exceeded 1 MiB.
401Unauthorized — invalid or missing API key.
404Session not found or not owned by the caller.