---
title: "Update an email provider"
method: PATCH
path: "/email-providers/{id}"
tags: ["Email Providers"]
---

# Update an email provider

`PATCH /email-providers/{id}`

## Request

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

Partial update — any field left out keeps its current value. Most importantly,
omitting the credential block (`ses_credentials`/`scaleway_credentials`/`smtp_credentials`)
preserves the stored secret, so operators can rename a provider without re-typing
passwords. `provider_type` is immutable; to switch providers, delete and recreate.

## Path parameters

- `id` integer, required

## Request body

- UpdateEmailProviderRequest: Request body for `PATCH /email-providers/{id}`. All fields are optional. Omit any field to leave it unchanged. The `provider_type` is immutable — to switch providers, delete the row and create a new one. For credentials, supplying any credential variant re-encrypts the stored blob; omitting them preserves the existing secret (so operators can rename without re-typing passwords).
  - `is_active` boolean, nullable
  - `name` string, nullable
  - `region` string, nullable
  - `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: Rotate or clear the exact SNS topic allowed for this SES provider. Omit to preserve it, send `null` to clear it, or send a string to set it.

## Response `200`

Provider updated

- 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`: Validation error
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Provider not found
- `409`: Provider type mismatch
- `422`: New credentials are invalid — the provider API definitively rejected them
- `500`: Internal server error
- `502`: Could not reach the provider API to verify new credentials

## 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/:id/patch.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)
