---
title: "POST /browsers/{browserIdentifier}/sessions/invoke#x-amzn-browser-session-id"
method: POST
path: "/browsers/{browserIdentifier}/sessions/invoke#x-amzn-browser-session-id"
---

# POST /browsers/{browserIdentifier}/sessions/invoke#x-amzn-browser-session-id

`POST /browsers/{browserIdentifier}/sessions/invoke#x-amzn-browser-session-id`

Invokes an operating system-level action on a browser session in Amazon Bedrock AgentCore. This operation provides direct OS-level control over browser sessions, enabling mouse actions, keyboard input, and screenshots that the WebSocket-based Chrome DevTools Protocol (CDP) cannot handle — such as interacting with print dialogs, context menus, and JavaScript alerts.

You send a request with exactly one action in the `BrowserAction` union, and receive a corresponding result in the `BrowserActionResult` union.

The following operations are related to `InvokeBrowser`:

*   [StartBrowserSession](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_StartBrowserSession.html)
    
*   [GetBrowserSession](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_GetBrowserSession.html)
    
*   [StopBrowserSession](https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_StopBrowserSession.html)

## Path parameters

- `browserIdentifier` string, required

## Headers

- `x-amzn-browser-session-id` string, required

## Request body

- object
  - `action` object, required — The browser action to perform. Exactly one member must be set per request.
    - `mouseClick` object — Click at the specified coordinates.
      - `x` integer, required — The X coordinate on screen where the click occurs.
      - `y` integer, required — The Y coordinate on screen where the click occurs.
      - `button` 'LEFT' | 'RIGHT' | 'MIDDLE' — The mouse button to use. Defaults to <code>LEFT</code>.
      - `clickCount` integer — The number of clicks to perform. Valid range: 1–10. Defaults to 1.
    - `mouseMove` object — Move the cursor to the specified coordinates.
      - `x` integer, required — The target X coordinate on screen.
      - `y` integer, required — The target Y coordinate on screen.
    - `mouseDrag` object — Drag from a start position to an end position.
      - `endX` integer, required — The ending X coordinate for the drag.
      - `endY` integer, required — The ending Y coordinate for the drag.
      - `startX` integer, required — The starting X coordinate for the drag.
      - `startY` integer, required — The starting Y coordinate for the drag.
      - `button` 'LEFT' | 'RIGHT' | 'MIDDLE' — The mouse button to use for the drag. Defaults to <code>LEFT</code>.
    - `mouseScroll` object — Scroll at the specified position.
      - `x` integer, required — The X coordinate on screen where the scroll occurs.
      - `y` integer, required — The Y coordinate on screen where the scroll occurs.
      - `deltaX` integer — The horizontal scroll delta. Valid range: -1000 to 1000.
      - `deltaY` integer — The vertical scroll delta. Valid range: -1000 to 1000. Negative values scroll down.
    - `keyType` object — Type a string of text.
      - `text` string, required — The text string to type. Maximum length: 10,000 characters.
    - `keyPress` object — Press a key one or more times.
      - `key` string, required — The key name to press (for example, <code>enter</code>, <code>tab</code>, <code>escape</code>).
      - `presses` integer — The number of times to press the key. Valid range: 1–100. Defaults to 1.
    - `keyShortcut` object — Press a key combination.
      - `keys` String[], required — The key combination to press (for example, <code>["ctrl", "s"]</code>). Maximum 5 keys.
    - `screenshot` object — Capture a full-screen screenshot.
      - `format` 'PNG' — The image format for the screenshot. Defaults to <code>PNG</code>.

## Response `200`

Success

- InvokeBrowserResponse — Response for the InvokeBrowser operation.
  - `result` object, required — The result of the browser action. The member set in the result corresponds to the action that was performed.
    - `mouseClick` object — The result of a mouse click action.
      - `status` 'SUCCESS' | 'FAILED', required — The status of the action execution.
      - `error` string — The error message. Present only when the action failed.
    - `mouseMove` object — The result of a mouse move action.
      - `status` 'SUCCESS' | 'FAILED', required — The status of the action execution.
      - `error` string — The error message. Present only when the action failed.
    - `mouseDrag` object — The result of a mouse drag action.
      - `status` 'SUCCESS' | 'FAILED', required — The status of the action execution.
      - `error` string — The error message. Present only when the action failed.
    - `mouseScroll` object — The result of a mouse scroll action.
      - `status` 'SUCCESS' | 'FAILED', required — The status of the action execution.
      - `error` string — The error message. Present only when the action failed.
    - `keyType` object — The result of a key type action.
      - `status` 'SUCCESS' | 'FAILED', required — The status of the action execution.
      - `error` string — The error message. Present only when the action failed.
    - `keyPress` object — The result of a key press action.
      - `status` 'SUCCESS' | 'FAILED', required — The status of the action execution.
      - `error` string — The error message. Present only when the action failed.
    - `keyShortcut` object — The result of a key shortcut action.
      - `status` 'SUCCESS' | 'FAILED', required — The status of the action execution.
      - `error` string — The error message. Present only when the action failed.
    - `screenshot` object — The result of a screenshot action.
      - `status` 'SUCCESS' | 'FAILED', required — The status of the action execution.
      - `error` string — The error message. Present only when the action failed.
      - `data` string — The base64-encoded image data. Present only when the action succeeded.

## Other responses

- `480` — ServiceQuotaExceededException
- `481` — AccessDeniedException
- `482` — ValidationException
- `483` — ResourceNotFoundException
- `484` — ThrottlingException
- `485` — InternalServerException

---

[API](https://skmtc.net/aws/apis/bedrock-agentcore.md) · [All operations](https://skmtc.net/aws/apis/bedrock-agentcore/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock-agentcore/versions/79623b33d495/schema)
