Publish an email template

POST /v1/email-templates/{family}/{locale}:publish · permission email-templates:write · Startup plan and above

Validates a draft again and publishes it. The previous published version is archived, and the management audit record email_template.published is written in the same transaction. Emails sent after this use the new version.

Publishing the version that is already published changes nothing and returns it again, so retries are safe. A draft older than the published version, or an archived version, returns 409; use roll back to return to an archived version.

Path parameters

Parameter Description
family Email family, for example verify_email or email_otp (see List email templates).
locale Locale tag, for example en or de.

Request

Field Type Required Description
version integer yes The draft version to publish (1 or more).

Response

200 OK with the published version (status: published).

Errors

HTTP code When
400 unknown_field The body has an unknown field or is not a JSON object.
404 not_found The family or locale is unknown, or the version does not exist.
403 plan_feature_unavailable The environment's plan does not include custom email templates (Startup and above; required_plan says which).
409 conflict The version is archived or older than the published version.
422 validation_failed version is missing or less than 1, or the draft no longer passes validation.
401 unauthenticated The credential is missing, invalid or revoked.
403 insufficient_permissions The credential lacks the required permission.
429 rate_limited The rate limit was exceeded; retry after the Retry-After period.
503 service_unavailable A dependency is temporarily unavailable; retry after the Retry-After period.

Example

curl -X POST https://api.eu.keenauth.com/v1/email-templates/verify_email/en:publish \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"version":3}'

CLI: keenauth email-templates publish verify_email en --version 3