# Server API: desktop agents

Source: https://docs.neode.sk/development/api-reference/server-desktop-agents/
Last updated: 2026-12-03

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

These routes are on the server API, port 21114 (21121 in Docker). They take an API key in `X-API-Key` or a sign-in token; see [The HTTP API](https://docs.neode.sk/development/api.md#signing-in).

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 |
