Skip to content

parseWebhookEvents

parseWebhookEvents(body, options?): WebhookEvent[]

Defined in: src/resources/webhook-events.ts:142

Parses a webhook delivery into a flat list of typed events, in delivery order.

Accepts the same inputs as parseWebhook: a parsed object or its JSON as a string, Uint8Array or ArrayBuffer. Fields this SDK does not model, and known fields whose shape does not match, are returned as unknown events (or the unknown member of a typed event) instead of throwing. Only an invalid envelope throws.

statuses under the messages field are message statuses; statuses under calls are call statuses. Signature verification is not part of this function; verify the raw body first.

unknown

The delivery body.

ParseWebhookOptions = {}

Optional size limit override.

WebhookEvent[]

WhatsAppWebhookError when the body is not a valid envelope.

Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.