Setup: Webhooks
Webhooks are accessible within your TextOut environment through Account > Integrations. You must be an Account Owner or Account Admin to enable and edit Account Webhooks.
Webhooks capture real-time details from your texting activity and can be enabled in the Integrations view.
Standard Format
All TextOut webhooks share a common data structure, but the event_data varies based on the event_type.
{ "event_type": "", "event_time": "", "event_data": { } }
Field | Type | Description |
event_type | string | see: Event Types |
event_time | int | Datetime the event was triggered. Example: 2020-01-01T22:25:00.7038497Z |
event_data | object | see: Event Types |
Event Types
Each event_type has its own unique event_data schema.
message_received
Triggered when a message is received.
event_data:{ contact:{}, message:{} }
Field | Type | Description |
contact | object | see: Contact |
message | object | see: Message |
message_sent_initial
Triggered when an initial outbound message is sent.
event_data:{ contact:{}, message:{} }
Field | Type | Description |
contact | object | see: Contact |
message | object | see: Message |
message_sent
Triggered when a non-initial outbound is sent.
event_data:{ contact:{}, message:{} }
Field | Type | Description |
contact | object | see: Contact |
message | object | see: Message |
message_error
Triggered when aggregator returns error code for the sent message.
event_data:{ contact:{}, message:{}, error_code: "", error_message: "" }
Field | Type | Description |
contact | object | see: Contact |
message | object | see: Message |
error_code | string | a short code returned by the aggregator |
error_message | string | description of code |
datatag_added
Triggered when data tag is attached to a conversation
event_data:{ contact:{}, datatag:{} }
Field | Type | Description |
contact | object | see: Contact |
message | object | see: Data Tag |
data_removed
Triggered when data tag is attached to a conversation.
event_data:{ contact:{}, message:{} }<br>
Field | Type | Description |
contact | object | see: Contact |
message | object | see: Data Tag |
datatag_updated
Triggered when the data tag value is updated
event_data:{ contact:{}, datatag:{} }
Field | Type | Description |
contact | object | see: Contact |
message | object | see: Data Tag |
Shared Object Types
Contact
An object that represents an important Contact in TextOut.
"contact": { "id": "12345", "first_name": "John", "last_name": "Doe", "phone": "+16468089496", "extra_properties": { "vanid": "ABC123", "audienceName": "vanSupporters", "favoriteColor": "green" } }
Field | Type | Description |
id | string | Unique Identifier for Contact |
first_name | string | Contact's First Name |
last_name | string | Contact's Last Name |
phone | string | Phone in e164 format Example: +12345551234 |
extra_properties | object | see: Extra Properties |
Message
An object that represents a message sent or received in TextOut.
"message": { "id": "12345", "body": "No" }
Field | Type | Description |
id | string | Unique Identifier |
body | string | Message Text |
Data Tag
An object that represents a data tag attached to a contact in TextOut.
datatag: { id: "12345", name: "Support Score", value: "8" }
Field | Type | Description |
id | string | Unique Identifier |
name | string | The Data Tag's Name |
value | string | Empty for regular scripted data tags. For free-text data tags, the value is captured by the Texter. |
Extra Properties
An object filled with key-value pairs to store additional details. These keys and values are often imported, and organization and key naming will vary.
extra_properties:{ "vanid":"123ABC", "mySourceId":"987654321", "favoriteColor": "blue" }