# Server-API: desktop agents

Quelle: https://docs.neode.sk/de/development/api-reference/server-desktop-agents/
Zuletzt geändert: 2026-12-03

> 3 Operationen. The management channel of NeoDesk desktop clients: which are connected, and messages to them.

Diese Routen liegen auf der Server-API, Port 21114 (21121 in Docker). Sie nehmen einen API-Schlüssel in `X-API-Key` oder ein Anmelde-Token; siehe [Die HTTP-API](https://docs.neode.sk/de/development/api.md#signing-in). Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.

The management channel of NeoDesk desktop clients: which are connected, and messages to them.

## GET /api/nd/mgmt/connected

List the NeoDesk desktop clients connected to the management channel.

Lists every connected device; the list is not narrowed to the devices the caller sees.

On the server API, port 21114. Needs `device.view`.

**200**: The connected devices (`application/json`)

| Field | Type | What it is |
|---|---|---|
| `devices` | array of string | Device IDs |
| `count` | integer |  |

| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |

## POST /api/nd/mgmt/{device_id}/send

Send a message to a device's desktop client.

Hands the message to the client and answers at once; nothing comes back here. A message can make the client do anything its management channel allows, so the route asks the terminal permission.

On the server API, port 21114. Needs `agent.terminal`.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `device_id` | path | string | yes | The device ID |

Request body, `application/json`:

The message goes to the client as it is, with device_id set from the path.

| Field | Type | What it is |
|---|---|---|
| `type` | string | The message type the client acts on |
| `timestamp` | string (date-time) |  |
| `payload` |  | The message content, any JSON |

**200**: Sent (`application/json`)

| Field | Type |
|---|---|
| `sent` | `true` |

| Error | When |
|---|---|
| 400 | The body is not valid JSON (plain text) |
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 404 | The device is not connected, or its send queue is full (plain text) |

## GET /api/nd/mgmt/{device_id}/status

Show whether a device's desktop client is connected to the management channel.

On the server API, port 21114. Needs `device.view`.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `device_id` | path | string | yes | The device ID |

**200**: The state (`application/json`)

| Field | Type |
|---|---|
| `device_id` | string |
| `connected` | boolean |

| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
