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 examples

Two complete definitions to start from; send them to Create workflow and call Publish workflow to make them run. See Definition for the objects and Actions for the settings used here.

A workflow that opts the sender out when an inbound message says STOP. Send it to Create workflow, then call Publish workflow to make it run on every inbound message:

{
	"name": "STOP = opt-out",
	"nodes": [
		{
			"id": "trigger",
			"type": "triggerNode",
			"position": { "x": 0, "y": 0 },
			"data": {
				"title": "Inbound message",
				"config": { "triggerType": "inbound_message", "inboxId": 0 }
			}
		},
		{
			"id": "is_stop",
			"type": "conditionNode",
			"position": { "x": 0, "y": 150 },
			"data": {
				"title": "Message is STOP?",
				"config": { "conditionType": "if", "field": "message.body", "operator": "equals", "value": "STOP" }
			}
		},
		{
			"id": "opt_out",
			"type": "actionNode",
			"position": { "x": 0, "y": 300 },
			"data": {
				"title": "Opt out",
				"config": { "actionType": "opt_out", "editMethod": "opt_out" }
			}
		}
	],
	"edges": [
		{ "id": "e1", "source": "trigger", "sourceHandle": "out", "target": "is_stop", "targetHandle": "in" },
		{ "id": "e2", "source": "is_stop", "sourceHandle": "true", "target": "opt_out", "targetHandle": "in" }
	]
}

Office hours routing: inside office hours the conversation is assigned round robin to two team members and opened, outside office hours the sender gets an SMS auto-reply from the inbox number the message arrived on. Replace the sub_ IDs with the IDs from List subaccounts:

{
	"name": "Office hours routing",
	"nodes": [
		{
			"id": "trigger",
			"type": "triggerNode",
			"position": { "x": 0, "y": 0 },
			"data": {
				"title": "Inbound message",
				"config": { "triggerType": "inbound_message", "inboxId": 0 }
			}
		},
		{
			"id": "office_hours",
			"type": "conditionNode",
			"position": { "x": 0, "y": 150 },
			"data": {
				"title": "Within office hours?",
				"config": {
					"conditionType": "office_hours",
					"officeHours": {
						"days": ["monday", "tuesday", "wednesday", "thursday", "friday"],
						"start": "09:00",
						"end": "17:00",
						"timezone": "Europe/Brussels"
					}
				}
			}
		},
		{
			"id": "assign",
			"type": "actionNode",
			"position": { "x": -250, "y": 300 },
			"data": {
				"title": "Assign to support",
				"config": {
					"actionType": "assign_conversation",
					"assignMode": "round_robin",
					"teamMembers": ["sub_3520a1ec234dbabe1232def67e858855", "sub_9b74c9897bac770ffc029102a200c5de"],
					"onlyIfUnassigned": true,
					"status": "open"
				}
			}
		},
		{
			"id": "auto_reply",
			"type": "actionNode",
			"position": { "x": 250, "y": 300 },
			"data": {
				"title": "Closed auto-reply",
				"config": {
					"actionType": "send_sms",
					"messageType": "reply_message",
					"message": "Hi {{ contact.firstname }}, thanks for your message. We are closed right now and will get back to you on the next working day."
				}
			}
		}
	],
	"edges": [
		{ "id": "e1", "source": "trigger", "sourceHandle": "out", "target": "office_hours", "targetHandle": "in" },
		{ "id": "e2", "source": "office_hours", "sourceHandle": "true", "target": "assign", "targetHandle": "in" },
		{ "id": "e3", "source": "office_hours", "sourceHandle": "false", "target": "auto_reply", "targetHandle": "in" }
	]
}

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 3302 user ratings.
SMSGATEWAYAPI API1

REGISTER NOW

Discover our SMS platform today!

REGISTER