---
title: "Get SMTP configuration"
method: GET
path: "/clusters/{cluster_id}/realms/{realm}/smtp"
tags: ["SMTP"]
---

# Get SMTP configuration

`GET /clusters/{cluster_id}/realms/{realm}/smtp`

## Request

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

Returns the SMTP configuration for a realm.

Required scope: `smtp:read`

## 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

## Response `200`

The request has succeeded.

- SmtpConfig: SMTP email delivery configuration for a realm.
  - `cluster_id` string, uuid, required
  - `realm` string, required: Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.
  - `host` string, required
  - `port` integer, required
  - `encryption` 'none' | 'ssl' | 'starttls', required
  - `from_email` string, email, required: Sender email address.
  - `from_name` string
  - `auth_type` 'basic' | 'oauth2', required
  - `username` string: SMTP username. Present when `auth_type` is `basic`.
  - `has_password` boolean, required: `true` when a password is stored for this configuration.
  - `token_url` string, uri: OAuth 2.0 token endpoint URL. Present when `auth_type` is `oauth2`.
  - `token_scope` string: OAuth 2.0 token scope. Present when `auth_type` is `oauth2`.
  - `client_id` string: OAuth 2.0 client ID. Present when `auth_type` is `oauth2`.
  - `has_client_secret` boolean, required: `true` when a client secret is stored for this configuration.
  - `status` 'configured' | 'verified' | 'failed', required
  - `last_tested` string, date-time: Timestamp of the last connection test.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `401`: Access is unauthorized.
- `403`: Access is forbidden.
- `404`: The server cannot find the requested resource.
- `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)
