Skip to main content
POST
/
browsers
/
{id}
/
computer
/
drag_mouse
Drag the mouse along a path
curl --request POST \
  --url https://api.onkernel.com/browsers/{id}/computer/drag_mouse \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "path": [
    [
      123
    ]
  ],
  "button": "left",
  "delay": 0,
  "steps_per_segment": 10,
  "step_delay_ms": 50,
  "hold_keys": [
    "<string>"
  ]
}
'
{
  "code": "bad_request",
  "message": "Missing required field: app_name",
  "details": [
    {
      "code": "invalid_input",
      "message": "Provided version string is not semver compliant"
    }
  ],
  "inner_error": {
    "code": "invalid_input",
    "message": "Provided version string is not semver compliant"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Browser session ID

Body

application/json
path
integer[][]
required

Ordered list of [x, y] coordinate pairs to move through while dragging. Must contain at least 2 points.

Minimum array length: 2
Required array length: 2 elements
button
enum<string>

Mouse button to drag with

Available options:
left,
middle,
right
delay
integer
default:0

Delay in milliseconds between button down and starting to move along the path.

Required range: x >= 0
steps_per_segment
integer
default:10

Number of relative move steps per segment in the path. Minimum 1.

Required range: x >= 1
step_delay_ms
integer
default:50

Delay in milliseconds between relative steps while dragging (not the initial delay).

Required range: x >= 0
hold_keys
string[]

Modifier keys to hold during the drag

Response

Drag performed