Click, type and press keys on the screen

Runs `actions` in order: one action or a batch of up to 100.

POST/v1/sandboxes/{sandbox_id}/screen/actions

Not available yet Seeing and acting on a sandbox's screen is not offered yet. Commands, files and ports work today.

Runs actions in order: one action or a batch of up to 100. Pointer moves, clicks, button presses, drags, wheel scrolls, typed text, key chords (["Control", "c"], pressed in order and released in reverse), single key presses and releases, and waits. Keys are named as the browser's KeyboardEvent.key names them, X's and xdotool's spellings are accepted in any case, and one printable character is its own key. A model's own actions (OpenAI's, Anthropic's, Gemini's) are converted by the SDKs' dialects. Typed text is never logged or stored and never appears in an error: an invalid text names only its field. With mask_in_recording, nothing captured while the call types, or in the second after, is kept in a recording; the span is marked instead. With screenshot, the answer carries a screenshot taken after the last action. The call changes the sandbox, so it takes an Idempotency-Key. A repeat with the same key delivers nothing again. A call whose deadline passes partway answers deadline_exceeded; a repeat with the same key delivers only what the first did not, so nothing is typed twice. While a person holds the screen's takeover, actions are conflict until they hand it back.

A key with the screen:write scope.

Request

curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/screen/actions" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"actions":[{"type":"move","x":0,"y":0}]}'

Parameters

NameInTypeRequiredWhat it is
sandbox_idpathstringYes
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Body

FieldTypeRequiredWhat it is
actionsScreenAction[]Yes
mask_in_recordingbooleanNoLeave what this call types out of any recording. Default false.
screenshotobjectNoAnswer a screenshot taken after the last action.

Answer

200. Every action was delivered.

200
{
  "delivered": 0,
  "screenshot": null
}
FieldTypeAlwaysWhat it is
deliveredintegerYesInput events that reached the screen. At least 0.
screenshotScreenshot | nullYes

Errors

The refusals this call is known for: invalid, not_found, conflict, not_ready, idempotency_key_reused, not_supported, unavailable, deadline_exceeded, in_other_cell, rate_limited. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.

In the SDKs

ClientCall
TypeScriptsandbox.screen.act(actions)
Pythonsandbox.screen.act(actions)