Create template account
Creates a new message template for automated notifications (email, SMS, etc.). Templates are triggered by system events and can include dynamic variables.
Endpoint
POST/v2/messages/templates
Link
Request
Headers
Authorization
Bearer <JWT>
Yes
Content-Type
application/json
Yes
Accept
application/json
Yes
Request Body (JSON)
typeId
integer
Template type:
- 1: Email
- 2: SMS
- 3: Push notification
Yes
1
subject
string
Email subject line (required for email templates).
Yes
"Welcome to Our Platform!"
title
string
Message title/header.
Yes
"Account Created"
content
string
Message body with variable placeholders.
Yes
"Hello {{name}}, welcome!"
button
string
Button text (for email templates).
No
"Login Now"
link
string
Button URL (for email templates).
No
"https://app.example.com"
delay
string
Delivery delay after trigger (e.g., "5m", "2h").
No
"10m"
showTime
string
Preferred sending time (24-hour format).
No
"09:00"
triggers
array
Events that trigger this template (see below).
No
-
Trigger Object
eventId
integer
ID of the event that triggers this template.
101
event
object
Event details (optional, see below).
-
Event Object (optional in request)
id
integer
Event ID.
101
Name
string
Event name.
"customer.created"
variables
array
Available variables for this event.
-
Example Request Body (Email Template):
json
Example Request Body (SMS Template):
json
Response (200 OK)
Returns the newly created template with system-generated fields.
Response Fields
id
string
System-generated template ID.
"tpl_abc123"
partnerId
string
Partner ID that owns the template.
"ptn_456def"
typeId
integer
Template type from request.
1
subject
string
Subject from request.
"Welcome to Acme Payments!"
title
string
Title from request.
"Account Created Successfully"
content
string
Content from request.
"Hello {{customerName}}..."
button
string
Button text from request.
"Access Your Account"
link
string
Link URL from request.
"https://app.acme.com/login"
updatedAt
string
Creation timestamp (ISO 8601).
"2024-05-21T10:30:00Z"
createdAt
string
Creation timestamp (ISO 8601).
"2024-05-21T10:30:00Z"
deletedAt
string
Deletion timestamp (null for new templates).
null
delay
string
Delay from request.
"0s"
isActive
boolean
Active status (default: true).
true
showTime
string
Show time from request.
"09:00"
triggers
array
Trigger events with full event details.
-
Example Response:
json
Examples
Request
bash
Error Responses
Invalid Event ID:
json
Missing Required Field:
json
Invalid Variable:
json
Notes
Variable Syntax: Use
{{variableName}}in content for dynamic values.Template Types:
1: Email (requires subject, supports button/link)2: SMS (no subject/button/link needed)3: Push notification
Auto-activation: New templates are automatically active (
isActive: true).Event Validation: Triggers are validated against available system events.
Last updated

