Lybic Docs

Execute Computer Use or Mobile Use action

Executes a computer use or mobile use action on the sandbox.

POST
/api/orgs/{orgId}/sandboxes/{sandboxId}/actions/execute

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".

relative?boolean

Whether the coordinates are relative to the current mouse position.

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".

relative?boolean

Whether the coordinates are relative to the current mouse position.

Triple click the mouse at the specified coordinates

typestring
Value in"mouse:tripleClick"
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 triple click, in xdotool key syntax. Example: "ctrl", "alt", "alt+shift".

relative?boolean

Whether the coordinates are relative to the current mouse position.

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".

relative?boolean

Whether the coordinates are relative to the current mouse position.

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".

relative?boolean

Whether the coordinates are relative to the current mouse position.

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

button?number

Mouse button index

holdKey?string

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

startRelative?boolean

Whether the coordinates are relative to the current mouse position.

endRelative?boolean

Whether the coordinates are relative to the current mouse position.

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

All possible mobile use actions, with optional callId

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"

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

Tap the screen at the specified coordinates

typestring
Value in"touch:tap"
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

Touch and hold at start coordinates, then move to end coordinates and release

typestring
Value in"touch: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

Swipe the screen in a specified direction by a specified distance

typestring
Value in"touch:swipe"
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

directionstring

Scroll direction

Value in"up" | "down" | "left" | "right"
distanceobject

Scroll distance

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

Long press the screen at the specified coordinates

typestring
Value in"touch:longPress"
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

durationnumber

Duration in milliseconds

Press the back button

typestring
Value in"android:back"

Press the home button

typestring
Value in"android:home"

List all installed apps

typestring
Value in"os:listApps"

Start an app by its package name

typestring
Value in"os:startApp"
packageNamestring

App package name

Start an app by its name

typestring
Value in"os:startAppByName"
namestring

App name

Close the current app

typestring
Value in"os:closeApp"
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. On some cursor-less devices, only width and height are meaningful.

Defaulttrue

Response Body

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