Email Templates

Create a custom email template

POST/email-templates

Creates a custom template from a name and returns it with a Location. The slug is made from the name, and gets a random suffix when it collides with a system slug or a stored template. A slug already used by a legacy template is not refused: the stored template takes its place. The new template is enabled, starts with no content, and has the status custom. Add content with PATCH /email-templates/{id}. It emits email_template.created, and DELETE /email-templates/{id} undoes it. dry_run shows the result without saving it.

Query parameters

  • dry_runboolean#

    Validate and run the call without committing it, returning what the real call would return with meta.dry_run set.

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, required

  • namestringRequired#

    The name the platform shows. The slug is made from it, so it must contain letters or digits.

{
  "name": "Investor Welcome Pack"
}

Responses

201

The template was created.

EmailTemplate
{
  "data": {
    "id": "string",
    "name": "string",
    "category": "string",
    "status": "default",
    "enabled": true,
    "cc_list_enabled": true,
    "assigned_internal_cc_enabled": true,
    "subject": "string",
    "layout_mode": "fragment",
    "content": "string",
    "default_content": "string",
    "default_subject": "string",
    "placeholders": [
      {
        "value": "string",
        "label": "string"
      }
    ],
    "created_at": "2026-06-12T10:00:00+00:00",
    "updated_at": "2026-06-12T10:00:00+00:00"
  }
}
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
409

The request conflicts with existing state (error.code = conflict), e.g. a compliance flow with the requested name already exists.

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-templates\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "name": "Investor Welcome Pack"
}'