---
title: "Drag the mouse along a path"
method: POST
path: "/browsers/{id_or_name}/computer/drag_mouse"
tags: ["Browser Computer Controls"]
---

# Drag the mouse along a path

`POST /browsers/{id_or_name}/computer/drag_mouse`

## Request

- Base URL: `https://api.onkernel.com`
- URL: `https://api.onkernel.com/browsers/{id_or_name}/computer/drag_mouse`
- Auth: HTTP bearer

## Path parameters

- `id_or_name` string, required

## Request body

- DragMouseRequest
  - `button` 'left' | 'middle' | 'right': Mouse button to drag with
  - `delay` integer: Delay in milliseconds between button down and starting to move along the path.
  - `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.
  - `hold_keys` string[]: Modifier keys to hold during the drag
  - `path` array[], required: Ordered list of [x, y] coordinate pairs to move through while dragging. Must contain at least 2 points.
    - integer[]
  - `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.
  - `step_delay_ms` integer: Delay in milliseconds between relative steps while dragging (not the initial delay).
  - `steps_per_segment` integer: Number of relative move steps per segment in the path. Minimum 1.

## Response `200`

Drag performed

## Other responses

- `400`: Bad Request – invalid input
- `404`: Resource not found
- `500`: Internal Server Error
- `default`: Error returned by the browser or its proxy

---

[API](https://skmtc.dev/onkernel/apis/kernel-api.md) - [All operations](https://skmtc.dev/onkernel/apis/kernel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/onkernel/apis/kernel-api/revisions/0f6cf4f58fe6?raw)
