Email Themes

Preview an email theme

POST/email-themes/{id}/actions/preview

Renders a sample system email in the theme and returns { "data": { "html" } }, using the platform organisation's branding. The body can pick which system template is the sample. It only reads, sends no email and emits no webhook, so there is nothing to undo. Use POST /email-templates/{id}/actions/preview to preview one template's content, and PATCH /settings/email-theme to choose the theme in use. Returns 404 for an unknown theme, and also when the platform host has no brand colours to render with.

Path parameters

  • idstringRequired#

    The theme id, such as family-office. Use GET /email-themes to list them.

Headers

  • Idempotency-Keystring#

    Makes a retry safe. Send a new UUID for each new request and reuse it only to retry that request; the first response is replayed for 24 hours.

Request body

application/json, optional

  • templatestring#

    The system email template to use as the sample body, such as user_welcome or new_deal_published. It must be one of the platform's system template names; a custom template is not accepted. Defaults to generic_notification.

{
  "template": "user_welcome"
}

Responses

200

The rendered sample email.

{
  "data": {
    "html": "<html>...rendered email...</html>"
  }
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
404

Resource not found (error.code = not_found).

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X POST https://your-org-domain/kong/core/api/v2/email-themes/{id}/actions/preview\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "template": "user_welcome"
}'