---
title: "Create a new email provider"
method: POST
path: "/email-providers"
tags: ["Email Providers"]
---

# Create a new email provider

`POST /email-providers`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/email-providers`
- Auth: HTTP bearer

## Request body

- CreateEmailProviderRequest
  - `name` string, required: User-friendly name for the provider
  - `provider_type` 'ses' | 'scaleway' | 'smtp', required: Provider type
  - `region` string, required: Cloud region. For SMTP this is informational only — the host/port carry the real routing.
  - `scaleway_credentials` ScalewayCredentialsRequest, nullable
    - `api_key` string, password, required: A credential. Write-only: it is never returned, and the AI assistant supplies it through a secret slot instead of typing it into the conversation.
    - `project_id` string, required
  - `ses_credentials` SesCredentialsRequest, nullable
    - `access_key_id` string, required
    - `secret_access_key` string, password, required: A credential. Write-only: it is never returned, and the AI assistant supplies it through a secret slot instead of typing it into the conversation.
  - `smtp_credentials` SmtpCredentialsRequest, nullable: Generic SMTP credentials request body. Works with any SMTP relay — AWS SES SMTP endpoints, Sendgrid, Mailgun, Postmark, or a self-hosted Postfix. Use this when you only have SMTP credentials (i.e. you cannot create identities via the upstream API).
    - `accept_invalid_certs` boolean: Accept self-signed certificates. Only safe for local testing.
    - `encryption` 'starttls' | 'tls' | 'none': TLS mode. Defaults to STARTTLS.
    - `host` string, required: SMTP host, e.g. `email-smtp.eu-west-1.amazonaws.com`.
    - `password` string, password, nullable: A credential. Write-only: it is never returned, and the AI assistant supplies it through a secret slot instead of typing it into the conversation.
    - `port` integer, required: SMTP port (587 for STARTTLS, 465 for implicit TLS, 25/1025 for plain).
    - `username` string, nullable: SMTP username. Leave empty for unauthenticated relays.
  - `sns_topic_arn` string, nullable: Exact SNS topic allowed to deliver SES events for this provider.

## Response `201`

Provider created successfully

- EmailProviderResponse
  - `created_at` string, required
  - `credentials` unknown, required
  - `id` integer, required
  - `is_active` boolean, required
  - `name` string, required
  - `provider_type` 'ses' | 'scaleway' | 'smtp', required
  - `region` string, required
  - `sns_topic_arn` string, nullable
  - `updated_at` string, required

## Other responses

- `400`: Invalid request or validation error
- `401`: Unauthorized
- `403`: Insufficient permissions
- `422`: Provider credentials are invalid — the provider API definitively rejected them
- `500`: Internal server error
- `502`: Could not reach the provider API to verify credentials — the credentials may still be valid

## Changes

- **2026-10-23** `7d41b820a372`: 4 breaking, 1 info
  - the request property `smtp_credentials/oneOf[#/components/schemas/SmtpCredentialsRequest]/password` became not nullable
  - the `scaleway_credentials/oneOf[#/components/schemas/ScalewayCredentialsRequest]/api_key` request property format changed from no format to `password`
  - the `ses_credentials/oneOf[#/components/schemas/SesCredentialsRequest]/secret_access_key` request property format changed from no format to `password`
  - the `smtp_credentials/oneOf[#/components/schemas/SmtpCredentialsRequest]/password` request property type changed from `string, null` to no type
  - …1 more
- **2026-10-23** `24af93ff5379`: 2 breaking, 3 info
  - removed `#/components/schemas/SecretString, subschema #2` from the `smtp_credentials/oneOf[#/components/schemas/SmtpCredentialsRequest]/password` request property `oneOf` list
  - the `smtp_credentials/oneOf[#/components/schemas/SmtpCredentialsRequest]/password` request property type changed from no type to `string, null`
  - the request property `smtp_credentials/oneOf[#/components/schemas/SmtpCredentialsRequest]/password` became nullable
  - the `scaleway_credentials/oneOf[#/components/schemas/ScalewayCredentialsRequest]/api_key` request property format was generalized from `password` to no format
  - …1 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/email-providers/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
