---
title: "One mouse, keyboard or window action on the desktop."
method: POST
path: "/v1/sandboxes/{id}/desktop:act"
tags: ["desktop"]
---

# One mouse, keyboard or window action on the desktop.

`POST /v1/sandboxes/{id}/desktop:act`

## Request

- Base URL: `https://api.withruntime.com`
- URL: `https://api.withruntime.com/v1/sandboxes/{id}/desktop:act`
- Auth: HTTP bearer

move {x,y}; click {x?,y?,button?,double?}; mouseDown/mouseUp {button?}; drag {from,to}; scroll {dy,dx?,x?,y?}; type {text}; key {keys}; cursor; windows; focus {windowId}; open {url}; launch {argv}; status.

## Path parameters

- `id` string, required: Resource identifier (UUID).

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `action` 'move' | 'click' | 'mouseDown' | 'mouseUp' | 'drag' | 'scroll' | 'type' | 'key' | 'cursor' | 'windows' | 'focus' | 'open' | 'launch' | 'status', required: What to do. See each field for which actions use it.
  - `x` integer
  - `y` integer
  - `button` 'left' | 'middle' | 'right'
  - `double` boolean: click: a double click.
  - `from` integer[]: drag: [x, y] to press at.
  - `to` integer[]: drag: [x, y] to release at.
  - `dy` integer: scroll: wheel clicks, positive is down.
  - `dx` integer: scroll: wheel clicks, positive is right.
  - `text` string: type: the text to type.
  - `delayMs` integer: type: pause between keystrokes.
  - `keys` string: key: xdotool names, e.g. "ctrl+l", "Return", "alt+Tab".
  - `windowId` string: focus: an id from the window list.
  - `url` string: open: an http(s) address to open in Chromium.
  - `argv` string[]: launch: a program and its arguments.

## Response `200`

Success

- object: {ok: true}, or what was asked for: cursor {x, y}, windows {data}.

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/withruntime/apis/runtime-cloud-api.md) · [All operations](https://skmtc.dev/withruntime/apis/runtime-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/withruntime/apis/runtime-cloud-api/revisions/6f4012286988?raw)
