> For the complete documentation index, see [llms.txt](https://docs.polyteia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.polyteia.com/api-docs/workspace.md).

# Arbeitsbereich

Hier finden Sie Informationen zu allen API-Befehlen und -Abfragen im Zusammenhang mit Arbeitsbereichen.

## Abfragen

***

### <mark style="background-color:yellow;">get\_workspace</mark>

Ruft die Details eines Arbeitsbereichs ab.

#### Parameter

* `id` (erforderlich): Die ID des Arbeitsbereichs.

#### Beispiel

```bash
curl -X POST 'https://app.polyteia.com/api' \
    -header "Content-Type: application/json" \
    -header "Authorization: Bearer <your_access_token>" \
    --data '{
        "query": "get_workspace",
        "params": {
            "id": "ws_cv33u4n0i6q45p93i930"
        }
    }'
```

#### **Arbeitsbereich-Antwort**

* `id`: Die ID des Arbeitsbereichs.
* `organization_id`: Die ID der Organisation, zu der der Arbeitsbereich gehört.
* `created_at`: Datum und Uhrzeit der Erstellung des Arbeitsbereichs.
* `updated_at`: Datum und Uhrzeit der letzten Aktualisierung des Arbeitsbereichs.
* `name`: Der Name des Arbeitsbereichs.
* `description`: Die Beschreibung des Arbeitsbereichs.
* `attributes`: Optionale Schlüssel-Wert-Paare, die dem Arbeitsbereich zugeordnet sind.

#### Beispielantwort

```json
{
    "data": {
        "id": "ws_cv33u4n0i6q45p93i930",
        "organization_id": "org_cv33u4n0i6q45p93i930",
        "created_at": "2025-03-24T15:12:49.186202Z",
        "updated_at": "2025-03-24T20:01:59.408382Z",
        "name": "Finanzen",
        "description": "Arbeitsbereich der Finanzabteilung",
        "attributes": {
            "key": "value"
        }
    }
}
```

***

### <mark style="background-color:yellow;">list\_workspaces</mark>

Seitenweise Auflistung aller Arbeitsbereiche, auf die der Benutzer Zugriff hat.

#### Parameter

* `page` (erforderlich): Die zurückzugebende Seitennummer. `minimum: 1`
* `size` (erforderlich): Die Anzahl der Elemente pro Seite. `minimum: 1, maximum: 100`

#### Beispiel

```bash
curl -X POST 'https://app.polyteia.com/api' \
    -header "Content-Type: application/json" \
    -header "Authorization: Bearer <your_access_token>" \
    --data '{
        "query": "list_workspaces",
        "params": {
            "page": 1,
            "size": 10
        }
    }'
```

#### Antwort

* `total`: Die Gesamtanzahl der Arbeitsbereiche, auf die der Benutzer Zugriff hat.
* `page`: Die aktuelle Seitennummer.
* `size`: Die angeforderte Anzahl von Elementen pro Seite.
* `items`: Ein Array von Arbeitsbereichen. Weitere Details finden Sie unter [Arbeitsbereich-Antwort](#arbeitsbereich-antwort).

#### Beispielantwort

```json
{
    "data": {
        "total": 1,
        "page": 1,
        "size": 100,
        "items": [
            {
                "id": "ws_cv33u4n0i6q45p93i930",
                "organization_id": "org_cv33u4n0i6q45p93i930",
                "created_at": "2025-03-24T15:12:49.186202Z",
                "updated_at": "2025-03-24T20:01:59.408382Z",
                "name": "Finanzen",
                "description": "Arbeitsbereich der Finanzabteilung"
            }
        ]
    }
}
```

## Befehle

***

### <mark style="background-color:yellow;">create\_workspace</mark>

Verwenden Sie diesen Befehl, um einen neuen Arbeitsbereich zu erstellen.

#### Parameter

* `organization_id` (erforderlich): Die ID der Organisation, in der der Arbeitsbereich erstellt werden soll.
* `name` (erforderlich): Name des Arbeitsbereichs. `minimum: 1` `maximum: 50` `nur Unicode-Zeichen`
* `description` (optional): Beschreibung des Arbeitsbereichs. `maximum: 255` `nur Unicode-Zeichen`
* `attributes` (optional): Optionale Schlüssel-Wert-Paare, die dem Arbeitsbereich zugeordnet werden sollen.

#### Beispiel

```bash
curl -X POST 'https://app.polyteia.com/api' \
    -header "Content-Type: application/json" \
    -header "Authorization: Bearer <your_access_token>" \
    --data '{
        "query": "create_workspace",
        "params": {
            "organization_id": "org_cv33u4n0i6q45p93i930",
            "name": "Finanzen",
            "description": "Arbeitsbereich der Finanzabteilung",
            "attributes": {
                "key1": "value1",
                "key2": 100,
                "key3": {
                    "nested": true
                }
            }
        }
    }'
```

#### Antwort

Die Antwort ist die [Arbeitsbereich-Antwort](#arbeitsbereich-antwort) des erstellten Arbeitsbereichs.

#### Beispielantwort

```json
{
    "data": {
        "id": "ws_cv33u4n0i6q45p93i930",
        "organization_id": "org_cv33u4n0i6q45p93i930",
        "created_at": "2025-03-24T15:12:49.186202Z",
        "updated_at": "2025-03-24T20:01:59.408382Z",
        "name": "Finanzen",
        "description": "Arbeitsbereich der Finanzabteilung",
        "attributes": {
            "key": "value"
        }
    }
}
```

Speichern Sie die `id` für spätere Referenzen oder Aktualisierungen des Arbeitsbereichs.

***

### <mark style="background-color:yellow;">update\_workspace</mark>

Verwenden Sie diesen Befehl, um einen Arbeitsbereich zu aktualisieren.

#### Parameter

* `id` (erforderlich): Die ID des zu aktualisierenden Arbeitsbereichs.
* `name` (erforderlich): Der Name des Arbeitsbereichs.
* `description` (optional): Die Beschreibung des Arbeitsbereichs.
* `attributes` (optional): Ein JSON-Objekt mit Schlüssel-Wert-Paaren, die dem Arbeitsbereich hinzugefügt werden sollen.

#### Beispiel

```bash
curl -X POST 'https://app.polyteia.com/api' \
    -header "Content-Type: application/json" \
    -header "Authorization: Bearer <your_access_token>" \
    --data '{
        "query": "update_workspace",
        "params": {
            "id": "ws_cv33u4n0i6q45p93i930",
            "name": "Mein Arbeitsbereich",
            "description": "Beschreibung meines Arbeitsbereichs",
            "attributes": {
                "key": "new_value"
            }
        }
    }'
```

#### Antwort

Die Antwort ist die [Arbeitsbereich-Antwort](#arbeitsbereich-antwort) des aktualisierten Arbeitsbereichs.

#### Beispielantwort

```json
{
    "data": {
        "id": "ws_cv33u4n0i6q45p93i930",
        "organization_id": "org_cv33u4n0i6q45p93i930",
        "created_at": "2025-03-24T15:12:49.186202Z",
        "updated_at": "2025-03-24T20:01:59.408382Z",
        "name": "Mein Arbeitsbereich",
        "description": "Beschreibung meines Arbeitsbereichs",
        "attributes": {
            "key": "new_value"
        }
    }
}
```

***

### <mark style="background-color:yellow;">delete\_workspace</mark>

Verwenden Sie diesen Befehl, um einen Arbeitsbereich zu löschen.

{% hint style="danger" %}
**Diese Aktion ist nicht rückgängig zu machen. Verwenden Sie diesen Befehl mit Vorsicht.**
{% endhint %}

#### Parameter

* `id` (erforderlich): Die ID des zu löschenden Arbeitsbereichs.

#### Beispiel

```bash
curl -X POST 'https://app.polyteia.com/api' \
    -header "Content-Type: application/json" \
    -header "Authorization: Bearer <your_access_token>" \
    --data '{
        "query": "delete_workspace",
        "params": {
            "id": "ws_cv33u4n0i6q45p93i930"
        }
    }'
```

#### Antwort

Die Antwort ist die [Arbeitsbereich-Antwort](#arbeitsbereich-antwort) des gelöschten Arbeitsbereichs.

```json
{
    "data": {
        "id": "ws_cv33u4n0i6q45p93i930"
    }
}
```

* `id`: Die ID des gelöschten Arbeitsbereichs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.polyteia.com/api-docs/workspace.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
