Smstools
 

API

Guides

Messages

Voice

WhatsApp Business

Groups

Contacts

Outbox

Account

Sender IDs

Teammate/Subaccount

Conversations

Workflows

Message Templates

Birthday Message

Opt-out

Other

Webhooks (v2)

Workflow triggers

data.config.triggerType of the trigger node. The trigger decides when the workflow runs and what the payload contains.

inbound_message

Runs for every message received on your inboxes (SMS, WhatsApp, virtual numbers).

{ "id": "trigger", "type": "triggerNode",
  "data": { "config": { "triggerType": "inbound_message", "inboxId": 0 } } }
Key Values Description
inboxIdinteger, default 00 = every inbox of your account, otherwise the numeric ID of one inbox.

delivery_report

Runs when a delivery report arrives for a message you sent.

{ "id": "trigger", "type": "triggerNode",
  "data": { "config": { "triggerType": "delivery_report", "deliveryStatus": "failed" } } }
Key Values Description
deliveryStatusall (default) / sent / delivered / failed / undelivered / rejected / bufferedOnly run for this status.

cron

Runs on a schedule. Pick a scheduleMode and fill in the fields that apply; for anything else use custom with a cron expression. The payload is empty until a get_contact action loads a contact.

{ "id": "trigger", "type": "triggerNode",
  "data": { "config": { "triggerType": "cron", "scheduleMode": "days", "intervalValue": 1, "hour": 9, "minute": 0, "timezone": "Europe/Brussels" } } }

{ "id": "trigger", "type": "triggerNode",
  "data": { "config": { "triggerType": "cron", "scheduleMode": "custom", "expression": "0 9 * * 1-5", "timezone": "Europe/Brussels" } } }
Key Values Description
scheduleModeseconds / minutes (default) / hours / days / weeks / months / customHow the schedule is expressed.
intervalValueinteger, 1 or moreEvery N seconds / minutes / hours / days / weeks / months. A seconds schedule needs at least 10 to be published.
minute, hour0-59, 0-23Time of day for days, weeks and months.
dayOfWeekweekday name, or 0 (sunday) to 6For weeks.
dayOfMonth1-31For months.
expression5-field cron expressionRequired for custom; derived from the fields above otherwise.
timezoneIANA name, default Europe/BrusselsTime zone of the schedule.

birthday

Runs once a day for every contact whose birthday it is. The payload contains the contact, including contact.birthday and contact.age.

{ "id": "trigger", "type": "triggerNode",
  "data": { "config": { "triggerType": "birthday", "groupId": "gid_3520a1ec234dbabe1232def67e858855", "time": "09:00", "timezone": "Europe/Brussels", "oncePerContact": true } } }
Key Values Description
groupIdgid_..., optionalOnly contacts of this group; none = all groups.
timeHH:MM, default 09:00When to run.
timezoneIANA name, default Europe/BrusselsTime zone of time.
oncePerContactboolean, default trueDo not run twice for the same contact on the same day.

calendar_event

Runs once for every appointment in the calendars connected to your account (Google Calendar, Microsoft 365, iCal feed), at a moment relative to that appointment: two hours before it starts, the day before at 18:00, a day after it ends. The appointment is replanned when it moves and withdrawn when it disappears; an appointment whose moment already passed when it is first seen does not run. The phone number found in the appointment becomes contact.phone, and the rest of contact.* is filled from your contact with that number when there is one. Requires the calendar integrations on your account.

{ "id": "trigger", "type": "triggerNode",
  "data": { "config": { "triggerType": "calendar_event", "calendarId": 0, "offsetMinutes": -120, "anchor": "start", "sendAtTime": "", "filterTitle": "", "phoneLabel": "gsm:" } } }
Key Values Description
calendarIdinteger, default 00 = every calendar you ticked in your calendar integrations, otherwise the numeric ID of one of those calendars.
offsetMinutes-43200 to 43200, default -1440Minutes relative to the appointment: negative = before, positive = after. -1440 is one day before.
anchorstart (default) / endCount from the start or the end of the appointment.
sendAtTimeHH:MM, optionalWith a fixed time the offset counts in whole days and the workflow runs at that time. All-day appointments use it, or 09:00.
filterTitletext, optional, max 190Only appointments whose title contains this text.
phoneLabeltext, optional, max 40Label that precedes the phone number in the appointment, such as gsm:. Empty = the first phone number found in the title, description or location.

Placeholders and the payload

{{ path }} inside a text field of an action (marked tpl on the Actions page) is replaced by the value at that path in the payload, e.g. {{ contact.firstname }}, {{ message.body }} or {{ contact.extra3 }}; an unknown placeholder is left as it is. What the payload contains depends on the trigger:

Trigger Payload
inbound_messagemessage.body, message.channel, message.inbox_id, message.length; contact.phone = the sender. The other contact fields stay empty until a contact or get_contact action loads the contact.
delivery_reportdelivery_report.status; message.body, message.channel, message.length; contact.phone.
birthdaycontact.* including birthday (DD/MM) and age.
calendar_eventevent.title, event.description, event.location, event.calendar, event.starts_at / event.ends_at (YYYY-MM-DD HH:MM in your timezone), event.date (DD/MM/YYYY), event.time (HH:MM, empty for all-day), event.all_day, event.phone, event.link; contact.* of the contact with that number (contact.phone at least).
cronEmpty until a get_contact action loads a contact.
all triggersexecution.run_count.

Get sample payload returns this structure for the trigger of the workflow, filled with a real contact when you pass contact_id; use it as the body of Test workflow.

SMS API

Smstools
Integrate our SMS Gateway by implementing our SMS API, and add text messaging to your platform in minutes. Free trial. SMS API
5 out of 5 based on 3315 user ratings.
SMSGATEWAYAPI API1

REGISTER NOW

Discover our text message marketing platform today!

REGISTER