> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapengine.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Clipboard Paste

> Dispatch a real Ctrl+V paste event into a selector or the currently focused element.

## 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

<ParamField path="id" type="string" required={true}>
  Browser session ID (UUID).
</ParamField>

## Body

<ParamField body="selector" type="string">
  CSS selector of the element to paste into. Defaults to the currently focused element.
</ParamField>

<ParamField body="text" type="string">
  Optional text to place on the clipboard right before pasting. Maximum 1 MiB.
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL (selector + text) theme={null}
  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"
    }'
  ```

  ```bash cURL (paste existing clipboard) theme={null}
  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 '{}'
  ```
</CodeGroup>

## Response

### Success Response (200)

<ResponseField name="success" type="boolean">
  True when the paste event was dispatched.
</ResponseField>

**Example Response:**

```json theme={null}
{
  "success": true
}
```

### Error Responses

| Status | Description                                                     |
| ------ | --------------------------------------------------------------- |
| `400`  | Invalid body — selector didn't match, or `text` exceeded 1 MiB. |
| `401`  | Unauthorized — invalid or missing API key.                      |
| `404`  | Session not found or not owned by the caller.                   |
