Skip to main content

Event types

Events

whatsapp.message.received
whatsapp.message.status
raw is what your main webhook receives for the same event (shortened here). It is null, with rawOmitted: true, when including it would make the event larger than 256 KB.

Create a subscription

The response is 201 with subscriptionId (sub_...) and secret. The secret is shown only once: store it. To change the URL or rotate the secret, delete the subscription and create a new one.
  • url: a public https:// address.
  • events: at least one event type the channel supports.
  • label: optional, up to 120 characters, shown in your delivery log.
  • Up to 25 subscriptions per channel.
  • Facebook Page channels do not support event subscriptions yet.

List and delete

  • GET /channels/{ch}/subscriptions lists a channel’s subscriptions, without secrets.
  • DELETE /channels/{ch}/subscriptions/{sub} removes one. Deleting it again is harmless. A delivery already in progress may still arrive once.

Verify the signature

Every delivery carries X-HookMyApp-Signature-256: sha256=<hex>: an HMAC-SHA256 of the raw request body, keyed with the subscription’s secret. It works exactly like your main webhook’s signature.

Delivery and retries

  • Events usually arrive within seconds.
  • Answer with any 2xx within 10 seconds.
  • Any other answer, a redirect or a timeout is retried with growing delays for about 3 hours. After that the event is dropped for that subscription.
  • While one subscription’s endpoint keeps failing, deliveries to other subscriptions can be briefly delayed.
  • An event can arrive more than once, and events can arrive out of order. Drop duplicates by id; order by occurredAt.
  • Every attempt shows in your delivery log with the subscription’s label.
  • Your main webhook destination does not change. It keeps receiving what it receives today, and a failing subscription never affects it.

Sample events

GET /channels/{ch}/events?types=whatsapp.message.received&limit=3 returns recent events in the same shape, one per id, with raw set to null and rawOmitted set to true. It returns up to limit of the most recent events, newest first, and it looks through a bounded number of recent deliveries, so it can return fewer than limit events when the type you asked for is rare. Use it as sample data when you set up an automation, not as a history feed.

For automation platform builders

If you build a trigger for an automation platform on top of HookMyApp:
  • Subscribe (a user turns the trigger on): POST /channels/{ch}/subscriptions with the event type the trigger listens for and your platform’s target URL. Store the returned subscriptionId (and the secret, to verify deliveries).
  • Unsubscribe (the trigger is turned off or deleted): DELETE /channels/{ch}/subscriptions/{subscriptionId}.
  • Sample data (while the user sets up the trigger): GET /channels/{ch}/events?types=<event type>&limit=3.
  • Deduplication: use the event id. The same event always has the same id, including when it is delivered more than once.

Errors