Create new Sakari webhooks in the Webhooks tab of Account Settings.
- Click the Create Webhook button
- Select your preferred webhook triggering criteria
- Select your destination URL
- Click Save
Webhook triggers:
Message Received - triggered when a new message is received from a contact
Message Sent - triggered when a new message is sent from a contact
Message Status - triggered when a message status changes
Contact Created - triggered when a contact is created in Sakari
Contact Updated - triggered when a contact is updated in Sakari
Contact Removed - triggered when a contact is deleted in Sakari
Contact Opt Out - triggered when a contact opts-out of text messaging
Contact Opt In - triggered when a contact opts-in to text messaging
Conversation Started - triggered when a new conversation is created with a contact
Conversation Closed - triggered when a conversation is closed with a contact
An example request body would look like the following.
{
"accountId": "$ACCOUNT_ID",
"eventType": "message-received",
"payload": {
"accountId": "$ACCOUNT_ID",
"conversation": {
"id": "$CONVERSATION_ID",
"closed": "$CLOSED_AT",
"group": {
"id": "$GROUP_ID"
},
"phoneNumber": {
"id": "$PHONE_NUMBER_ID",
"number": "$PHONE_NUMBER",
"country": "US"
}
},
"group": {
"id": "$GROUP_ID",
"name": "$GROUP_NAME"
},
"contact": {
"id": "$CONTACT_ID",
"firstName": "$FIRST_NAME",
"lastName": "$LAST_NAME",
"mobile": {
"number": "$MOBILE_NUMBER",
"country": "US"
},
"email": "$USER_EMAIL",
"created": {
"at": "$CREATED_AT",
"by": {
"id": "$USER_ID",
"name": "$USER_NAME",
"source": "$SOURCE",
"email": "$USER_EMAIL"
}
},
"hubspot": {
"vid": "$HUBSPOT_VID",
"id": "$HUBSPOT_ID"
}
},
"job": {
"id": "$JOB_ID"
},
"type": "sms",
"message": "Test message 👋🏻",
"status": "received",
"outgoing": false,
"country": "US",
"segments": 1,
"price": "$PRICE",
"read": false,
"operational": false,
"media": [],
"id": "$MESSAGE_ID",
"created": {
"at": "$CREATED_AT",
"by": {
"id": "$CREATOR_ID",
"name": "$USER_NAME",
"source": "$SOURCE",
"subSource": "$SUB_SOURCE"
}
},
"updated": {
"at": "$UPDATED_AT",
"by": {
"id": "$UPDATER_ID",
"name": "$USER_NAME",
"source": "$SOURCE",
"subSource": "$SUB_SOURCE"
}
}
}
}