Save (upsert) a template override

Overview

Create or update the company's content override for a template type. Region HTML arrives base64-encoded; null/empty regions inherit the system/white-label default. The endpoint validates variables in content against the type's allowed token set.

Prerequisites

  • A bearer token. Callable with Partner and Account tokens.

Base URL

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

Endpoint

POST /api/v1/account/white-label/email-templates/save

Authentication

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

  • Who can call it: Partner and Account tokens.

  • Authentication plus an email-template feature check.

  • company_id is scoped by an ownership check.

  • Platform-owned types are forbidden (403) for non-platform companies.

  • Only the reachable companies differ per role.

Rate limit

  • No rate limit.

Request body

  • Body (region fields are base64-encoded HTML; ValidTemplateVariables checks tokens against the type):
FieldTypeRequiredDescription
company_idintegerYesMust be an existing account inside your own account tree.
typestringYesValid EmailTemplateType value.
headerstringNonullable, base64 HTML, max:80000, token-validated. Empty falls back to inherit default.
bodystringNonullable, base64 HTML, max:80000, token-validated.
footerstringNonullable, base64 HTML, max:80000, token-validated.
signaturestringNonullable, base64 HTML, max:80000, token-validated.
subject_overridestringNonullable, max:255, token-validated. Plain text (not base64).
template_modestringNonullable, one of regions, html.
custom_htmlstringNonullable, base64 HTML, max:400000. Used in html mode; omitting it on a regions-mode save does NOT clear a stored full-HTML draft.
{
  "company_id": 1,
  "type": "user_welcome",
  "body": "PHA+SGVsbG8gW3JlY2lwaWVudE5hbWVdPC9wPg==",
  "subject_override": "Welcome to [partnerTitle]!",
  "template_mode": "regions"
}

Response

  • data.status (string) — success.
  • data.message (string) — Email template saved successfully.

200 OK · 200

{
  "data": {
    "status": "success",
    "message": "Email template saved successfully."
  }
}

422 Validation Error · 422

{
  "message": "The body contains an unsupported variable. (and 1 more error)",
  "errors": {
    "body": [
      "The body contains an unsupported variable: [storeName]."
    ],
    "type": [
      "The selected type is invalid."
    ]
  }
}

Errors

StatusMeaning
401The bearer token is missing, expired or invalid
403The template type is platform-managed, or the email-template section is disabled for your account
422Validation Error
500Unexpected server error

Example request

curl --request POST \
  --url "https://production-api.shoutaboutus.com/api/v1/account/white-label/email-templates/save" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{"company_id": 1, "type": "user_welcome", "body": "PHA+SGVsbG8gW3JlY2lwaWVudE5hbWVdPC9wPg==", "subject_override": "Welcome to [partnerTitle]!", "template_mode": "regions"}'

Did this page help you?