Webhook Events & Payloads

For each webhook event, you can review when the event occurs, an example payload, and descriptions about the payload object parameters.

You can create webhook endpoints that subscribe to the events listed on this page. Each webhook event includes an example payload.

Each webhook event payload also contains properties unique to the event depending on its type. You can find the unique properties in the individual event type sections.

See also Test webhooks for the detailed structured payload object.

📘

For more specific payload examples, see Webhook Payload Examples.

Webhook payload object common properties

KeyTypeDescription
idstringUnique identifier for the event.
typestringType of the event (e.g., sms.message.updated).
apiVersionstringThe API version used to render this event. This property is currently always v2.
createTimestringThe time at which this event is created, formatted in RFC 3339. e.g., 2022-06-01T12:00:00.000Z.

email.delivery.updated

Occurs when an email delivery status is updated, and the status changes to delivered or failed.

Payload property emailDelivery is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "email.delivery.updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "emailDelivery": {
    "emailId": "em123456",
    "recipientAddress": "[email protected]",
    "status": "failed",
    "errorCode": "402",
    "errorMessage": "Unsubscribes",
    "externalId": "ext_1234567890"
  }
}

sms.inbound.received

Occurs when an SMS inbound message is received, which means a user replies to your message. Please contact our customer service, and register your Sender IDs to enable this feature.

Payload property smsInbound is included for this event type. For example:

{
  "id": "evt_eBttMrYvJhzLpzzX",
  "type": "sms.inbound.received",
  "apiVersion": "v2",
  "createTime": "2023-02-02T12:00:05.000Z",
  "smsInbound": {
    "id": "message-id",
    "from": "+447901614024",
    "to": "+1xxxxxx",
    "text": "yes",
    "sendTime": "2023-02-02T12:00:00.000Z"
  }
}

sms.message.updated

Occurs when an SMS message status is updated, and the status changes to delivered or undelivered.

Payload property sms is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "sms.message.updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "sms": {
    "id": "string",
    "to": "+447901614024",
    "status": "delivered",
    "text": "Your verification code is 123456.",
    "senderId": "YCloud",
    "regionCode": "GB",
    "totalSegments": 1,
    "totalPrice": 0.0085,
    "currency": "USD",
    "createTime": "2022-03-01T12:00:00.000Z",
    "updateTime": "2022-03-01T12:00:00.000Z"
  }
}

voice.message.updated

Occurs when a voice message status is updated, and the status changes to delivered or undelivered.

Payload property voice is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "voice.message.updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "voice":  {
    "id": "v123456",
    "to": "+447901614024",
    "status": "delivered",
    "verificationCode": "1234",
    "language": "en",
    "regionCode": "GB",
    "totalPrice": 0.0085,
    "currency": "USD",
    "errorCode": "Error code when the message is undeliverable.",
    "createTime": "2022-03-01T12:00:00.000Z",
    "updateTime": "2022-03-01T12:00:00.000Z",
    "externalId": "ext_123456"
  }
}

whatsapp.business_account.deleted

Occurs when a WhatsApp Business Account is deleted.

Payload property whatsappBusinessAccount is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.business_account.deleted",
  "apiVersion": "v2",
  "createTime": "2023-10-12T12:00:00.000Z",
  "whatsappBusinessAccount":  {
    "id": "106681...",
    "name": "whatsapp-business-account-name"
  }
}

whatsapp.business_account.updated

Occurs when a policy violation happened, a WhatsApp Business Account has been banned and more. For more examples, see WhatsApp Business Account Updated Examples.

Payload property whatsappBusinessAccount is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.business_account.updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "whatsappBusinessAccount":  {
    "id": "106681...",
    "name": "whatsapp-business-account-name",
    "accountReviewStatus": "APPROVED",
    "updateEvent": "ACCOUNT_RESTRICTION",
    "restrictions": [
      {
        "restrictionType": "RESTRICTED_ADD_PHONE_NUMBER_ACTION",
        "expiration": "2022-12-12T07:09:27.000Z"
      }
    ],
    "banState": "REINSTATE",
    "banDate": "December 9, 2022",
    "violationType": "SPAM"
  }
}

whatsapp.inbound_message.received

Occurs when a WhatsApp inbound message is received. For more examples, see WhatsApp Inbound Message Webhook Examples.

Payload property whatsappInboundMessage is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.inbound_message.received",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "whatsappInboundMessage":  {
    "id": "wim123456",
    "wabaId": "whatsapp-business-account-id",
    "from": "+447901614024",
    "customerProfile": {
      "name": "John"
    },
    "to": "+447901614024",
    "sendTime": "2022-03-01T12:00:00.000Z",
    "type": "text",
    "text": {
      "body": "Hi there!"
    }
  }
}

whatsapp.message.updated

Occurs when a WhatsApp outbound message status is updated, and the status changes to failed, sent, delivered, or read. For more examples, see WhatsApp Message Updated Webhook Examples.

Payload property whatsappMessage is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.message.updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "whatsappMessage":  {
    "id": "63f5d602367ea403f8175a6c",
    "wamid": "wamid.BgNODYxN...",
    "wabaId": "whatsapp-business-account-id",
    "from": "+447901614024",
    "to": "+447901614024",
    "status": "read",
    "type": "template",
    "template": {
      "name": "login_otp",
      "language": {
        "code": "862031",
        "policy": "deterministic"
      }
    },
    "conversation": {
      "id": "8078ed05301c40a08d3d1845c94ca18b",
      "type": "REGULAR",
      "originType": "authentication",
      "expireTime": "2022-03-02T12:00:00.000Z"
    },
    "regionCode": "GB",
    "pricingCategory": "authentication_international",
    "totalPrice": 0.085,
    "currency": "USD",
    "createTime": "2022-03-01T12:00:00.000Z",
    "sendTime": "2022-03-01T12:00:01.000Z",
    "deliverTime": "2022-03-01T12:00:02.000Z",
    "readTime": "2022-03-01T12:00:02.000Z",
    "externalId": "ext_123456"
  }
}

Note

  • There is a charge when the first business message with this conversation ID is delivered, initiating the 24 hour conversation session. totalPrice is only an estimated price before the first message is delivered, and it becomes the final price when the status is delivered or read. The balance taken up by those messages that are sent but haven't been delivered will not be available until the messages are dropped (Sent messages that are not delivered for 30 days are dropped).
  • conversation is included after the message is sent. conversation.expireTime is only an estimated time when the first message of this conversation is sent, and it will be refreshed when the first message of this conversation is delivered. See also Tracking Conversations.
  • It's possible for us to generate more than 1 delivered webhook event for the same message, especially if the end customer is using multiple devices.

The illustration below reflects an extreme example of conversation refreshing.

whatsapp-conversation-refreshing.png

whatsapp.phone_number.deleted

Occurs when a WhatsApp business account phone number is deleted from YCloud. This may happen in the following situations:

  1. You deleted a phone number from the YCloud Dashboard.
  2. You deleted a phone number from the Meta WhatsApp Business Platform, which caused YCloud to delete it.

Payload property whatsappPhoneNumber is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.phone_number.deleted",
  "apiVersion": "v2",
  "createTime": "2023-10-12T12:00:00.000Z",
  "whatsappPhoneNumber":  {
    "phoneNumber": "+16315551111",
    "displayPhoneNumber": "+1 631-555-1111",
    "wabaId": "whatsapp-business-account-id"
  }
}

whatsapp.phone_number.name_updated

Occurs when a WhatsApp business account phone number's name has been approved or rejected. See also phone_number_name_update.

Payload property whatsappPhoneNumber is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.phone_number.name_updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "whatsappPhoneNumber":  {
    "phoneNumber": "+16315551111",
    "displayPhoneNumber": "+1 631-555-1111",
    "wabaId": "whatsapp-business-account-id",
    "decision": "APPROVED",
    "requestedVerifiedName": "requested-verified-name",
    "rejectionReason": "NONE",
    "status": "CONNECTED"
  }
}

whatsapp.phone_number.quality_updated

Occurs when a WhatsApp business account phone number's quality-related status is updated. See also phone_number_quality_update.

Payload property whatsappPhoneNumber is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.phone_number.quality_updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "whatsappPhoneNumber":  {
    "phoneNumber": "+16315551111",
    "displayPhoneNumber": "+1 631-555-1111",
    "wabaId": "whatsapp-business-account-id",
    "qualityRating": "RED",
    "messagingLimit": "TIER_1K",
    "qualityUpdateEvent": "UNFLAGGED",
    "status": "CONNECTED"
  }
}

whatsapp.template.category_updated

Occurs when a WhatsApp template category is updated. The old category will be set to previousCategory.

Payload property whatsappTemplate is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.template.category_updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "whatsappTemplate":  {
    "wabaId": "whatsapp-business-account-id",
    "name": "sample_template",
    "language": "en",
    "category": "MARKETING",
    "previousCategory": "UTILITY"
  }
}

whatsapp.template.quality_updated

Occurs when a WhatsApp template quality updated, and the qualityRating may change to GREEN, YELLOW, RED, or UNKNOWN. See also Template Quality Rating.

Payload property whatsappTemplate is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.template.quality_updated",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "whatsappTemplate":  {
    "wabaId": "whatsapp-business-account-id",
    "name": "sample_template",
    "language": "en",
    "category": "MARKETING",
    "status": "APPROVED",
    "qualityRating": "GREEN"
  }
}

whatsapp.template.reviewed

Occurs when a WhatsApp template statusUpdateEvent happened, such as REJECTED, APPROVED, PENDING_DELETION, and the status may change to REJECTED, APPROVED, PAUSED, DISABLED, IN_APPEAL, or DELETED. For more examples, see WhatsApp Template Reviewed Webhook Examples.

Payload property whatsappTemplate is included for this event type. For example:

{
  "id": "evt_djeIQXaQPQyUcRFi",
  "type": "whatsapp.template.reviewed",
  "apiVersion": "v2",
  "createTime": "2022-03-01T12:00:00.000Z",
  "whatsappTemplate":  {
    "wabaId": "whatsapp-business-account-id",
    "name": "sample_template",
    "language": "en",
    "category": "OTP",
    "status": "REJECTED",
    "reason": "The message template is a duplicate of an existing template.",
    "createTime": "2022-03-01T12:00:00.000Z",
    "updateTime": "2022-03-01T12:00:00.000Z",
    "statusUpdateEvent": "REJECTED"
  }
}