Webhook Payloads

Webhook payloads

The following sections outline the available webhooks and their corresponding payloads.

Note: The email event types are only relevant if you use Attentive's email product.

Subscribe

This event occurs when a user opts in to a subscription.

ParameterDescriptionExampleTypeNotes
typeType of eventsms.subscribedStringThe following options are available:
  • email.subscribed
  • sms.subscribed
timestampTimestamp of when the event occured originally1632945178104LongThis is a Unix timestamp in milliseconds format.
companyCompany of the originating event
display_nameName of the company that appears in the Attentive platformHudson & IvyString
company_idUnique identifier of the companyMDc6Q29tcGFueTUString
subscriberUser who has opted in
external_idUnique identifier of the subscriber16467358Long
phonePhone number of the subscriber+15555555555StringNote that this may not be included if the user only subscribed to receive email
emailEmail address of the subscriber[email protected]StringNote that this may not be included if the user only subscribed to receive SMS
external_identifiersIdentifiers from third-party sources
client_user_idList of customer user identifiers tied to the subscriberListOnly will be included if a customer user identifier is available.
custom identifiersCollection of customer identifiers tied to the subscriberObjectAdditional custom identifiers tied to a subscriber. Can be set via the Subscriptions API
creativeSign-up source of the subscription
nameName of the sign-up sourceText to JoinString
typeType of sign-up sourceTEXT_TO_JOINString
subtypeSubtype of sign-up sourceCODEString
subscriptionSubscription metadata of the subscribe event
typeThe specifc type of subscriptionMARKETINGStringThe following options are available:
  • MARKETING
  • TRANSACTIONAL

Subscribe event types

Two Subscribe event types can be triggered: email.subscribed and

sms.subscribed. The following sections outline each event

type and provide an example payload.

email.subscribed

This event occurs when a user opts in to an email subscription. The following is an example of the email.subscribed payload:


{

	"type": "email.subscribed",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "",

		"external_id": 16467358

	},

	"creative": {

		"name": "Desktop Fullscreen (Email + SMS) - 15% Off",

		"type": "DESKTOP",

		"subtype": "DYNAMIC"

	},

	"subscription": {

		"type": "MARKETING"

	}

}

sms.subscribed

This event occurs when a user opts in to an SMS subscription. The following is an example of the sms.subscribed payload:


{

	"type": "sms.subscribed",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "+15555555555 ",

		"external_id": 16467358

	},

	"creative": {

		"name": "Desktop Fullscreen (Email + SMS) - 15% Off",

		"type": "DESKTOP",

		"subtype": "DYNAMIC"

	},

	"subscription": {

		"type": "MARKETING"

	}

}

Unsubscribe

This event occurs when a user opts out of a subscription.

ParameterDescriptionExampleTypeNotes
typeType of eventsms.unsubscribedStringThe following options are available:
  • email.unsubscribed
  • sms.unsubscribed
timestampTimestamp of when the event occured originally1632945178104LongThis is a Unix timestamp in milliseconds format.
companyCompany of the originating event
display_nameName of the company that appears in the Attentive platformHudson & IvyString
company_idUnique identifier of the companyMDc6Q29tcGFueTUString
subscriberUser who has opted in
external_idUnique identifier of the subscriber16467358Long
phonePhone number of the subscriber+15555555555StringNote that this may not be included if the user only subscribed to receive email
emailEmail address of the subscriber[email protected]StringNote that this may not be included if the user only subscribed to receive SMS
external_identifiersIdentifiers from third-party sources
client_user_idList of customer user identifiers tied to the subscriberListOnly will be included if a customer user identifier is available.
custom identifiersCollection of customer identifiers tied to the subscriberObjectAdditional custom identifiers tied to a subscriber. Can be set via the Subscriptions API
subscriptionSubscription metadata of the unsubscribe event
typeThe specifc type of subscriptionMARKETINGStringThe following options are available:
  • MARKETING
  • TRANSACTIONAL

Unsubscribe event types

Two Unsubscribe event types can be triggered: email.unsubscribed and

sms.unsubscribed. The following sections outline each event

type and provide an example payload.

email.unsubscribed

This event occurs when a user opts out of an email subscription. The following is an example of the email.unsubscribed payload:


{

	"type": "email.unsubscribed",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "",

		"external_id": 16467358

	},

	"subscription": {

		"type": "MARKETING"

	}

}

sms.unsubscribed

This event occurs when a user opts out of an SMS subscription. The following is an example of the sms.unsubscribed payload:


{

	"type": "sms.unsubscribed",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "+15555555555",

		"external_id": 16467358

	},

	"subscription": {

		"type": "MARKETING"

	}

}

Message Sent

This event occurs when a message is sent.

ParameterDescriptionExampleTypeNotes
typeType of eventsms.sentStringThe following options are available:
  • sms.sent
  • email.sent
timestampTimestamp of when the event occured originally1632945178104LongThis is a Unix timestamp in milliseconds format.
companyCompany of the originating event
display_nameName of the company that appears in the Attentive platformHudson & IvyString
company_idUnique identifier of the companyMDc6Q29tcGFueTUString
subscriberUser who has opted in
external_idUnique identifier of the subscriber16467358Long
phonePhone number of the subscriber+15555555555StringNote that this may not be included if the user only subscribed to receive email
emailEmail address of the subscriber[email protected]StringNote that this may not be included if the user only subscribed to receive SMS
external_identifiersIdentifiers from third-party sources
client_user_idList of customer user identifiers tied to the subscriberListOnly will be included if a customer user identifier is available.
custom identifiersCollection of customer identifiers tied to the subscriberObjectAdditional custom identifiers tied to a subscriber. Can be set via the Subscriptions API
messageMessage that was sent
idUnique identifier of the messageMDc6TWVzc2FnZTEyNzI1MAString
typeThe type of message sentONE_TIMEString
textThe copy of the message sentShop this deal! https://example.attn.tv/l/abc/123String
channelThe channel the message was the sent throughTEXTString
subjectSubject of email Message50% all JeansStringNote that this only exists for Email Sent payloads
from_emailThe email address from which the email was sent[email protected]StringNote that this only exists for Email Sent payloads
to_emailEmail Address which the email was sent to[email protected]StringNote that this only exists for Email Sent payloads

Message sent event type

Two Message Sent event types can be triggered: sms.sent and email.sent. The following section outlines this event

type and provides example payloads.

sms.sent

This event occurs when an SMS message is sent. The following is an example of the sms.sent payload:


{

	"type": "sms.sent",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "+15555555555",

		"external_id": 16467358

	},

	"message": {

		"id": "MDc6TWVzc2FnZTEyNzI1MA",

		"type": "ONE_TIME",

                "text": "Shop this deal! https://example.attn.tv/l/abc/123",

                "channel": "TEXT"

	}

}

email.sent

This event occurs when an email message is sent. The following is an example of the email.sent payload:


{

	"type": "email.sent",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "+15555555555",

		"external_id": 16467358

	},

	"message": {

		"id": "MTY6RW1haWxNZXNzYWdlU2VudDI",

		"subject": "ONE_TIME",

		"from_email": "[email protected]",

                "to_email": "[email protected]",

                "channel": "EMAIL"

	}

}

Message Link Clicked

This event occurs when a message link is clicked.

ParameterDescriptionExampleTypeNotes
typeType of eventsms.message_link_clickStringThe following options are available:
  • sms.message_link_click
  • email.message_link_click
timestampTimestamp of when the event occured originally1632945178104LongThis is a Unix timestamp in milliseconds format.
companyCompany of the originating event
display_nameName of the company that appears in the Attentive platformHudson & IvyString
company_idUnique identifier of the companyMDc6Q29tcGFueTUString
subscriberUser who has opted in
external_idUnique identifier of the subscriber16467358Long
phonePhone number of the subscriber+15555555555StringNote that this may not be included if the user only subscribed to receive email
emailEmail address of the subscriber[email protected]StringNote that this may not be included if the user only subscribed to receive SMS
external_identifiersIdentifiers from third-party sources
client_user_idList of customer user identifiers tied to the subscriberListOnly will be included if a customer user identifier is available.
custom identifiersCollection of customer identifiers tied to the subscriberObjectAdditional custom identifiers tied to a subscriber. Can be set via the Subscriptions API
message_link_clickMessage link that was clicked
message_idGID of message idMDc6TWVzc2FnZTEString
link_targetThe link targethttps://testsite.com/String
message_typeThe type of message sentAUTOMATEDString
link_idThe identifier of the linkMTY6TWVzc2FnZUxpbmtDbGljazIString
channelThe channel the message was the sent throughTEXTString

Message link clicked event type

Two message link clicked event types can be triggered: sms.message_link_click and email.message_link_click. The following section outlines this event

type and provides example payloads.

sms.message_link_click

This event occurs when a link is clicked in an SMS message. The following is an example of the sms.message_link_click payload:


{

	"type": "sms.message_link_click",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "+15555555555",

		"external_id": 16467358

	},

	"message_link_click": {

		"linkTarget": "https://testsite.com/?utm_medium=text&utm_source=attentive&utm_campaign=exampletext",

		"messageId": "MDc6TWVzc2FnZTE",

		"messageType": "AUTOMATED",

                "linkId": "MTY6TWVzc2FnZUxpbmtDbGljazI"

	}

}

email.message_link_click

This event occurs when a link is clicked in an email message. The following is an example of the email.message_link_click payload:


{

	"type": "email.message_link_click",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "+15555555555",

		"external_id": 16467358

	},

	"message_link_click": {

		"linkTarget": "https://testsite.com/?utm_medium=text&utm_source=attentive&utm_campaign=exampletext",

		"messageId": "MDc6TWVzc2FnZTE",

		"messageType": "AUTOMATED",

                "linkId": "MTY6TWVzc2FnZUxpbmtDbGljazI"

                "channel": "EMAIL"

	}

}

SMS Inbound Message

This event occurs when a user replies to an SMS. It contains the payload of a subscriber’s response.

ParameterDescriptionExampleTypeNotes
typeType of eventsms.inbound_messageString
timestampTimestamp of when the event occurred originally1632945178104LongThis is a Unix timestamp in milliseconds format.
companyCompany of the originating event
display_nameName of the company that appears in AttentiveHudson & IvyString
company_idUnique identifier of the companyMDc6Q29tcGFueTUString
subscriberUser who has opted in
phonePhone number of the subscriber+15555555555StringNote that this may not be included if the user only subscribed to receive email
external_idUnique identifier of the subscriber16467358Long
external_identifiersIdentifiers from third-party sources
klaviyo_idUnique Klaviyo ID of subscriber (when integrated)Note that this may not be included if the Klaviyo integration isn’t enabled
shopify_idUnique Shopify Customer ID of subscriber (when integrated)Note that this may not be included if the Shopify integration isn’t enabled
client_user_idList of customer user identifiers tied to the subscriberListOnly included if a customer user identifier is available
custom_identifiersCollection of customer identifiers tied to the subscriberObjectAdditional custom identifiers tied to a subscriber. Can be set via the Subscriptions API
messageMessage that was received
typeThe type of message receivedTYPE_CONVERSATIONString
textThe copy of the message receivedHello Friends!String
to_phonePhone number from which the SMS was received+174881String

SMS Inbound Message Event Type

The following section outlines this event type and provides an example payload.

sms.inbound_message

This event occurs when a user replies to an SMS. The following is an example of the sms.inbound_message payload:


{

  "type": "sms.inbound_message",

  "timestamp": 1686927677855,

  "company": {

    "display_name": "Attentive",

    "company_id": "MDc6Q29tcGFueTIyNzM"

  },

  "subscriber": {

    "phone": "+15555555555",

    "external_id": 12345,

    "external_identifiers": {

      "klaviyo_id": [

        "5432"

      ],

      "shopify_id": [

        "4232"

      ],

      "client_user_id": [

        "4392"

      ],

      "custom_identifiers": {

        "test_custom_id": [

          "4444"

        ]

      }

    }

  },

  "message": {

    "type": "TYPE_CONVERSATION",

    "text": "Hello Friends!",

    "to_phone": "+174881"

  }

}

Custom Attribute Set

This event occurs when a custom attribute is set.

ParameterDescriptionExampleTypeNotes
typeType of eventcustom_attribute.setString
timestampTimestamp of when the event occured originally1632945178104LongThis is a Unix timestamp in milliseconds format.
companyCompany of the originating event
display_nameName of the company that appears in the Attentive platformHudson & IvyString
company_idUnique identifier of the companyMDc6Q29tcGFueTUString
subscriberUser who has opted in
external_idUnique identifier of the subscriber16467358Long
phonePhone number of the subscriber+15555555555StringNote that this may not be included if the user only subscribed to receive email
emailEmail address of the subscriber[email protected]StringNote that this may not be included if the user only subscribed to receive SMS
external_identifiersIdentifiers from third-party sources
client_user_idList of customer user identifiers tied to the subscriberListOnly will be included if a customer user identifier is available.
custom identifiersCollection of customer identifiers tied to the subscriberObjectAdditional custom identifiers tied to a subscriber. Can be set via the Subscriptions API
user_propertyInformation about the user property
idGID of user propertyMTY6Q3VzdG9tUHJvcGVydHlJZGlkOiAiMjg3IgoString
nameThe name of the propertyFavorite ColorString
valueThe value of the propertyBlueString

Custom attribute set event type

One Custom Attribute Set event type can be triggered: custom_attribute.set. The following section outlines this event

type and provides an example payload.

custom_attribute.set

This event occurs when a custom attribute is set. The following is an example of the custom_attribute.set payload:


{

	"type": "custom_attribute.set",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "+15555555555",

		"external_id": 16467358,

		"external_identifiers": {

			"klaviyo_id": ["abc123"],

			"shopify_id": ["123456789"]

		}

	},

	"user_property": {

		"id": "MTY6Q3VzdG9tUHJvcGVydHlJZGlkOiAiMjg3Igo",

		"name": "Favorite Color",

		"value": "Blue"

	}

}

Email Opened

This event occurs when an email is opened.

ParameterDescriptionExampleTypeNotes
typeType of eventemail.openedStringThe following options are available:
  • email.opened
timestampTimestamp of when the event occured originally1632945178104LongThis is a Unix timestamp in milliseconds format.
companyCompany of the originating event
display_nameName of the company that appears in the Attentive platformHudson & IvyString
company_idUnique identifier of the companyMDc6Q29tcGFueTUString
subscriberUser who has opted in
external_idUnique identifier of the subscriber16467358Long
phonePhone number of the subscriber+15555555555StringNote that this may not be included if the user only subscribed to receive email
emailEmail address of the subscriber[email protected]StringNote that this may not be included if the user only subscribed to receive SMS
external_identifiersIdentifiers from third-party sources
client_user_idList of customer user identifiers tied to the subscriberListOnly will be included if a customer user identifier is available.
custom identifiersCollection of customer identifiers tied to the subscriberObjectAdditional custom identifiers tied to a subscriber. Can be set via the Subscriptions API
messageMessage that was opened
idUnique identifier of the messageMDc6TWVzc2FnZTEString
typeThe type of message openedONE_TIMEString
nameThe name of the message openedDiscount Available!String
channelThe channel the message was the sent throughEMAILString

Email Opened event type

The following section outlines this event type and provides an example payload.

email.opened

This event occurs when an email is opened. The following is an example of the email.opened payload:


{

	"type": "email.opened",

	"timestamp": 1632945178104,

	"company": {

		"display_name": "Hudson & Ivy",

		"company_id": "MDc6Q29tcGFueTU"

	},

	"subscriber": {

		"email": "[email protected]",

		"phone": "+15555555555",

		"external_id": 16467358

	},

	"message": {

                "id": "MDc6TWVzc2FnZTE",

                "type": "JOURNEY",

                "name": "Message Name",

                "channel": "TEXT"

	}

}