# Konsole: device-control

Quelle: https://docs.neode.sk/de/development/api-reference/console-device-control/
Zuletzt geändert: 2026-12-03

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

Diese Routen liegen auf der Konsole, Port 3375. Sie nehmen ein API-Token als `Authorization: Bearer ndt_...`; siehe [API-Tokens](https://docs.neode.sk/de/command-line/api-tokens.md). Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.

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](https://docs.neode.sk/de/development/api-reference/schemas.md#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](https://docs.neode.sk/de/development/api-reference/schemas.md#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](https://docs.neode.sk/de/development/api-reference/schemas.md#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](https://docs.neode.sk/de/development/api-reference/schemas.md#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](https://docs.neode.sk/de/development/api-reference/schemas.md#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](https://docs.neode.sk/de/development/api-reference/schemas.md#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](https://docs.neode.sk/de/development/api-reference/schemas.md#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) |
