---
title: "IMAP/POP Monitor aktualisieren"
description: "Aktualisiert einen IMAP/POP Monitor und/oder ändert den Status."
---

`PATCH /api/imap-pop-monitors/:imapPopMonitorPublicId`

## Authentifizierung

Erfordert eine gültige Session.

- Header: `Authorization: Bearer <token>`

## Parameter

- `imapPopMonitorPublicId` (Pfad, erforderlich): Öffentliche UUID des IMAP/POP Monitors.

## Request Body

- `status` (optional)
 - Erlaubt: `active`, `maintenance`, `disabled`, `paused`, `inactive`
 - Hinweis: `paused` / `inactive` werden zu `disabled` normalisiert.
- `name`, `hostname`, `port`, `checkInterval`, `timeoutSeconds` (optional)
- `allowedCheckCountryCodes` (optional)
 - Wird zu Uppercase normalisiert und dedupliziert.
- `checkMode` (optional)
 - Erlaubt: `protocol` | `tcp`. Muss einer dieser beiden Werte sein, sonst schlägt der Request mit `400` / `data.code: "invalidCheckMode"` fehl.
 - Beim Wechsel zu `tcp` werden gespeicherte Zugangsdaten gelöscht: der Monitor führt nur eine reine TCP-Port-Erreichbarkeitsprüfung durch und `imapPopConfig` wird nicht gespeichert. Beim Zurückwechseln zu `protocol` läuft wieder die vollständige IMAP/POP-Login-Prüfung; neue Zugangsdaten über `imapPopConfig`/`config` mitschicken.
 - **`port` ist erforderlich, wenn der resultierende `checkMode` `tcp` ist** (egal ob gerade in diesem Request gesetzt oder bereits am Monitor gespeichert). Ist kein Port vorhanden, schlägt der Request mit `400` / `data.code: "portRequiredForTcp"` fehl.
- `imapPopConfig` (optional)
 - Alias für das gespeicherte `config` JSON.
- `config` (optional)
 - Alternative, um dasselbe gespeicherte `config` JSON zu aktualisieren.

Hinweis: Read-only Nutzer dürfen nur `status` ändern (bei anderen Feldern kommt `403`).

```json
{ "status": "active" }
```

Beispiel für Config-Update:

```json
{
 "imapPopConfig": {
  "protocol": "pop3",
  "tls": true,
  "user": "monitor@deinkunde.com",
  "password": "password"
 }
}
```

## Response

```json
{
 "id": 500,
 "organizationId": 1,
 "customerId": 10,
 "name": "Mailbox Access",
 "hostname": "mail.deinkunde.com",
 "port": 993,
 "checkInterval": 30,
 "timeoutSeconds": 30,
 "status": "active",
 "notificationPhoneNumber": null,
 "notificationEmail": null,
 "lastCheckedAt": null,
 "createdAt": "2026-02-26T12:00:00.000Z",
 "updatedAt": "2026-02-26T12:05:00.000Z",
 "config": { "protocol": "pop3", "tls": true, "user": "monitor@deinkunde.com", "password": "password" },
 "imapPopConfig": { "protocol": "pop3", "tls": true, "user": "monitor@deinkunde.com", "password": "password" }
}
```

## Errors

- `400` Ungültiger Request Body, ungültiger Status oder ungültiger Hostname
- `401` Unauthorized
- `403` Forbidden (z.B. `readonly` oder global supporter)
- `404` IMAP/POP monitor not found

