Lybic Docs

Execute Computer Use Action

Executes a computer use action on the sandbox.

POST
/api/orgs/{orgId}/sandboxes/{sandboxId}/actions/computer-use

Path Parameters

sandboxIdstring
orgIdstring

The organization ID

actionobject

All possible computer use actions, with optional callId

Click the mouse at the specified coordinates

typestring
Value in"mouse:click"
xobject

X coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

yobject

Y coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

buttonnumber

Mouse button flag combination. 1: left, 2: right, 4: middle, 8: back, 16: forward; add them together to press multiple buttons at once.

holdKey?string

Key to hold down during click, in xdotool key syntax. Example: "ctrl", "alt", "alt+shift".

Double click the mouse at the specified coordinates

typestring
Value in"mouse:doubleClick"
xobject

X coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

yobject

Y coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

buttonnumber

Mouse button index

holdKey?string

Key to hold down during double click, in xdotool key syntax. Example: "ctrl", "alt", "alt+shift".

Move the mouse to the specified coordinates

typestring
Value in"mouse:move"
xobject

X coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

yobject

Y coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

holdKey?string

Key to hold down during move, in xdotool key syntax. Example: "ctrl", "alt", "alt+shift".

Scroll the mouse

typestring
Value in"mouse:scroll"
xobject

X coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

yobject

Y coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

stepVerticalnumber

Vertical scroll steps

stepHorizontalnumber

Horizontal scroll steps

holdKey?string

Key to hold down during scroll, in xdotool key syntax. Example: "ctrl", "alt", "alt+shift".

Drag the mouse from start to end coordinates

typestring
Value in"mouse:drag"
startXobject

Start X coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

startYobject

Start Y coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

endXobject

End X coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

endYobject

End Y coordinate

Length in pixels

typestring

Indicates the unit is pixel

Value in"px"
valuenumber

Length in pixels

Length as a fraction

typestring
Value in"/"
numeratornumber

Numerator of the fraction

denominatornumber

Denominator of the fraction

holdKey?string

Key to hold down during drag, in xdotool key syntax. Example: "ctrl", "alt", "alt+shift".

Type text content

typestring
Value in"keyboard:type"
contentstring

Text content to type

treatNewLineAsEnterboolean | null

Whether to treat line breaks as enter. If true, any line breaks(\n) in content will be treated as enter key press, and content will be split into multiple lines.

Defaultfalse

Press a keyboard hotkey

typestring
Value in"keyboard:hotkey"
keysstring

Hotkey combination, in xdotool key syntax. Examples: "a", "Return", "alt+Tab", "ctrl+s", "Up", "KP_0" (for the numpad 0 key).

duration?number

Duration in milliseconds. If specified, the hotkey will be held for a while and then released.

Range1 <= value <= 5000

Take a screenshot of the current screen

typestring
Value in"screenshot"

Wait for a specified duration

typestring
Value in"wait"
durationnumber

Duration in milliseconds

Indicates the action has finished

typestring
Value in"finished"
message?string

Completion message

Indicates the action has failed

typestring
Value in"failed"
message?string

Failure message

Indicates the human user should take over the control

typestring
Value in"client:user-takeover"

Press ONE key down, in xdotool key syntax. Only use this action if hotkey or type cannot satisfy your needs.

typestring
Value in"key:down"
keystring

Key to press

Release ONE key, in xdotool key syntax. Only use this action if keydown cannot satisfy your needs and only after a key down.

typestring
Value in"key:up"
keystring

Key to release

includeScreenShot?boolean

Whether to include the screenshot url after action in the response

Defaulttrue
includeCursorPosition?boolean

Whether to include the cursor position after action in the response

Defaulttrue

Response Body

{
  "screenShot": "http://example.com",
  "cursorPosition": {
    "x": 0,
    "y": 0,
    "screenWidth": 0,
    "screenHeight": 0,
    "screenIndex": 0
  }
}