Send Template

Renders a message template and sends it to the specified recipient,
initiating a conversation proactively. No ticket is created; a ticket is
created once the recipient replies.

The ticket that reply creates holds the reply, not the template that
prompted it: the sent message belongs to the conversation rather than to
any ticket. The same applies to a ticket that is already open when you
send, so do not expect the message to appear on it either. Read the full
exchange with the ticket messages endpoint using scope: 'Channel',
which returns every message on the conversation, including the ones that
no ticket holds.

That read needs a ticket, so it is available only after the guest has
replied, and your bot must be assigned to that ticket, or be on the view
it is assigned to. Assignment rules normally arrange this when the reply
arrives; until then the call answers TicketNotAccessible.

SMS is available wherever a sending number is provisioned. WhatsApp
requires the number to be connected through the direct WhatsApp
integration; a number served by the earlier provider answers
ServiceNotFound until it has been migrated.

Every failure response carries the same error shape: a machine-readable
code to branch on, and a human-readable message explaining it, whose
wording may change. The codes are:

  • BadRequest (400): the request body is invalid; details in message.
  • ServiceNotFound (400): no sending service (e.g. phone number) with this number exists on the organisation.
  • TemplateNotFound (400): no template with this uuid is visible to the organisation.
  • TemplateNotApproved (400): the WhatsApp template is not (or no longer) approved by Meta.
  • InvalidTemplate (400): the template cannot be sent because it is authored for a different channel, or its content cannot be rendered.
  • InvalidSender (400): the sender is not a valid phone number.
  • InvalidRecipient (400): the recipient is not a valid phone number.
  • RenderError (400): the supplied variables do not satisfy the template; problems lists every path at fault, once each, and says whether it is absent or was sent as a flattened dotted key.
  • RenderUnavailable (502): the template could not be rendered because the rendering service was unreachable or failed. Nothing was sent, so the request can be retried.
  • DeliveryFailed (502): the message provider rejected the send.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
uuid
required

The UUID of the message template to send.

Body Params
string
enum
required

The channel to send the template on. The template must be authored
for this channel, or be multichannel content that every channel
shares. A template authored for a different channel comes back as
InvalidTemplate.

Allowed:
string
required

The sender reference, depending on the channel:

  • For SMS, this is the hotel phone number in E.164 format (e.g. +46701234567).
  • For WhatsApp, this is the hotel phone number in E.164 format (e.g. +46701234567).
  • Other channels added in the future may have a different format.
string
required

The recipient reference, depending on the channel:

  • For SMS, this is the guest phone number in E.164 format (e.g. +46701234567).
  • For WhatsApp, this is the guest phone number in E.164 format (e.g. +46701234567).
  • Other channels added in the future may have a different format.
variables
object
required

The data the template reads, shaped the way the template reads it. A
{{ guest.first_name }} placeholder expects a guest object with a
first_name, so send {"guest": {"first_name": "Ada"}} rather than a
single key named guest.first_name.
Values may be any JSON. They are validated against the template before
anything is sent, and a template that asks for data you did not supply
comes back as RenderError naming each missing path.
Pass an empty object if the template needs no data. The whole request
body is limited to 16 KiB.

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json