---
title: "Update SMTP configuration"
method: PUT
path: "/api/auth/smtp-config"
tags: ["Admin"]
---

# Update SMTP configuration

`PUT /api/auth/smtp-config`

Create or update SMTP email configuration (admin only).
When `enabled` is true, the fields `host`, `username`, `senderEmail`, and `senderName` are required by the backend validation.
When `enabled` is false, these fields may be empty.
SMTP cannot be disabled on a self-hosted instance while email verification is required, unless a managed email provider is available.

## Request body

- object
  - `enabled` boolean, required — When true, host/username/senderEmail/senderName become required
  - `host` string — Required when enabled is true
  - `port` 25 | 465 | 587 | 2525, required
  - `username` string — Required when enabled is true
  - `password` string — SMTP password (optional on update if unchanged)
  - `senderEmail` string, email — Required when enabled is true
  - `senderName` string — Required when enabled is true
  - `minIntervalSeconds` integer — Minimum interval between emails in seconds

## Response `200`

SMTP configuration updated

- SmtpConfig
  - `id` string, uuid
  - `enabled` boolean
  - `host` string
  - `port` integer
  - `username` string
  - `hasPassword` boolean — Whether a password is set (actual password is never exposed)
  - `senderEmail` string, email
  - `senderName` string
  - `minIntervalSeconds` integer
  - `createdAt` string, date-time
  - `updatedAt` string, date-time

## Other responses

- `400` — Invalid request, or SMTP is the required email verification provider
- `401` — Unauthorized
- `403` — Forbidden - Admin only

---

[API](https://skmtc.net/insforge/apis/insforge-authentication-api.md) · [All operations](https://skmtc.net/insforge/apis/insforge-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/insforge/insforge-authentication-api/versions/a935bb49f932/schema)
