---
title: "Drag the mouse along a path"
method: POST
path: "/computer/drag_mouse"
---

# Drag the mouse along a path

`POST /computer/drag_mouse`

Press and hold a mouse button, optionally wait for a short delay, then move along the given path and release.
The path is a list of [x, y] coordinate pairs.

## Request body

- 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. Ignored when smooth=true. Minimum 1.
  - `step_delay_ms` integer — Delay in milliseconds between relative steps while dragging. Ignored when smooth=true.
  - `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.
  - `hold_keys` string[] — Modifier keys to hold during the drag

## Response `200`

Drag performed

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

## Changes

> 52 revisions in range; 4 could not be searched.

- **2026-03-09** `d3dfd79e3308` — 2 info
  - added the new optional request property `duration_ms`
  - added the new optional request property `smooth`
- **2025-10-16** `575df10f30cd` — 2 info
  - added the new optional request property `step_delay_ms`
  - added the new optional request property `steps_per_segment`
- **2025-10-16** `5ba7ffc94918` — 1 info
  - endpoint added
- **2025-06-27** `f980a92ab23f` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/kernel/apis/kernel-images-api/changes/computer/drag_mouse/post.md)

---

[API](https://skmtc.dev/kernel/apis/kernel-images-api.md) · [All operations](https://skmtc.dev/kernel/apis/kernel-images-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kernel/kernel-images-api/revisions/7a641fa15a85/schema)
