Docs
Desktop ›

Get desktop

GET/v1/sandboxes/{id}/desktop

Whether a desktop is turned on for the sandbox, whether it is running, and where it is watched. It changes nothing, and is answered whatever state the sandbox is in.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. const desktop = await sandbox.desktop.get();
Answer200 OK · DesktopState
  1. {
  2. "enabled": boolean,
  3. "enabledAt": string | null,
  4. "running": boolean,
  5. "width": integer | null,
  6. "height": integer | null,
  7. "display": string | null,
  8. "url": string | null,
  9. }

Whether the desktop is on, the size of its screen, and the address to watch it at while it runs.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 Whether the desktop is on, the size of its screen, and the address to watch it at while it runs.

DesktopState7 fields
enabled
boolean
Whether a desktop is turned on for the sandbox.
More It stays so through a stop and a start, and a move to another server: the desktop is started again by itself, with nothing open on it.
enabledAt
stringnull
Since when it is on.
More Null when it is off.
running
boolean
Whether the desktop is running in the sandbox's machine now.
More False while it is off, while the sandbox is not running, and in the moments after a start before it is up again.
width
integernull
The width of its screen in pixels.
More Null while it is off.
height
integernull
The height of its screen in pixels.
More Null while it is off.
display
stringnull
What DISPLAY is to be for a command that opens a window on the desktop, or takes a picture of it.
More Null while it is off.
url
stringnull
Where the desktop is watched and used, in a browser.
More It needs no token and is hard to guess, and whoever has it sees the screen and can click and type on it, so it is to be kept as a password is. It is another each time the desktop is turned on. Null while the desktop is not running, and where GET /v1/policy says publicUrls is false.

Errors and other answers

404 Not found.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.