Set subscription for an app

This API endpoint enables partners to subscribe to WhatsApp events (webhooks) for their partner application. When subscribed, WhatsApp will send real-time event notifications to the specified webhook URL for various event types like incoming messages, message status updates, user interactions, and more. This is essential for building interactive WhatsApp Business applications.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
📘

Subscriptions can now be set for sandbox apps as well. Once the app goes live, the current subscription will be retained.

Request Parameters

KeyDescriptionMandatory/OptionalConstraint

PARTNER_APP_TOKE

N

Access Token for the applicationShould be a valid Partner App Access Token
modesStages in subscription processingMandatoryShould be one of the following : NONE, READ, DELIVERED, SENT, DELETED, FLOWS_MESSAGE,PAYMENTS, ALL, OTHERS,COEXISTENCE,TEMPLATE,ACCOUNT
tagName tag for URLMandatoryMust be unique and mandatory for each app
urlCallback URLMandatoryShould be a valid URL
versionVersionMandatoryShould be one of the following : 2,3
showOnUIUsed internallyOptionalDefault value is false
meta

meta json string (meta json key and value

will be passed to the subscription URL as headers , users can set custom headers for the URL which can be used for authentication)

Optional

Sample Request

curl --location 'https://partner.gupshup.io/partner/app/:appId/subscription' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--data-urlencode 'modes={{modes}}' \
--data-urlencode 'tag={{tagName}}' \
--data-urlencode 'showOnUI={{true/false}}' \
--data-urlencode 'version={{versionNumber}}' \
--data-urlencode 'url={{url}}'
--data-urlencode 'meta={{meta}}'

Sample Response

{
	"status": "success",
	"subscription": 
	{
		"active": true,
		"appId": "bf9ee64c-xxxxxxxx-xxxx-xxxx577007c4",
		"createdOn": 1705574838954,
		"id": "8166",
		"mode": 2047,
		"meta": "{\"headers\":
		{
		\"Authorisation\":\"Bearer eyJhbGciOiJIxxxxxxxxxxxxxxxxxxxxxxxxxx6biZ7Sbhl0N0u_aI\"}
		}"
		"modifiedOn": 1705574838954,
		"showOnUI": false,
		"tag": "V3 Subscription",
		"url":"https://webhook.site/0b092322-b55b-419e-9c74-eb92f2b38553",
		"version": 3
	}
}

Status Codes

Status CodeResponseComments
Success
200

{

"status": "success",

"subscription": { "active": true,
"appId": "bf9ee64c-xxxxxxxx-xxxx-xxxx577007c4",
"createdOn": 1705574838954,
"id": "8166",
"mode": 2047,
"meta": "{"headers":
{
"Authorisation":"Bearer eyJhbGciOiJIxxxxxxxxxxxxxxxxxxxxxxxxxx6biZ7Sbhl0N0u_aI"}
}"
"modifiedOn": 1705574838954,
"showOnUI": false,
"tag": "V3 Subscription",
"url":"https://webhook.site/0b092322-b55b-419e-9c74-eb92f2b38553",
"version": 3
}
}

Error
400{
"status": "error", "message": "Invalid URL Passed" }
The URL is not valid
401{
"status": "error", "message": "Authentication Failed" }
When authentication fails
429{
"status": "error", "message": "Too Many Requests" }
When the rate limit is exceeded
500{
"status": "error", "message": "Unable To Create Subscription" }
When error occurred while creating the subscription

Modes

  • TEMPLATE: The template events get forwarded to subscriptions if TEMPLATE mode is subscribed.
  • ACCOUNT: The account events get forwarded to subscriptions if ACCOUNT mode is subscribed.
  • PAYMENTS: Incoming Whatsapp pay events get forwarded to subscriptions if PAYMENTS mode is subscribed. [Only for v3].
  • FLOWS_MESSAGE: Incoming flow messages get forwarded to subscriptions if FLOWS_MESSAGE mode is subscribed. [Only for v3].
  • MESSAGE: All incoming messages (not events) except flow messages get forwarded to subscriptions if MESSAGE mode is subscribed.
  • OTHERS: All incoming new events whose exclusive mode is not present (eg read, delivered, sent, payments) get forwarded to subscriptions if OTHERS mode is subscribed [Only for v3].
  • ALL: All incoming messages (not events) get forwarded to subscriptions if ALL mode is subscribed [Only for v3].
  • BILLING: Billing events get forwarded to subscriptions if billing mode is subscribed.
  • FAILED: The failed events get forwarded to subscriptions if failed mode is subscribed.
  • SENT: Sent events get forwarded to subscriptions if sent mode is subscribed.
  • DELIVERED: Delivered events get forwarded to subscriptions if delivered mode is subscribed.
  • READ: Read events get forwarded to subscriptions if read mode is subscribed.
  • ENQUEUED Enqueued events get forwarded to subscriptions if enqueued mode is subscribed.
  • COEXISTENCE Messages sent from mobile app as an event (smb_message_echoes events)
Path Params
string
required
Form Data

Create a new subscription for an app in partner portal

string
required
string
required
string
required
integer
required
boolean
Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json