---
search:
  tags:
    - alerts
    - PUT
seo:
  description: >-
    Replaces the settings. An omitted password keeps the stored one. The…
    Reference for the PUT /api/v1/alert-smtp endpoint in the TimescaleDB
    Enterprise API.
  noindex: true
sidebar:
  label: Set the SMTP settings
  badge: PUT
title: Set the SMTP settings
type: openapi-operation
---
Replaces the settings. An omitted password keeps the stored one. The password is stored encrypted. Authentication needs TLS: STARTTLS (requireTls) or port 465.

`PUT /api/v1/alert-smtp`

**Request body** (`application/json`, required)

- `authPassword` (string) — Omit to keep the stored password; empty string clears it
- `authUsername` (string) — Omit for no authentication
- `from` (string, required) — Sender address
- `hello` (string) — Name sent in EHLO. Omit for the default
- `requireTls` (boolean) — Require STARTTLS. Omit for true. Port 465 always uses TLS
- `smarthost` (string, required) — host:port of the SMTP server. Port 465 uses implicit TLS

Request body example:

```json
{
  "authPassword": "string",
  "authUsername": "string",
  "from": "string",
  "hello": "string",
  "requireTls": true,
  "smarthost": "string"
}
```

**Responses**

- `200` — OK
- `default` — Error

Response example, 200:

```json
{
  "authUsername": "string",
  "configured": true,
  "from": "string",
  "hello": "string",
  "passwordSet": true,
  "passwordUnreadable": true,
  "requireTls": true,
  "smarthost": "string"
}
```
