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

# Aufgaben

## Aufgabe lesen

<mark style="color:blue;">`GET`</mark> `https://api.propstack.de/v1/tasks/:id`

#### Request Parameter

| Name    | Type   | Description                                                              |
| ------- | ------ | ------------------------------------------------------------------------ |
| include | string | <p>Standardwert ist:<br><code>clients,units,projects,viewings</code></p> |

{% tabs %}
{% tab title="200" %}

```
{
    "id": 123,
    "title": "Titel"
    ...
}
```

{% endtab %}
{% endtabs %}

## Aufgabe anlegen

<mark style="color:green;">`POST`</mark> `https://api.propstack.de/v1/tasks`

Beim Anlegen einer Aufgabe muss der Parameter `is_reminder` auf `true` gesetzt werden. Außerdem muss mindestens `note_type_id` oder `title` ausgefüllt worden sein, sonst kann die Aufgabe nicht angelegt werden. Alle Parameter zur Aufgabe müssen sich in dem Objekt `task` befinden.

#### Request Body

| Name                   | Type    | Description                                                                                                                                                                               |
| ---------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| task\_\_note\_type\_id | integer | ID des Aufgabentypes der Aufgabe                                                                                                                                                          |
| task\_\_broker\_id     | integer | ID des Nutzers, dem die Aufgabe zugewiesen werden soll                                                                                                                                    |
| task\_\_is\_reminder   | boolean | muss auf `true` gesetzt werden, damit die Aktivität als Aufgabe erkannt wird und nicht als einfache Notiz. Wenn `due_date` gesetzt ist, muss dieses Feld nicht zusätzlich gesetzt werden. |
| task\_\_project\_ids   | array   | Eine Liste von Projekt-IDs, die mit der Aufgabe verknüpft werden sollen                                                                                                                   |
| task\_\_property\_ids  | array   | Eine Liste von Objekt-IDs, die mit der Aufgabe verknüpft werden sollen                                                                                                                    |
| task\_\_client\_ids    | array   | Eine Liste von Kontakt-IDs, die mit der Aufgabe verknüpft werden sollen. In der Regel will man nur einen Kontakt mit der Aufgabe verknüpfen.                                              |
| task\_\_due\_date      | string  | Datum+Uhrzeit, wann die Fälligkeit für die Aufgabe ist                                                                                                                                    |
| task\_\_body           | string  | Weitere Beschreibung zur Aufgabe                                                                                                                                                          |
| task\_\_title          | string  | Titel der Aufgabe                                                                                                                                                                         |
| task                   | object  | Alle Felder zur Aufgabe müssen in einem Task-Objekt umschlossen werden                                                                                                                    |

{% tabs %}
{% tab title="201 Aufgabe wurde erfolgreich angelegt" %}

```javascript
{
    "id": 123,
    "activity_id": 456
}
```

{% endtab %}
{% endtabs %}

#### Beispiel Anfrage:

```javascript
{
    "task": {
        "title": "Kontakt zurückanrufen",
        "note_type_id": 123,
        "broker_id": 2,
        "client_ids": [321]
    }
}
```

## Aufgabe bearbeiten

<mark style="color:green;">`PUT`</mark> `https://api.propstack.de/v1/tasks/:id`

#### Beispiel Anfrage:

```javascript
{
    "task": {
        "title": "Titel",
        "broker_id": 3,
        "client_ids": [322]
    }
}
```

### Aufgabe Löschen

<mark style="color:red;">`DELETE`</mark> `https://api.propstack.de/v1/tasks/:id`

{% tabs %}
{% tab title="200" %}

```json
{
    "ok": true
}
```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.propstack.de/reference/aktivitaeten.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
