Create subscription

Creates a new messaging subscription on a WhatsApp app so the supplied webhook URL starts receiving callbacks for the requested modes.

Request parameters

Path parameters

KeyDescriptionValuesData TypeRequired/Optional
appIdIdentifier of the WhatsApp app the call acts on.6f414190-d45c-4671-bca1-fb6c3018cb13StringRequired

Body

KeyDescriptionValuesData TypeRequired/Optional
modesComma-separated event types to deliver. Required, and must not be blank. WAME adds STANDBY_STATUSES, STANDBY_MESSAGE_ECHOES, STANDBY_MESSAGES, and MESSAGING_HANDOVERS for Multi-App / handover webhooks; other values are forwarded to WASS as-is.MESSAGE,DISPATCHED,DELIVERED,READ,SENT,DELETED,OTHERS,STANDBY_STATUSES,STANDBY_MESSAGE_ECHOES,STANDBY_MESSAGES,MESSAGING_HANDOVERS—Required
tagLabel identifying this subscription among several on the same app. Required, and must not be blank: a whitespace-only tag was stored as the literal string "null".primary-webhook—Required
showOnUIWhether the subscription is listed in the Partner Portal UI.true—Optional
versionWebhook payload version to deliver. Required. Boxed deliberately: as a primitive an omitted version bound to 0 and was persisted silently.3—Required
urlHTTPS endpoint the events are delivered to.https://partner.example/webhook/whatsapp—Required
metaJSON object of your own metadata, echoed back on delivery.{"env":"qa"}—Optional

Sample cURL — Create subscription.

curl --request POST \
  --url 'https://partner.gupshup.io/partner/bizgate/app/6f414190-d45c-4671-bca1-fb6c3018cb13/messaging/subscription' \
  --header 'Authorization: Bearer <UT>' \
  --header 'Accept: application/json' \
  --data-urlencode 'modes=MESSAGE,DISPATCHED,DELIVERED,READ,SENT,DELETED,OTHERS,STANDBY_STATUSES,STANDBY_MESSAGE_ECHOES,STANDBY_MESSAGES,MESSAGING_HANDOVERS' \
  --data-urlencode 'tag=primary-webhook' \
  --data-urlencode 'showOnUI=true' \
  --data-urlencode 'version=3' \
  --data-urlencode 'url=https://partner.example/webhook/whatsapp' \
  --data-urlencode 'meta={"env":"qa"}'

Sample success response (200)

{
  "status": "success",
  "data": {
    "subscription": {
      "id": "sub-7f3a2b1c",
      "tag": "primary-webhook",
      "appId": "6f414190-d45c-4671-bca1-fb6c3018cb13",
      "url": "https://partner.example/webhook/whatsapp",
      "active": true,
      "version": 3,
      "mode": 0,
      "modes": [
        "MESSAGE",
        "DELIVERED",
        "READ"
      ],
      "showOnUI": true,
      "createdOn": 1779091144256,
      "modifiedOn": 1779091144256
    }
  }
}
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Identifier of the WhatsApp app the call acts on.

Form Data

Subscribe a webhook to an app's events

string
required

Comma-separated event types to deliver. Required, and must not be blank. WAME adds STANDBY_STATUSES, STANDBY_MESSAGE_ECHOES, STANDBY_MESSAGES, and MESSAGING_HANDOVERS for Multi-App / handover webhooks; other values are forwarded to WASS as-is.

string
required

Label identifying this subscription among several on the same app. Required, and must not be blank: a whitespace-only tag was stored as the literal string "null".

boolean

Whether the subscription is listed in the Partner Portal UI.

int32
required

Webhook payload version to deliver. Required. Boxed deliberately: as a primitive an omitted version bound to 0 and was persisted silently.

string
required

HTTPS endpoint the events are delivered to.

string

JSON object of your own metadata, echoed back on delivery.

Responses

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