Skip to content
Dashboard

Execute single action

POST/computers/{id}/execute

Execute a single action such as screenshot, click, type, navigate, scroll, debug, set_viewport, get_html_content or other computer use actions

Path ParametersExpand Collapse
id: string
Body ParametersJSONExpand Collapse
action: optional ComputerAction { auto_detect_encoding, base64, button, 22 more }
auto_detect_encoding: optional boolean

For get_html_content

base64: optional boolean

For screenshot

button: optional string
debug: optional object { command, cwd, env, 4 more }
command: optional string
cwd: optional string
env: optional map[string]
max_output_length: optional number
request_id: optional string
stream: optional boolean
timeout_seconds: optional number
dx: optional number

For scrolling

dy: optional number
height: optional number
include_context: optional boolean

Include page context in response

key: optional string

For key_down/key_up

keys: optional array of string
ms: optional number
proxy_url: optional string
request_id: optional string

RequestId is used for correlating streaming output to the originating request. Set on ActionRequest, not individual action types.

scale_factor: optional number
tab_id: optional string

For tab management (browser sessions only)

text: optional string
type: optional string

click|double_click|right_click|drag|type|keypress|scroll|wait|screenshot|go_to_url|debug|get_html_content|set_viewport|list_tabs|new_tab|switch_tab|close_tab|key_down|key_up|mouse_down|mouse_up

url: optional string
width: optional number

For set_viewport

x: optional number
x1: optional number

For dragging/scrolling

x2: optional number

For dragging

y: optional number
y1: optional number
y2: optional number
ReturnsExpand Collapse
ActionResult = object { error_message, executed_tab_id, page_context, 4 more }
error_message: optional string
executed_tab_id: optional string
page_context: optional V2GoBackendInternalTypesPageContext { device_scale_factor, is_main_tab, page_height, 8 more }
device_scale_factor: optional number
is_main_tab: optional boolean
page_height: optional number
page_width: optional number
scroll_x: optional number
scroll_y: optional number
tab_id: optional string
title: optional string
url: optional string
viewport_height: optional number
viewport_width: optional number
request_id: optional string
result: optional map[unknown]
status: optional string
timestamp: optional string

Execute single action

curl https://api.tzafon.ai/computers/$ID/execute \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TZAFON_API_KEY" \
    -d '{}'
{
  "error_message": "error_message",
  "executed_tab_id": "executed_tab_id",
  "page_context": {
    "device_scale_factor": 0,
    "is_main_tab": true,
    "page_height": 0,
    "page_width": 0,
    "scroll_x": 0,
    "scroll_y": 0,
    "tab_id": "tab_id",
    "title": "title",
    "url": "url",
    "viewport_height": 0,
    "viewport_width": 0
  },
  "request_id": "request_id",
  "result": {
    "foo": "bar"
  },
  "status": "status",
  "timestamp": "timestamp"
}
Returns Examples
{
  "error_message": "error_message",
  "executed_tab_id": "executed_tab_id",
  "page_context": {
    "device_scale_factor": 0,
    "is_main_tab": true,
    "page_height": 0,
    "page_width": 0,
    "scroll_x": 0,
    "scroll_y": 0,
    "tab_id": "tab_id",
    "title": "title",
    "url": "url",
    "viewport_height": 0,
    "viewport_width": 0
  },
  "request_id": "request_id",
  "result": {
    "foo": "bar"
  },
  "status": "status",
  "timestamp": "timestamp"
}