Register New Webhook

Registers a webhook URL that receives the chosen events for one or more of your WhatsApp numbers.

Before you call

  • The API key's user needs permission to add webhooks.
  • name, url, method, webhookEvents and wabaNumbers are required.
  • All wabaNumbers must be channels of the same type.

How it works

  • validWebhooks lists the number and event pairs that were registered.
  • Each event on a number allows 5 webhook URLs by default; numbers already at that limit are skipped and listed in invalidWebhooks.
  • invalidWabaNumbers lists numbers not found in your organization; fails if none are found.
  • Get the new webhook's webhookId from Get Webhooks.

Instagram referrals

  • REFERRAL_RECEIVED fires on Instagram channels when a customer reaches you from a Click-to-Direct ad, an Instagram Shop product or an ig.me link with a ref.
  • Ad and product referrals arrive with the customer's message, which also gets a referral object in its MESSAGE_RECEIVED. An ig.me link opened in an existing conversation has no message, so only REFERRAL_RECEIVED is sent.
  • Payload: from, to, handle, channelHandle, channelType (INSTAGRAM), integrationType, dtCustomerId, contact.name, receivedAt, dtMessageId and referral. dtMessageId is the DoubleTick message the referral belongs to: the customer's message for an ad or product, the conversation's system message for an ig.me link. It stays the same if the event is sent again, so you can use it to drop duplicates. Ad and product referrals also carry messageId, the Instagram message ID.
  • referral uses the keys of WhatsApp click-to-WhatsApp referrals: source_type (ad, product or link), source_id (the ad or product ID), headline, media_type, image_url, post_id, product_id, ref and source. Keys Instagram does not send are left out. A ref outside Instagram's format (letters, digits, -, _ and =, up to 2,083 characters) is left out, so an ig.me link with such a ref sends no event.
  • Example referral for an ad: {"source_type": "ad", "source_id": "120210000000001", "headline": "Summer sale", "media_type": "image", "image_url": "https://...", "ref": "summer_sale"}
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
uri
required

URL of the webhook

string
enum
required

HTTP method used for the webhook

Allowed:
headers
object

Custom headers to be sent with the webhook

body
object

Payload to be sent with the webhook

query
object

Query parameters to be included in the webhook URL

string
enum

Format of the body content

Allowed:
authorization
object

Authorization details for the webhook

webhookEvents
array of strings
required

Events that trigger the webhook

webhookEvents*
boolean

Retry the webhook call on timeout

string
required

Name of the webhook

wabaNumbers
array of strings
required

List of WABA numbers associated with the webhook

wabaNumbers*
Responses

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