# REST-API: Desktop

> Die 10 Operationen des Bereichs Desktop, mit Parametern, Bodys und Antworten.

Source: https://pithyx.org/de/docs/reference/api/desktop/
Markdown: https://pithyx.org/de/docs/reference/api/desktop.md

Erzeugt aus dem OpenAPI-Dokument des Daemons. Konventionen, Anmeldung, der CSRF-Header und der WebSocket stehen unter [API](https://pithyx.org/de/docs/developers/daemon/api/).

## GET /api/desktop

**Antworten**

- 200: `application/json`: [DesktopState](https://pithyx.org/de/docs/reference/api/schemas/#desktopstate)

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## PUT /api/desktop/appearance

Saves the accent color and the wallpaper of the signed-in user, for every device. GET /api/desktop returns them.

**Anfrage-Body**: `application/json`: [Appearance](https://pithyx.org/de/docs/reference/api/schemas/#appearance)

**Antworten**

- 204

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## GET /api/desktop/devices

**Antworten**

- 200: `application/json`: [DeviceLayout](https://pithyx.org/de/docs/reference/api/schemas/#devicelayout)[]

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## GET /api/desktop/items

**Antworten**

- 200: `application/json`: [DesktopItem](https://pithyx.org/de/docs/reference/api/schemas/#desktopitem)[]

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## POST /api/desktop/items

Creates an item. The answer is 201 with the item, its URL as Location and its version as ETag.

**Anfrage-Body**: `application/json`: [NewDesktopItem](https://pithyx.org/de/docs/reference/api/schemas/#newdesktopitem)

**Antworten**

- 201: `application/json`: [DesktopItem](https://pithyx.org/de/docs/reference/api/schemas/#desktopitem)

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## PATCH /api/desktop/items/{id}

Changes one item; fields left out stay. Send the item's version from GET /api/desktop/items or the ETag of its last change as If-Match: "n". If the item changed in between (for example on another device), the answer is 412 with desktop.item.conflict and the current version in params.version. Without If-Match the change is unconditional. The new version comes back as ETag.

**Parameter**

| Name       | Ort    | Typ             | Pflicht | Beschreibung |
| ---------- | ------ | --------------- | ------- | ------------ |
| `id`       | path   | integer (int64) | ja      |              |
| `If-Match` | header | string          | nein    |              |

**Anfrage-Body**: `application/json`: [DesktopItemChange](https://pithyx.org/de/docs/reference/api/schemas/#desktopitemchange)

**Antworten**

- 200: `application/json`: [DesktopItem](https://pithyx.org/de/docs/reference/api/schemas/#desktopitem)

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## DELETE /api/desktop/items/{id}

Deletes one item. Deleting an item that does not exist (any more) also answers 204.

**Parameter**

| Name | Ort  | Typ             | Pflicht | Beschreibung |
| ---- | ---- | --------------- | ------- | ------------ |
| `id` | path | integer (int64) | ja      |              |

**Antworten**

- 204

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## PUT /api/desktop/layout

Saves this device's layout. Send the version from GET /api/desktop or the ETag of the last save as If-Match: "n". If another tab saved in between, the answer is 412 with desktop.layout.conflict and the current version in params.version. Without If-Match the save is unconditional. The new version comes back as ETag.

**Parameter**

| Name       | Ort    | Typ    | Pflicht | Beschreibung |
| ---------- | ------ | ------ | ------- | ------------ |
| `If-Match` | header | string | nein    |              |

**Anfrage-Body**: `application/json`: [JsonElement](https://pithyx.org/de/docs/reference/api/schemas/#jsonelement)

**Antworten**

- 204

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## POST /api/desktop/layout/copy

**Anfrage-Body**: `application/json`: [CopyLayoutRequest](https://pithyx.org/de/docs/reference/api/schemas/#copylayoutrequest)

**Antworten**

- 200: `application/json`: [SavedLayout](https://pithyx.org/de/docs/reference/api/schemas/#savedlayout)

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).

## PUT /api/desktop/preferences/{appId}

**Parameter**

| Name    | Ort  | Typ    | Pflicht | Beschreibung |
| ------- | ---- | ------ | ------- | ------------ |
| `appId` | path | string | ja      |              |

**Anfrage-Body**: `application/json`: [WindowPreferenceRequest](https://pithyx.org/de/docs/reference/api/schemas/#windowpreferencerequest)

**Antworten**

- 204

Jeder Fehler antwortet mit Problem Details (`application/problem+json`) und einem stabilen Code aus der [Fehlerreferenz](https://pithyx.org/de/docs/reference/errors/).
