Webhook payloads are the actual objects you will receive on trigger.
The webhook payload object is sent whenever an event triggers that you have subscribed to. Inbound and outbound message webhooks re-use the same object. We have not added other events yet, but platform events will likely use a slightly different object structure due to their different nature.
The webhook payload object for inbound messages
This is essentially the message object you also get in the response of the POST /messages
call.
{
"id": "pe_prtjoperfoen4i0fne0i", // the ID of the event
"event": "message_inbound", // the type of the event
"message": {
"id": "ms_o03342fnon02594gn24142", // the ID of the message
"url": "/messages/ms_o03342fnon02594gn24142",
"created_at": "string", // created_at (UTC) of the message
"updated_at": "string", // updated_at (UTC) of the message
"status": "sent", // The status of the message (enum: sent, failed, received)
"content": { // the content object depends on the message type
"body": "Hello world!", // the body text
"type": "text" // The type of the content (enum: text, email, whats_app_template, generic_template)
},
"direction": "inbound", // the direction of the message
"to": {
"channel_id": "string" // the ID of the message channel
},
"from": {
"id": "ct_dqweonoq3noqrrnwr343f4in", // the ID of the contact
"identifier": "+4915222349999", // the identifier of the contact (phone in E164 format, email or name)
"url": "/contacts/ct_pjefnnfdivnoifdv"
},
"in_reply_to": null // null or message_id of the message the incoming message was a reply to.
}
}
The webhook payload object for outbound messages
{
"id": "pe_prtjoperfoen4i0fne0i", // the ID of the event
"event": "message_outbound", // the type of the event
"message": {
"id": "ms_o03342fnon02594gn24142", // the ID of the message
"url": "/messages/ms_o03342fnon02594gn24142",
"created_at": "string", // created_at (UTC) of the message
"updated_at": "string", // updated_at (UTC) of the message
"status": "sent", // The status of the message (enum: sent, failed, received)
"content": { // the content object depends on the message type
"body": "Hello world!", // the body text
"type": "text" // The type of the content (enum: text, email, whats_app_template, generic_template)
},
"direction": "outbound", // the direction of the message
"to": [{
"id": "ct_dqweonoq3noqrrnwr343f4in", // the ID of the contact
"identifier": "+4915222349999", // the identifier of the contact (phone in E164 format, email or name)
"url": "/contacts/ct_pjefnnfdivnoifdv"
}],
"from": {
"channel_id": "string" // the ID of the message channel
},
"in_reply_to": null // null or message_id of the message the incoming message was a reply to.
}
}
The webhook payload object for failed messages
{
"id": "pe_prtjoperfoen4i0fne0i", // the ID of the event
"event": "message_outbound", // the type of the event
"message": {
"id": "ms_o03342fnon02594gn24142", // the ID of the message
"url": "/messages/ms_o03342fnon02594gn24142",
"created_at": "string", // created_at (UTC) of the message
"updated_at": "string", // updated_at (UTC) of the message
"status": "sent", // The status of the message (enum: sent, failed, received)
"content": { // the content object depends on the message type
"body": "Hello world!", // the body text
"type": "text" // The type of the content (enum: text, email, whats_app_template, generic_template)
},
"direction": "outbound", // the direction of the message
"to": [{
"id": "ct_dqweonoq3noqrrnwr343f4in", // the ID of the contact
"identifier": "+4915222349999", // the identifier of the contact (phone in E164 format, email or name)
"url": "/contacts/ct_pjefnnfdivnoifdv"
}],
"from": {
"channel_id": "string" // the ID of the message channel
},
"in_reply_to": null // null or message_id of the message the incoming message was a reply to.
},
"errors": [
{
"title":"title of the error",
// enum; please see messaging errors in our Guides section (https://developers.superchat.com/docs/messaging-errors)
"type": "type of the error"
}
]
}
Webhook payload for contact updates and created contacts
{
"id": "pe_AdOmIJKl32lqisUz46nuK",
"contact": {
"id": "ct_3BWA0Iuu494u4rirh",
"first_name": "Fist Name",
"last_name": "Last Name",
"gender": "male",
"handles": [
{
"id": "ch_0yTfWdTA8s64urJdaJkL",
"type": "mail", // enum(phone, mail, instagram, facebook_messenger, telegram, google_business_messaging)
"value": "[email protected]"
}
],
"custom_attributes": [
{
"id": "ca_1Ren9DPtzfrhfny9H6l",
"contact_id": "ct_3BWA0IuKw584ururb5NgAf",
"name": "Date of Birth",
"value": "1990-09-12",
"type": "dateonly",
"url": "/contacts/ct_3BWA0IuKw584ururb5NgAf/custom-attributes/ca_1Ren9DPtzfrhfny9H6l"
},
{
"id": "ca_NdHp4UhzMmn52gnAim3yZ",
"contact_id": "ct_3BWA0IuKw58H3XJb5NgAf",
"name": "Favourite brand(s)",
"value": [
"Brand 1",
"Brand 2"
],
"type": "multi_select",
"url": "/contacts/ct_3BWA0IuKw584ururb5NgAf/custom-attributes/ca_NdHp4UhzMmn52gnAim3yZ"
},
...
],
"url": "/contacts/ct_3BWA0Iuu494u4rirh",
"created_at": "2023-09-08T08:36:42.858594Z",
"updated_at": "2023-12-04T11:04:16.497135Z"
},
"event": "contact_updated" // enum(contact_updated, contact_created)
}
Webhook payload for contact deletions
{
"id": "pe_AdOmIJKl32lqisUz46nuK",
"contact": {
"id": "ct_3BWA0Iuu494u4rirh",
},
"event": "contact_deleted"
}
Webhook payload for conversation status changes
{
"id": "pe_AdOmIJKl32lqisUz46nuK",
"conversation": {
"id": "cv_pjwefojionfoienonrg",
"url": "/conversations/cv_pjwefojionfoienonrg",
"channel": {
"type": "whats_app",
"id": "mc_023u40oqnscone0fu30cese32dweh",
"url": "/channels/mc_023u40oqnscone0fu30cese32dweh"
},
"status": "snoozed", // enum(snoozed, open, done)
"snoozed_until": "1999-12-02T01:37:52.878Z", // nullable, only exists for snoozed conversation
"time_window": {
"state": "open",
"open_until": "2013-02-12T16:15:37.655Z"
},
"contacts": [
{
"id": "co_023u40oqncese32dweh",
"url": "/contacts/co_023u40oqncese32dweh"
}
],
"assigned_users": [
{
"id": "us_023u40oqncese32dweh",
"email": "[email protected]",
"url": "/users/us_023u40oqncese32dweh"
},
{
"id": "us_123u40oqncese32dweh",
"email": "[email protected]",
"url": "/users/us_123u40oqncese32dweh"
}
],
"labels": [
{
"id": "la_023u40oqncese32dweh",
"name": "Recurring customer.",
"url": "/labels/la_023u40oqncese32dweh"
},
{
"id": "la_123u40oqncese32dweh",
"name": "Recurring customer.",
"url": "/labels/la_123u40oqncese32dweh"
}
],
"inbox": {
"id": "ib_12394ru02wdoncn3d034",
"url": "/inboxes/ib_12394ru02wdoncn3d034",
"name": "main inbox"
}
},
"event": "conversation_opened" // enum(conversation_opened, conversation_snoozed, conversation_done)
}
Webhook payload for new conversation notes
{
"id": "pe_AdOmIJKl32lqisUz46nuK",
"note": {
"id": "no_pj0jr09u450ut434ffw",
"url": "/conversations/cv_epofrjoperjpoeroinfo/notes/no_epofrjhfithsjnfo",
"created_at": "2023-02-28T10:01:12.928Z",
"updated_at": "2023-03-01T10:02:12.953Z",
"content": "Hi there",
"author": {
"id": "us_023u40oqncese32dweh",
"url": "/users/us_023u40oqncese32dweh",
"email": "[email protected]"
}
},
"event": "note_created"
}