Enneo

Template

Create a response template

POST /template

POST /template

Requires the manageTemplates permission.

Request body

descriptionstringbody

Human readable description of the template.

messagestringbodyrequired

The template body in HTML/Handlebars format. Must contain the actual customer-facing text. In addition to the standard Handlebars syntax, a set of custom helpers is available (contains, compare, gt, lt, formatDateDE, addDays, extractFirstName, last4digits, …). See the Templates documentation for the full list. Note: helpers like contains, compare, gt, and lt compare values as strings — wrap numeric IDs in quotes (contains in.tagIds "22", not contains in.tagIds 22).

tagIdintegerbody

Optional tag used to categorize the template.

emailTemplateIdintegerbody

Wrapper template ID used for greetings/signature. Defaults to the generic template configured in settings.

subjectstringbody

Optional subject used for proactive emails.

exampleTicketIdsinteger[]body

Ticket IDs that showcase how this template is used.

attachmentsobject[]body

Files that should be attached when inserting the template.

Request Example

{
  "description": "Reminder: missing meter reading",
  "message": "<p>Hallo {{contract.firstName}}, bitte sende uns den Stand.</p>",
  "tagId": 1,
  "emailTemplateId": 1,
  "subject": "string",
  "exampleTicketIds": [
    1
  ],
  "attachments": [
    {
      "name": "string",
      "url": "string",
      "base64": "string"
    }
  ]
}

Responses

200 — Template created successfully

Response Example

{
  "id": 1,
  "tagId": 1,
  "emailTemplateId": 1,
  "description": "Zählerstand erfolgreich hinterlegt",
  "message": "<p>Wir haben den Zählerstand von {{intent.data.reading}} kWh für den {{formatDateDE intent.data.date}} erfasst und im System hinterlegt.</p>",
  "subject": "Wir brauchen Deine Unterstützung",
  "exampleTicketIds": [
    1
  ],
  "mergedTemplate": "Wir haben den Zählerstand von 123 kWh für den 01.01.2022 erfasst und im System hinterlegt.",
  "template": "<p>Wir haben den Zählerstand von 123 kWh für den 01.01.2022 erfasst und im System hinterlegt.</p>",
  "success": true
}

400 — Validation error (e.g., invalid handlebars syntax)

403 — Unauthorized / missing permission

500 — Internal error