---
title: "Update SMTP Monitor"
description: "Updates an SMTP monitor."
---

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

## Authentication

Requires a valid session.

- Header: `Authorization: Bearer <token>`

## Parameters

- `smtpMonitorPublicId` (Path, required): SMTP monitor public UUID.

## Request Body

All fields are 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"
  }
 }
}
```

### Notes

- `status` accepts `active`, `maintenance`, `disabled`, `paused`, `inactive`.
 - `paused` and `inactive` are normalized to `disabled`.
- `allowedCheckCountryCodes` is normalized to uppercase ISO codes (e.g. `DE`, `US`). Empty lists become `null`.
- `checkMode` (string, optional): `protocol` (default) | `tcp`. Switching to `tcp` clears any stored credentials: the monitor performs a bare TCP port-reachability check and `smtpConfig` is not stored. Switching back to `protocol` re-enables the full SMTP protocol/auth check; supply `smtpConfig`/`config` to set new credentials.
- SMTP config can be provided as `smtpConfig` or as `config` (alias). If neither is provided, the stored config is not changed.
- Users with `readonly` role can only change `status`.

## 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) required
- `401` Unauthorized
- `403` Forbidden (readonly users may only update `status`; global supporters cannot update)
- `404` Not found

