---
title: "SMTP Monitor aktualisieren"
description: "Aktualisiert einen SMTP Monitor."
---

`PATCH /api/smtp-monitors/:smtpMonitorPublicId`

## Authentifizierung

Erfordert eine gültige Session.

- Header: `Authorization: Bearer <token>`

## Parameter

- `smtpMonitorPublicId` (Pfad, erforderlich): Öffentliche UUID des SMTP Monitors.

## Request Body

Alle Felder sind optional.

```json
{
 "name": "Outbound SMTP (Primary)",
 "hostname": "smtp.deinkunde.com",
 "port": 587,
 "status": "paused",
 "checkInterval": 60,
 "timeoutSeconds": 30,
 "allowedCheckCountryCodes": ["de", "es"],
 "smtpConfig": {
  "secure": false,
  "requireTls": true,
  "auth": {
   "user": "username",
   "pass": "password"
  }
 }
}
```

### Hinweise

- `status` akzeptiert `active`, `maintenance`, `disabled`, `paused`, `inactive`.
 - `paused` und `inactive` werden zu `disabled` normalisiert.
- `allowedCheckCountryCodes` wird zu Uppercase ISO Codes normalisiert (z. B. `DE`, `US`). Leere Listen werden `null`.
- `checkMode` (string, optional): `protocol` (Standard) | `tcp`. Beim Wechsel zu `tcp` werden gespeicherte Zugangsdaten gelöscht: der Monitor führt nur eine reine TCP-Port-Erreichbarkeitsprüfung durch und `smtpConfig` wird nicht gespeichert. Beim Zurückwechseln zu `protocol` läuft wieder die vollständige SMTP-Protokoll-/Auth-Prüfung; neue Zugangsdaten über `smtpConfig`/`config` mitschicken.
- SMTP Config kann als `smtpConfig` oder als `config` (Alias) übergeben werden. Wenn beides fehlt, bleibt die gespeicherte Config unverändert.
- Nutzer mit Rolle `readonly` dürfen nur `status` ändern.

## cURL

```bash
curl -X PATCH "https://YOUR_DOMAIN/api/smtp-monitors/33333333-3333-4333-8333-333333333333" \
 -H "Authorization: Bearer $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
  "status": "disabled"
 }'
```

## Response

```json
{
 "id": 200,
 "organizationId": 1,
 "customerId": 10,
 "name": "Outbound SMTP (Primary)",
 "hostname": "smtp.deinkunde.com",
 "port": 587,
 "status": "disabled",
 "checkInterval": 60,
 "timeoutSeconds": 30,
 "notificationEmail": null,
 "notificationPhoneNumber": null,
 "lastCheckedAt": "2026-01-01T12:00:00.000Z",
 "createdAt": "2026-01-01T12:00:00.000Z",
 "updatedAt": "2026-01-01T12:01:00.000Z",
 "config": {
  "secure": false,
  "requireTls": true,
  "auth": { "user": "username", "pass": "password" }
 },
 "smtpConfig": {
  "secure": false,
  "requireTls": true,
  "auth": { "user": "username", "pass": "password" }
 }
}
```

## Errors

- `400` SMTP Monitor Public ID (UUID) erforderlich
- `401` Unauthorized
- `403` Forbidden (readonly Nutzer dürfen nur `status` ändern; global supporters dürfen nicht aktualisieren)
- `404` Not found

