Search the docs
Menu
Updated Edit on GitHub

Console: device-control

Copy as Markdown

These routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.

Screen, keyboard, mouse, clipboard and terminal of a NeoDesk agent.

GET /api/devices/{id}/clipboard

Read the text on a device's clipboard.

Asks the NeoDesk agent over its connection. Needs the clipboard client feature.

Needs device.connect. neodesk device-control clipboard calls it.

Parameter In Type Required What it is
id path string yes The device ID

200: Done (application/json)

AgentAnswer.

Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it
502 The agent answered with an error
503 The agent is not connected (agent_offline)
504 The agent did not answer in time (agent_timeout)

POST /api/devices/{id}/clipboard

Put text on a device's clipboard.

Asks the NeoDesk agent over its connection. Needs the clipboard client feature. Written to the audit log.

Needs device.connect. neodesk device-control clipboard-set calls it.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type What it is
text string at most 1048576 characters

200: Done (application/json)

AgentAnswer.

Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it
413 text is longer than 1 Mi characters
502 The agent answered with an error
503 The agent is not connected (agent_offline)
504 The agent did not answer in time (agent_timeout)

POST /api/devices/{id}/input/key

Press a key on a device.

Asks the NeoDesk agent over its connection. Needs the remote control client feature.

Needs device.connect. neodesk device-control key calls it.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type Required What it is
key string yes at most 32 characters
action string default "press"

200: Done (application/json)

AgentAnswer.

Error When
400 The request is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it
502 The agent answered with an error
503 The agent is not connected (agent_offline)
504 The agent did not answer in time (agent_timeout)

POST /api/devices/{id}/input/mouse

Move or click the mouse on a device.

Asks the NeoDesk agent over its connection. Needs the remote control client feature. Coordinates, screen sizes and wheel steps are cut to whole numbers.

Needs device.connect. neodesk device-control mouse calls it.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type What it is
action string What the mouse does, as the agent knows it; default "move"
button string
x integer
y integer
x_rel number The position as a share of the screen width
y_rel number The position as a share of the screen height
screen_w integer
screen_h integer
wheel_dx integer
wheel_dy integer

200: Done (application/json)

AgentAnswer.

Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it
502 The agent answered with an error
503 The agent is not connected (agent_offline)
504 The agent did not answer in time (agent_timeout)

POST /api/devices/{id}/input/text

Type text on a device.

Asks the NeoDesk agent over its connection. Needs the remote control client feature. Longer text is cut to 4096 characters.

Needs device.connect. neodesk device-control type calls it.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type Required What it is
text string yes at most 4096 characters

200: Done (application/json)

AgentAnswer.

Error When
400 The request is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it
502 The agent answered with an error
503 The agent is not connected (agent_offline)
504 The agent did not answer in time (agent_timeout)

POST /api/devices/{id}/screenshot

Take a picture of a device's screen.

Asks the NeoDesk agent over its connection. Needs the remote control client feature. data holds the JPEG from the agent.

Needs device.connect. neodesk device-control screenshot calls it.

Parameter In Type Required What it is
id path string yes The device ID

200: Done (application/json)

AgentAnswer.

Error When
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it
502 The agent answered with an error
503 The agent is not connected (agent_offline)
504 The agent did not answer in time (agent_timeout)

POST /api/devices/{id}/terminal/execute

Run one command on a device and print what it printed.

Runs one command through the NeoDesk agent, without a terminal session, and waits up to 30 seconds. Needs the terminal client feature. The first 200 characters go into the audit log.

Needs agent.terminal. neodesk device-control run calls it.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type Required What it is
command string yes at most 4096 characters

200: Done (application/json)

AgentAnswer.

Error When
400 The request is not valid
401 No session or API token, or one that is not valid (code session_required or token_invalid)
403 The account or the token may not do this, or a write from a browser came without a good CSRF token
404 There is no such item, or the account does not see it
502 The agent answered with an error
503 The agent is not connected (agent_offline)
504 The agent did not answer in time (agent_timeout)

Type to search pages, sections, commands and settings.