Skip to content

How to trigger a WhatsApp event from a custom webhook

A Custom webhook event sends an approved WhatsApp template when your website or app POSTs to a private AvenPing link. Open Automation → Events, click Create Event, choose Custom webhook, map Phone number and Name from a sample payload, then Activate event.

Prerequisites

Step-by-step

  1. Open Create Event and choose Custom webhook
    Sign in at app.avenping.com. Open Automation → Events. Click Create Event. On Trigger, fill Event name. Under When should this message send?, click Custom webhook. Description: Your website or app tells us when to send.

  2. Optional wait and security
    Set Wait after we hear from your system (use 0 to send immediately) and Time unit. Tick Require an HMAC signature (recommended). Helper text: you get a private link after you start this event. Click Next. Toast: Webhook draft created. Status on the table is Draft until you finish.

  3. Copy credentials and paste a sample payload
    On Webhook setup, heading Connect this event to your website or app. After the draft exists, copy Private link, Access token, and Signature secret (if HMAC is on). Paste Sample payload from your server — example JSON with phone, name, and any extra fields (order id). AvenPing auto-maps phone and name when it can.

  4. Map who should receive the message
    Under Who should receive the message?, set Phone number and Name to payload field paths (for example phone and name). Other fields stay unmapped here; you choose them later in Variables. Tick Require a security signature if you want HMAC on the request. Click Next.

  5. Template, variables, then Activate event
    Pick an approved template. On Variables, map placeholders to contact fields or Use payload field for remaining JSON paths. On Review, Who is The contact identified by the webhook payload and mapped contact fields. How often is Each time your system calls us. Click Activate event. Toast: Event activated.

  6. POST JSON to the private link
    Send POST to Private link. The Access token is already in the URL, or send it as Authorization: Bearer. Body can be one contact object, a JSON array, { "contacts": [ ... ] }, or { "items": [ ... ] } — max 100 per call. Default field names are phone, name, and metaUserId (aliases include phoneNumber, mobile, full_name, bsuid). Each contact needs a mapped phone or Meta user id. If HMAC is on, send header X-AvenPing-Signature-256 with sha256= plus the hex HMAC-SHA256 of the raw body using Signature secret. A Disabled event returns 409. Too many requests return 429.

TIP

Copy Private link, Access token, and Signature secret immediately. Use Create a new link later if you must rotate the URL.

WARNING

Unfinished webhook events stay Draft. Resume with Continue editing in the row menu. They do not send until Activate event.

FAQ

Is this the same as Settings → Webhook Settings?

No. Settings → Webhook Settings is outbound (AvenPing calls your URL). A Custom webhook event is inbound (your system calls AvenPing). See How to configure AvenPing webhooks in Settings.

What if I close the wizard before Activate event?

The event is saved as Draft. Open the row menu and click Continue editing. The modal title is Continue Event Draft.

What JSON should I POST?

A single object such as { "phone": "9198...", "name": "Ada" } is enough. You can also send an array or wrap rows in contacts or items. Unmapped extra fields can still fill template variables via Use payload field.

Can I filter the audience?

No. Webhook events send to the contact identified by the mapped phone (and name) in the payload. Date and delay events use Audience instead.