---
title: "Execute a batch of computer actions sequentially"
method: POST
path: "/browsers/{id}/computer/batch"
tags: ["Browser Computer Controls"]
---

# Execute a batch of computer actions sequentially

`POST /browsers/{id}/computer/batch`

Send an array of computer actions to execute in order on the browser instance.
Execution stops on the first error. This reduces network latency compared to
sending individual action requests.

## Path parameters

- `id` string, required

## Request body

- BatchComputerActionRequest — A batch of computer actions to execute sequentially.
  - `actions` ComputerAction[], required — Ordered list of actions to execute. Execution stops on the first error.
    - `type` 'click_mouse' | 'move_mouse' | 'type_text' | 'press_key' | 'scroll' | 'drag_mouse' | 'set_cursor' | 'sleep', required — The type of action to perform.
    - `click_mouse` ClickMouseRequest
      - `button` 'left' | 'right' | 'middle' | 'back' | 'forward' — Mouse button to interact with
      - `click_type` 'down' | 'up' | 'click' — Type of click action
      - `x` integer, required — X coordinate of the click position
      - `y` integer, required — Y coordinate of the click position
      - `hold_keys` string[] — Modifier keys to hold during the click
      - `num_clicks` integer — Number of times to repeat the click
    - `move_mouse` MoveMouseRequest
      - `x` integer, required — X coordinate to move the cursor to
      - `y` integer, required — Y coordinate to move the cursor to
      - `hold_keys` string[] — Modifier keys to hold during the move
      - `smooth` boolean — Use human-like Bezier curve path instead of instant mouse movement.
      - `duration_ms` integer — Target total duration in milliseconds for the mouse movement when smooth=true. Omit for automatic timing based on distance.
    - `type_text` TypeTextRequest
      - `text` string, required — Text to type on the browser instance
      - `delay` integer — Delay in milliseconds between keystrokes
    - `press_key` PressKeyRequest
      - `keys` string[], required — List of key symbols to press. Each item should be a key symbol supported by xdotool (see X11 keysym definitions). Examples include "Return", "Shift", "Ctrl", "Alt", "F5". Items in this list could also be combinations, e.g. "Ctrl+t" or "Ctrl+Shift+Tab".
      - `duration` integer — Duration to hold the keys down in milliseconds. If omitted or 0, keys are tapped.
      - `hold_keys` string[] — Optional modifier keys to hold during the key press sequence.
    - `scroll` ScrollRequest
      - `x` integer, required — X coordinate at which to perform the scroll
      - `y` integer, required — Y coordinate at which to perform the scroll
      - `delta_x` integer — Horizontal scroll amount in xdotool "wheel units." Positive scrolls right, negative scrolls left.
      - `delta_y` integer — Vertical scroll amount in xdotool "wheel units." Positive scrolls down, negative scrolls up.
      - `hold_keys` string[] — Modifier keys to hold during the scroll
    - `drag_mouse` DragMouseRequest
      - `path` array[], required — Ordered list of [x, y] coordinate pairs to move through while dragging. Must contain at least 2 points.
        - integer[]
      - `button` 'left' | 'middle' | 'right' — Mouse button to drag with
      - `delay` integer — Delay in milliseconds between button down and starting to move along the path.
      - `steps_per_segment` integer — Number of relative move steps per segment in the path. Minimum 1.
      - `step_delay_ms` integer — Delay in milliseconds between relative steps while dragging (not the initial delay).
      - `hold_keys` string[] — Modifier keys to hold during the drag
      - `smooth` boolean — Use human-like Bezier curves between path waypoints instead of linear interpolation. When true, steps_per_segment and step_delay_ms are ignored.
      - `duration_ms` integer — Target total duration in milliseconds for the entire drag movement when smooth=true. Omit for automatic timing based on total path length.
    - `set_cursor` SetCursorRequest
      - `hidden` boolean, required — Whether the cursor should be hidden or visible
    - `sleep` SleepAction — Pause execution for a specified duration.
      - `duration_ms` integer, required — Duration to sleep in milliseconds.

## Response `200`

All actions executed successfully

## Other responses

- `400` — Bad Request – invalid input
- `404` — Resource not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/kernel/apis/kernel-api.md) · [All operations](https://skmtc.net/kernel/apis/kernel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kernel/kernel-api/versions/9e8ce9fcf5e1/schema)
