# Server-API: strategies

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

> 6 Operationen. The server's copy of the strategies it hands to RustDesk clients, and whom they are given to.

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 server's copy of the strategies it hands to RustDesk clients, and whom they are given to.

## GET /api/strategies

List strategies.

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

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

| Field | Type |
|---|---|
| `data` | array of [ServerStrategy](https://docs.neode.sk/de/development/api-reference/schemas.md#serverstrategy) |
| `total` | integer |

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

## POST /api/strategies

Make a strategy, or replace one by its guid.

Without guid makes a new strategy; with guid replaces that strategy's fields. The answer has permissions as JSON text, not as an object.

On the server API, port 21114. Only for the role `super_admin or admin or global_admin`.

Request body, `application/json`:

| Field | Type | Required | What it is |
|---|---|---|---|
| `guid` | string |  | The strategy to replace; a new one when empty |
| `name` | string | yes |  |
| `user_group_guid` | string |  |  |
| `device_group_guid` | string |  |  |
| `enabled` | boolean |  | default `true` |
| `permissions` | object |  | true or Y allows a feature, false or N forbids it; other keys and values are dropped |
| `permissions.enable-file-transfer` | boolean or string, one of `true`, `false`, `Y`, `N`, `y`, `n` |  |  |
| `permissions.disable-clipboard` | boolean or string, one of `true`, `false`, `Y`, `N`, `y`, `n` |  |  |
| `permissions.enable-clipboard` | boolean or string, one of `true`, `false`, `Y`, `N`, `y`, `n` |  |  |
| `permissions.enable-audio` | boolean or string, one of `true`, `false`, `Y`, `N`, `y`, `n` |  |  |
| `permissions.enable-tunnel` | boolean or string, one of `true`, `false`, `Y`, `N`, `y`, `n` |  |  |
| `permissions.enable-camera` | boolean or string, one of `true`, `false`, `Y`, `N`, `y`, `n` |  |  |
| `permissions.enable-remote-restart` | boolean or string, one of `true`, `false`, `Y`, `N`, `y`, `n` |  |  |
| `permissions.enable-block-input` | boolean or string, one of `true`, `false`, `Y`, `N`, `y`, `n` |  |  |

**200**: The strategy as saved (`application/json`)

| Field | Type | What it is |
|---|---|---|
| `id` | integer | 0 for a new strategy |
| `guid` | string |  |
| `name` | string |  |
| `user_group_guid` | string |  |
| `device_group_guid` | string |  |
| `enabled` | boolean |  |
| `permissions` | string | The permissions as JSON text |
| `created_at` | string or null (date-time) | null for a new strategy |
| `updated_at` | string or null (date-time) | null for a new strategy |

| Error | When |
|---|---|
| 400 | The body is not JSON, name is required, or permissions is no object (invalid strategy permissions) |
| 401 | No credential, or one that is not valid |
| 403 | The caller is not a super admin or global admin (Insufficient permissions) |
| 404 | No strategy has that guid (Strategy not found) |

## POST /api/strategies/assign

Give a strategy to devices, accounts or device groups, or take it away.

Makes strategy the strategy of each target, in place of the one it had. Without strategy, removes the strategy given directly to each target.

On the server API, port 21114. Only for the role `super_admin or admin or global_admin`.

Request body, `application/json`:

At least one of peers, users and groups must have an entry.

| Field | Type | What it is |
|---|---|---|
| `strategy` | string | The strategy guid; empty or missing takes the targets' strategies away |
| `peers` | array of string | Devices, by id, guid or uuid |
| `users` | array of string | Accounts, by guid, username or id |
| `groups` | array of string | Device groups, by guid or name |

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

| Field | Type |
|---|---|
| `status` | `"ok"` |

| Error | When |
|---|---|
| 400 | The body is not JSON, at least one target is required, a target names nothing (peer not found, user not found, device group not found), or strategy not found |
| 401 | No credential, or one that is not valid |
| 403 | The caller is not a super admin or global admin (Insufficient permissions) |

## GET /api/strategies/{guid}

Show a strategy with whom it is given to.

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

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `guid` | path | string | yes | The strategy guid |

**200**: The strategy; peers, users and groups are left out when empty (`application/json`)

[ServerStrategy](https://docs.neode.sk/de/development/api-reference/schemas.md#serverstrategy) and [StrategyAssignmentSummary](https://docs.neode.sk/de/development/api-reference/schemas.md#strategyassignmentsummary).

| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 404 | No strategy has that guid (Strategy not found) |

## DELETE /api/strategies/{guid}

Delete a strategy and its assignments.

On the server API, port 21114. Only for the role `super_admin or admin or global_admin`.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `guid` | path | string | yes | The strategy guid |

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

| Field | Type |
|---|---|
| `status` | `"deleted"` |

| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The caller is not a super admin or global admin (Insufficient permissions) |
| 404 | No strategy has that guid (Strategy not found) |

## PUT /api/strategies/{guid}/status

Turn a strategy on or off.

The body is the bare JSON value true or false; anything but true turns the strategy off.

On the server API, port 21114. Only for the role `super_admin or admin or global_admin`.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `guid` | path | string | yes | The strategy guid |

Request body, `application/json`:

Boolean.

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

| Field | Type |
|---|---|
| `status` | `"ok"` |

| Error | When |
|---|---|
| 400 | The body could not be read (invalid body) |
| 401 | No credential, or one that is not valid |
| 403 | The caller is not a super admin or global admin (Insufficient permissions) |
| 404 | No strategy has that guid (strategy not found) |
