System events
These are generated by our platform when some event occurs. You can choose to receive these events on your callback URL from the settings in app dashboard. For example, system events are received when;
- A system event of type
template
is received when the status of template is updated. For example, a submitted template has been approved or rejected. - A system event of type
account
is received. For example, when the status of the submitted Phone Number or Display Name for a WABA is updated.
The types of system-events
- Template events
- Account events
Template events
The following template-event
is sent notifying of the template's status update.
{
"app":"jeet20",
"timestamp":1636986446609,
"version":2,
"type":"template-event",
"payload":{
"id":"4dacef15-6c04-12db-b393-6190ac567eff",
"status":"rejected/approved/deleted/disabled",
"elementName":"abcd",
"languageCode":"en_US",
"rejectedReason":"INAVLID_FORMAT"
}
}
The following template-event
is sent notifying of the template's paused status
{
"app": "jeet20",
"timestamp": 1636986446609,
"version": 2,
"type": "template-event",
"payload": {
"type": "status-update",
"id": "4dacef15-6c04-12db-b393-6190ac567eff",
"status": "paused",
"elementName": "abcd",
"languageCode": "en_US",
"description": "Your WhatsApp message template has been paused for 3 hours until Apr 25 at 8:07 AM UTC because it had issues."
}
}
Template Category Migration Update
To line up with the template category change from WhatsApp, starting from 29th March 2023, the template event payload will further be categorized into two types - status-update and category-update events.
As Meta migrates your WhatsApp Business API templates to new categories, Gupshup too will synchronously migrate your templates to the new categories. If subscribed to the system events for your app, the category-update event will be sent on your app's callback URL notifying you of the old category and the new category.
The types of template-events (applicable from 29th March 2023)
{
"app":"jeet20",
"timestamp":1636986446609,
"version":2,
"type":"template-event",
"payload":{
"type":"status-update",
"id":"4dacef15-6c04-12db-b393-6190ac567eff",
"status":"rejected/approved/deleted/disabled",
"elementName":"abcd",
"languageCode":"en_US",
"rejectedReason":"INAVLID_FORMAT"
}
}
{
"app": "jeet20",
"timestamp": 1636986446609,
"version": 2,
"type": "template-event",
"payload": {
"type": "category-update",
"id": "4dacef15-6c04-12db-b393-6190ac567eff",
"elementName": "abcd",
"languageCode": "en_US",
"category": {
"old": "OTP",
"new": "AUTHENTICATION/MARKETING/UTILITY"
}
}
}
The payload object description
Key | Description | Example |
---|---|---|
type | The type of template event. Possible values are: status-update , and category-update | category-update |
id | It is the unique identifier for a template on the Gupshup platform. You can find the template ID using the API Get template list | 4dacef15-6c04-12db-b393-6190ac567eff |
status | The updated status of a template. Possible values are: REJECTED , APPROVED , DELETED , DISABLED . | REJ ECTED |
elementName | The unique name for a template set during template creation. The elementName of a template is unique within a WABA's namespace. | order_update |
languageCode | The language of the template. You can refer to the language code and the associated language here. | en_US |
rejectedReason | The reason for template rejection. | INVALID_FORMAT |
category | This parameter informs of the category change. category.old is the old template category, and category.new is the new template category. Possible values for category.new are Authentication, Marketing, and Utility. | Utility |
Account events
Account events are received when an event occurs in a specific WABA. For example, when a WhatsApp business policy is violated by a WABA, or if the messaging tier limit of a WABA is updated.
The types of account-events
{
"app": "jeet20",
"timestamp": 1636986446609,
"version": 2,
"type": "account-event",
"payload": {
"type": "review-event",
"payload": {
"status": "approved",
"actionDate": "January 31,2021"
}
}
}
{
"app": "jeet20",
"timestamp": 1636986446609,
"version": 2,
"type": "account-event",
"payload": {
"type": "status-event",
"payload": {
"status": "ACCOUNT_VIOLATION",
"violation_type": "GAMBLING"
}
}
}
{
"app":"appname",
"timestamp":1636986446609,
"version":2,
"type":"account-event",
"phone":"9180xxxxxxxx",
"payload":{
"type":"status-event",
"payload":{
"status":"ACCOUNT_RESTRICTED",
"restrictionInfo":[
{
"restrictionType":"RESTRICTION_ADD_PHONE_NUMBER_ACTION",
"expiration":1636986446609
},
{
"restrictionType":"RESTRICTED_BIZ_INITIATED_MESSAGING",
"expiration":1636986446609
},
{
"restrictionType":"RESTRICTED_CUSTOMER_INITIATED_MESSAGING",
"expiration":1636986446609
}
]
}
}
}
{
"app": "jeet20",
"timestamp": 1636986446609,
"version": 2,
"type": "account-event",
"payload": {
"type": "pndn-event",
"payload": {
"status": "approved/rejected",
"rejectedReason": "INVALID_FORMAT"
}
}
}
{
"app": "jeet20",
"timestamp": 1636986446609,
"version": 2,
"type": "account-event",
"payload": {
"type": "tier-event",
"payload": {
"event": "onboarding/ upgrade/ downgrade /unflagged/ flagged",
"oldLimit": "TIER_10K",
"currentLimit": "TIER_100K"
}
}
}
{
"app":"appname",
"timestamp":1636986446609,
"version":2,
"type":"account-event",
"payload":{
"type":"capability-event",
"payload":{
"maxDailyConversationPerPhone":100,
"maxPhoneNumbersPerBusiness":100
}
}
}
The payload object description
Type | Description |
---|---|
review-event | This event is received when the submitted WABA is approved or rejected. Possible values: APPROVED , REJECTED . |
status-event | This event is received when the status of the WABA has changed. Possible values: ACCOUNT_VIOLATION : The WABA has been flagged due to policy violation, additionally, the reason for the violation is also received.ACCOUNT_VERIFIED : When an app of type of Embed is updated from Sandbox to Live.ACCOUNT_RESTRICTED : The WABA has been restricted for its business capabilities due to WhatsApp's policy violations. One or more of following restriction types may be imposed on your WABA:- RESTRICTION_ADD_PHONE_NUMBER_ACTION - Restriction on adding phone numbers to WABA.- RESTRICTED_BIZ_INITIATED_MESSAGING - Restriction on sending business-initiated messages.- RESTRICTED_CUSTOMER_INITIATED_MESSAGING - Restriction on ability to respond to customer-initiated messages.Along with the type , you will also receive the expiry for the restriction.Learn more about policy violations. Learn more about WABA restrictions. An email will be sent informing you of violations and restrictions received for your WABA. |
pndn-event | This event is received when the status of the submitted Phone number/Display Name is updated. Possible values: INVALID_FORMAT , NAME_END_CLIENT_VIOLATION , NAME_FORMAT_UNACCEPTABLE , NAME_NOT_CONSISTENT , NAME_INDIVIDUAL_ISSUE , and NAME_ENDCLIENT_NOTRELATED . |
tier-event | This events notifies you when the quality-related status of a phone number has an update. Possible values for events: ONBOARDING , UPGRADE , DOWNGRADE , UNFLAGGED , and FLAGGED .The current tier limit where this account is and the new tier if it has been updated. Possible values are: TIER_1K , TIER_10K , and TIER_100K . |
capability-event | This event will update you on your WABA's messaging capabilities. It includes: - maxDailyConversationPerPhone - the maximum number of unique people a phone number can send messages to. See Messaging Limits for more information.- maxPhoneNumbersPerBusiness - Includes the maximum number of phone numbers that can belong to a business. |
Updated 3 days ago
In the next chapter of this guide, you'll learn about inbound events type: Message events