# Actions

Taps, typing, gestures, buttons and app control.

Taps, typing, gestures, buttons and app control.

## act

`POST /v1/devices/{deviceId}/actions`

Perform one action (tap, type, swipe, press a button, launch an app...)

One endpoint for every action, discriminated by `type`. By default the response includes a fresh
observation, so an agent needs one call per step instead of two.
When a safety rule needs the person's approval the engine answers 202 with an approval object
(or waits up to `waitForApprovalMs` if given).

| Parameter | In | Required | Type | What it is |
|---|---|---|---|---|
| `deviceId` | path | yes | string | Stable device id such as `ios:00008120-001A2B3C4D5E6F70` or `android:R58M123ABC`. |
| `Silan-Lease` | header | no | string | Lease token when the device is claimed. |
| `Prefer` | header | no | `respond-async` | Send `respond-async` to get a job instead of waiting. |

Request body: `application/json` (`ActRequest`).

| Field | Type | What it is |
|---|---|---|
| `action` | one of several shapes |  |
| `timeoutMs` | integer |  |
| `waitForApprovalMs` | integer |  |
| `returning` | object |  |

| Response | Means |
|---|---|
| 200 | Completed. `ActResult` |
| 202 | Accepted as a job, or waiting for the person's approval. |
| 4XX | Error (RFC 9457). |
| 5XX | Error (RFC 9457). |

MCP tools on this operation: [`tap`](/reference/mcp/tap/), [`long_press`](/reference/mcp/long-press/), [`swipe`](/reference/mcp/swipe/), [`drag`](/reference/mcp/drag/), [`multi_touch`](/reference/mcp/multi-touch/), [`type_text`](/reference/mcp/type-text/), [`press_key`](/reference/mcp/press-key/), [`dismiss_keyboard`](/reference/mcp/dismiss-keyboard/), [`press_button`](/reference/mcp/press-button/), [`open_system_ui`](/reference/mcp/open-system-ui/), [`launch_app`](/reference/mcp/launch-app/), [`terminate_app`](/reference/mcp/terminate-app/), [`open_url`](/reference/mcp/open-url/), [`rotate`](/reference/mcp/rotate/), [`run_shortcut`](/reference/mcp/run-shortcut/), [`set_text_size`](/reference/mcp/set-text-size/).

## actBatch

`POST /v1/devices/{deviceId}/actions/batch`

Run several actions in order; stops at the first failure

| Parameter | In | Required | Type | What it is |
|---|---|---|---|---|
| `deviceId` | path | yes | string | Stable device id such as `ios:00008120-001A2B3C4D5E6F70` or `android:R58M123ABC`. |
| `Silan-Lease` | header | no | string | Lease token when the device is claimed. |
| `Prefer` | header | no | `respond-async` | Send `respond-async` to get a job instead of waiting. |

Request body: `application/json`.

| Field | Type | What it is |
|---|---|---|
| `actions` | array of one of several shapes |  |
| `pauseMs` | integer |  |
| `returning` | object |  |

| Response | Means |
|---|---|
| 200 | All completed. |
| 202 | Accepted as a job. `Job` |
| 4XX | Error (RFC 9457). |
| 5XX | Error (RFC 9457). |