---
title: "Test SMTP configuration"
method: POST
path: "/clusters/{cluster_id}/realms/{realm}/smtp/test"
tags: ["SMTP"]
---

# Test SMTP configuration

`POST /clusters/{cluster_id}/realms/{realm}/smtp/test`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/clusters/{cluster_id}/realms/{realm}/smtp/test`
- Auth: API key in header `API-Key`

Sends a test email using the saved SMTP configuration. Returns the test result.

Required scope: `smtp:write`

## Path parameters

- `cluster_id` string, uuid, required
- `realm` string, required: Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.

## Headers

- `API-Version` '2026-06-01.beta', required

## Request body

- SmtpTestRequest
  - `email` string, email, required: Recipient email address for the test message.

## Response `200`

The request has succeeded.

- SmtpTestResult
  - `success` boolean, required
  - `message` string

## Other responses

- `400`: The server could not understand the request due to invalid syntax.
- `401`: Access is unauthorized.
- `403`: Access is forbidden.
- `404`: The server cannot find the requested resource.
- `422`: Client error
- `429`: Client error
- `500`: Server error
- `501`: Server error

---

[API](https://skmtc.dev/skycloak/apis/skycloak-public-api.md) · [All operations](https://skmtc.dev/skycloak/apis/skycloak-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/skycloak/apis/skycloak-public-api/revisions/33a69e2ce35f?raw)
