๐จ Send Template Messages
Reach a guest on WhatsApp, SMS or Email with a pre-approved template
This guide walks you through sending a template message from your own system. For the full API specification, see the Unified Messaging API Live Docs.
When You Need a Template
WhatsApp only accepts free-form messages inside the 24-hour service window, which starts with the guest's last inbound message. Outside that window a free-form send is rejected with 409, and a template is the only way to reach the guest. Templates work on SMS and Email as well, where no service window applies.
Required OAuth2 Scopes
| Operation | Required Scope |
|---|---|
| Send a message | guest.conversation.write |
| Read conversations/messages | guest.conversation.read |
Quick Start
Send a POST request with a template block instead of content:
curl -X POST \
'{{monitoringUrl}}/api/unified-messaging-service/guest-conversations/send-message' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"pmsPropertyId": "PROP-123",
"communicationChannel": "WHATSAPP",
"recipient": { "contact": "+41791234567" },
"template": {
"template": "NEW_CONVERSATION_1",
"languageCode": "de",
"variables": [
{ "name": "FIRST_NAME", "value": "Anna" },
{ "name": "LAST_NAME", "value": "Beispiel" },
{ "name": "UNIT_NAME", "value": "Room 204" }
]
}
}'
The response returns the created message, its conversation and the delivery status:
{
"messageId": "msg-001",
"conversationId": "conv-abc123",
"status": "ACCEPTED"
}
Use the conversationId to follow the thread. Once the guest replies, the 24-hour service window opens and you can send free-form messages with a content block.
Available Templates
| Template | Use For |
|---|---|
NEW_CONVERSATION_1 to NEW_CONVERSATION_9 |
Open a conversation with a guest who has never written to the property |
RESTART_CONVERSATION_1 to RESTART_CONVERSATION_9 |
Reopen a conversation after the 24-hour service window closed |
CUSTOM_TEMPLATE_1 to CUSTOM_TEMPLATE_9 |
Send your own wording and your own link per call. See Custom Templates |
Templates are configured per property
A template value is only accepted if it is configured for the pmsPropertyId you send. Wording, language coverage and the variables a template expects are set up by LIKE MAGIC together with the property. Ask your LIKE MAGIC contact which slots are live for your properties and which variables each one takes.
Custom Templates
CUSTOM_TEMPLATE_1 to CUSTOM_TEMPLATE_9 are the slots to reach for when the fixed conversation templates do not say what you need. Their wording is not fixed the way a conversation template's is. You supply the message text, and a link where the slot is configured for it, on every call through three variables:
| Variable | Holds |
|---|---|
CUSTOM_CONTENT |
The message text |
LINK_URL |
A URL to place in the message |
LINK_TEXT |
The wording that introduces the URL |
curl -X POST \
'{{monitoringUrl}}/api/unified-messaging-service/guest-conversations/send-message' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"pmsPropertyId": "PROP-123",
"communicationChannel": "WHATSAPP",
"recipient": { "contact": "+41791234567" },
"template": {
"template": "CUSTOM_TEMPLATE_1",
"languageCode": "en",
"variables": [
{ "name": "FIRST_NAME", "value": "Anna" },
{ "name": "CUSTOM_CONTENT", "value": "Your spa slot on Friday is confirmed." },
{ "name": "LINK_TEXT", "value": "Manage your booking" },
{ "name": "LINK_URL", "value": "https://example.com/booking/RES-99812" }
]
}
}'
The same call works on SMS and EMAIL. Swap communicationChannel and give recipient.contact the matching phone number or email address.
Two limits are worth knowing before you build on this:
- A custom slot is still a configured template. Whatever text LIKE MAGIC set up around the variables stays fixed, and each slot still expects a specific variable list. You control the values, not the whole message. Nine slots exist so a property can run several shapes side by side.
LINK_URLrenders in the message body, not as a WhatsApp button. Send the full URL, including the scheme.
Variables
Provide every variable your template expects as a { "name": ..., "value": ... } entry. Values are matched by name, so the order of the array does not matter.
| Variable | Typical Content |
|---|---|
FIRST_NAME |
Guest first name |
LAST_NAME |
Guest last name |
INVITED_BY_FIRST_NAME |
First name of the inviting guest |
INVITED_BY_LAST_NAME |
Last name of the inviting guest |
CONFIRMATION_NUMBER |
Reservation or booking confirmation number |
PINS |
Door access PIN |
UNIT_NAME |
Room or unit name |
ARRIVAL_DATE |
Check-in date |
SERVICE_NAME |
Name of a booked service |
LINK_URL |
URL placed in the message body of a custom template |
LINK_TEXT |
Wording that introduces LINK_URL |
CUSTOM_CONTENT |
Message text of a custom template |
Send exactly what the template expects
A template whose variables are not all supplied is rejected by the messaging provider and nothing reaches the guest. If a send fails without an obvious cause, confirm the variable list with your LIKE MAGIC contact first.
The property's host names are not a variable you send. LIKE MAGIC resolves them from pmsPropertyId and fills them in automatically, so hosts is not an accepted variable name and a request that includes it fails with 400.
Languages
languageCode selects the language version of the template. A template renders only in the languages configured for it.
| Code | Language |
|---|---|
de |
German |
en |
English |
fr |
French |
it |
Italian |
nl |
Dutch |
da |
Danish |
default |
Property default |
Constraints
- Send either
contentortemplate, never both and never neither communicationChannelacceptsWHATSAPP,SMSandEMAILrecipient.contactis a phone number in E.164 format for WhatsApp and SMS, an email address for Email- Free-form messages on WhatsApp are rejected with
409once the 24-hour service window has closed
API Reference
For complete API documentation including all endpoints and response schemas: