---
title: "Bericht aktualisieren"
description: "Aktualisiert eine Berichtskonfiguration der Organisation. Alle Felder sind optional; mindestens eines muss angegeben werden."
---

`PATCH /api/organization/reports/:id`

Aktualisiert eine Berichtskonfiguration teilweise. `:id` ist die `id` des Berichts (eine UUID). Die Organisation wird aus Ihrer authentifizierten Sitzung oder Ihrem API-Token abgeleitet, und der Bericht muss zu ihr gehören. Erfordert die Rolle **admin** der Organisation (API-Tokens gelten als Organisations-Admins). Nur-Lese-Benutzer können keine Berichte aktualisieren.

Senden Sie nur die Felder, die Sie ändern möchten. Die feldübergreifende Validierung (Zeitplan und Scope) wird gegen das **zusammengeführte** Ergebnis erneut ausgeführt. Ein `PATCH`, der nur `frequency` auf `weekly` setzt, ohne auch `weekday` mitzusenden, schlägt fehl, wenn der bestehende Bericht kein `weekday` gesetzt hat.

## Request-Body

Dieselben Felder wie bei [Bericht erstellen](/de/api/organization/reports/create-report), alle optional, mindestens ein Feld muss aber vorhanden sein:

| Feld | Typ | Hinweise |
|---|---|---|
| `name` | string | 1-200 Zeichen. |
| `enabled` | boolean | |
| `frequency` | `"daily" \| "weekly" \| "monthly"` | |
| `weekday` | integer 0-6 \| null | Praktisch erforderlich, wenn die resultierende `frequency` `weekly` ist. |
| `dayOfMonth` | integer 1-28 \| null | Praktisch erforderlich, wenn die resultierende `frequency` `monthly` ist. |
| `sendHour` | integer 0-23 | |
| `timezone` | string | IANA-Zeitzone. |
| `scopeMode` | `"all" \| "customers" \| "tags"` | |
| `scopeCustomerIds` | integer[] | Müssen zu Ihrer Organisation gehören. |
| `scopeTagIds` | integer[] | Müssen zu Ihrer Organisation gehören. |
| `inclusionMode` | `"all" \| "problems" \| "threshold"` | |
| `problemSignals` | object | `{ incident, downtimeMinutes, sslDaysLt, responseBreach }`. |
| `thresholdUptimeLt` | number \| null | |
| `thresholdResponseGt` | integer (ms) \| null | |
| `sendWhenEmpty` | boolean | |
| `sections` | object | Sechs Booleans zum Ein-/Ausschalten der Abschnitte. |
| `monitorTypes` | string[] | Ein oder mehrere aus `website`, `dns`, `dnsbl`, `domain`, `icmp`, `smtp`, `ssh`, `tcp`, `ftp`, `imap`. Darf nicht als leeres Array gesendet werden. |
| `sectionsByType` | object | Abschnitts-Umschalter pro Typ: `{ "<monitorType>": { "<sectionKey>": boolean } }`. Welche `sectionKey`s zulässig sind, hängt vom Typ ab: siehe [Abschnitts-Schlüssel pro Monitor-Typ](/de/api/organization/reports/create-report#abschnitts-schlüssel-pro-monitor-typ). Wird ein für seinen Typ unzulässiger Abschnitts-Schlüssel gesendet, schlägt die Anfrage mit `400 Bad Request` fehl. |
| `groupByCustomer` | boolean | Untergliedert die Tabelle jedes Monitor-Typs zusätzlich nach Kunde. |
| `format` | `"email" \| "email_pdf"` | |
| `recipientEmails` | string[] | Max. 50. |
| `recipientUserIds` | string[] | Max. 50. |

## Beispiel (cURL)

```bash
BASE_URL="https://uptimeify.io"
TOKEN="<ihr-api-token>"
REPORT_ID="3f1c9c1e-8d2a-4c7e-9b1a-2d5f6a7b8c90"

curl -X PATCH "$BASE_URL/api/organization/reports/$REPORT_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false,
    "recipientEmails": ["ops@agentur.io", "cs@agentur.io"]
  }'
```

## Antwort

```json
{
  "id": "3f1c9c1e-8d2a-4c7e-9b1a-2d5f6a7b8c90",
  "name": "Wöchentlicher Ops-Bericht",
  "enabled": false,
  "frequency": "weekly",
  "weekday": 1,
  "dayOfMonth": null,
  "sendHour": 2,
  "timezone": "Europe/Berlin",
  "scopeMode": "all",
  "inclusionMode": "problems",
  "monitorTypes": ["website", "dns", "dnsbl", "domain", "icmp", "smtp", "ssh", "tcp", "ftp", "imap"],
  "sectionsByType": {},
  "groupByCustomer": false,
  "format": "email_pdf",
  "recipientEmails": ["ops@agentur.io", "cs@agentur.io"],
  "recipientUserIds": []
}
```

## Häufige Fehler

- `401 Unauthorized`: nicht authentifiziert.
- `403 Forbidden` (`forbidden`): kein Organisations-Admin.
- `404 Not Found` (`notFound`): es existiert kein Bericht mit dieser ID für Ihre Organisation.
- `400` (`invalidReportSchedule`): die resultierende `weekly`-Konfiguration hat kein `weekday`, oder die resultierende `monthly`-Konfiguration hat kein `dayOfMonth`.
- `400` (`invalidReportScope`): Scope-IDs gehören nicht zu Ihrer Organisation, oder der resultierende `threshold`-Modus hat keinen Schwellenwert.
- `400 Bad Request`: ein `sectionsByType`-Eintrag enthält einen `sectionKey`, der für seinen Monitor-Typ nicht zulässig ist, oder `monitorTypes` wird als leeres Array gesendet.
