Update email template

Overview

Update an existing email template (subject, HTML/JSON content, name, editor mode, manager emails). Copy-on-write for globals: if the target template has no company_id (a global template), it copies into the caller's account first. A name clash there returns 400. When you supply channel_id the template is wired onto that campaign channel. A follow_up template sets the channel's follow_up_template_id + interval fields, otherwise it sets template_id.

Prerequisites

  • A bearer token in the Authorization header.

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

POST /api/v1/campaign/template/email/update

Authentication

  • Requires a bearer token in the Authorization: Bearer <bearer-token> header.

  • bearer token, account role — authentication. email_template_id must resolve to a template owned by the caller's account (or a global one); otherwise validation fails.

Rate limit

  • No rate limit.

Request body

FieldTypeRequiredDescription
email_template_idintegerRequiredMust be an existing email template inside your own account tree (or be global).
subjectstringRequiredMax 255.
html_contentstringRequired*Rendered HTML. *Optional when you send html_content_b64.
html_content_b64string (base64)OptionalBase64 of html_content — use for payloads with <script>/<iframe>/on*= that AWS WAF blocks in clear. Decoded into html_content before validation.
json_contentstring (JSON)RequiredEditor JSON, validated as json.
titlestringOptionalNew name. Unique within the caller's account and against global (shared) templates (ignores this row).
template_editor_modestringOptionalcustom or html_editor.
channel_idintegerOptionalMust be an existing campaign channel. Associates the template with the channel.
manager_emailstring (email)OptionalValidated email:rfc,dns.
other_manager_emailstring[]OptionalEach a distinct email:rfc,dns.
follow_up_intervalintegerOptionalOne of 1,2,3,4,5,6,7,14,30. Applied to the channel for follow_up templates.
follow_up_interval_countintegerOptionalOne of 1,2,3.
{
  "email_template_id": "<emailTemplateId>",
  "subject": "Welcome to our service!",
  "html_content": "<html><body><h1>Welcome!</h1></body></html>",
  "json_content": "{}",
  "title": "Updated Template Name",
  "template_editor_mode": "custom",
  "channel_id": "<channelId>",
  "manager_email": "[email protected]",
  "other_manager_email": [
    "[email protected]"
  ]
}

How it works

  • Synchronous. 200 OK returns the saved model under data.data. 400 (envelope {message,status,errors}) when replicating a global template and the chosen name already exists for the company. 422 on validation failure or when the template is not in the caller's account.

Response

200 OK · 200

{
  "data": {
    "status": "success",
    "message": "Email Template has been updated successfully!",
    "data": {
      "id": 1,
      "company_id": 30,
      "store_id": 123,
      "name": "Updated Template Name",
      "subject": "Welcome to our service!",
      "html_content": "<html><body><h1>Welcome!</h1></body></html>",
      "json_content": {},
      "template_editor_mode": "custom",
      "template_type": "regular",
      "manager_email": "[email protected]",
      "other_manager_email": [
        "[email protected]"
      ],
      "created_at": "2026-07-09T10:30:00.000000Z",
      "updated_at": "2026-07-09T10:30:00.000000Z",
      "deleted_at": null
    }
  }
}

422 Not your template · 422

{
  "message": "The selected email template does not belong to your company.",
  "errors": {
    "email_template_id": [
      "The selected email template does not belong to your company."
    ]
  }
}

Errors

StatusMeaning
400The request was rejected — the response explains why
401The bearer token is missing, expired or invalid
422Not your template
500Unexpected server error

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/campaign/template/email/update" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"email_template_id": "<emailTemplateId>", "subject": "Welcome to our service!", "html_content": "<html><body><h1>Welcome!</h1></body></html>", "json_content": "{}", "title": "Updated Template Name", "template_editor_mode": "custom", "channel_id": "<channelId>", "manager_email": "[email protected]", "other_manager_email": ["[email protected]"]}'

Did this page help you?