---
title: "Create an SMTP credential"
method: POST
path: "/smtp-credentials"
tags: ["SmtpCredentials"]
---

# Create an SMTP credential

`POST /smtp-credentials`

## Request

- Base URL: `https://api.groundmail.dev`
- URL: `https://api.groundmail.dev/smtp-credentials`
- Auth: HTTP bearer

## Request body

- CreateSmtpCredentialRequest
  - `name` string

## Response `200`

SMTP credential created (password shown once)

- CreateSmtpCredentialResponse
  - `id` string, required
  - `name` string, required
  - `password_prefix` string, required: First characters of the SMTP password for identification
  - `username` string, required: Always `groundmail`
  - `host` string, required
  - `port` integer, required
  - `last_used_at` string, date-time, nullable, required
  - `revoked_at` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `password` string, required: Full SMTP password (`gmsmtp_…`), shown once at creation

## Other responses

- `401`: Missing or invalid API key

---

[API](https://skmtc.dev/groundmail/apis/groundmail-api.md) · [All operations](https://skmtc.dev/groundmail/apis/groundmail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/groundmail/apis/groundmail-api/revisions/479821c9fecf?raw)
