Send WhatsApp conversion event
Forward a WhatsApp Business Messaging conversion event (`LeadSubmitted`, `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`) to Meta's Conversions API with `action_source = business_messaging` and `messaging_channel = whatsapp`. The endpoint looks up the originating CTWA click ID (`ctwa_clid`) captured on the first inbound message of the conversation and replays it on every event so Meta can attribute the conversion back to the Click-to-WhatsApp ad that drove the chat. Configuration prerequisites on the WhatsApp account metadata: - `metaCapiDatasetId`: the Meta Pixel/Dataset ID linked to the WABA. - `connectedFacebookPageId`: the Facebook Page paired with the WhatsApp Business number. Identify the conversation by either `conversationId` (preferred) or `phoneE164` (digits only, no `+`). At least one is required. If the conversation has no captured `ctwa_clid`, the request returns 422 because there is nothing to attribute. Token and dataset coupling: the WhatsApp account's accessToken must have access to the configured `metaCapiDatasetId`. By default a WABA's system-user token is scoped to the WABA's own Business Manager and cannot post to a pixel owned by a different Business; Meta returns code 100 in that case. Either share the dataset with the WhatsApp app's Business in BM, or use a dataset already in the same Business as the WABA.
API key authentication - use your Zernio API key as a Bearer token
In: header
WhatsApp SocialAccount ID.
1 <= lengthLive-verified allowlist of event names accepted by Meta's
CAPI for Business Messaging (Graph API v25.0). Other
standard pixel events including Lead,
CompleteRegistration, Subscribe, Schedule, Contact,
StartTrial, AddPaymentInfo, Search, and
SubmitApplication are rejected with subcode 2804066
("Messaging Event Invalid Event Type") on
action_source = business_messaging events. Custom event
names are also rejected.
Use LeadSubmitted (NOT Lead) for lead-style conversions.
"LeadSubmitted" | "Purchase" | "AddToCart" | "InitiateCheckout" | "ViewContent"Unix seconds. Defaults to the time of the request when omitted. Meta's attribution window is 7 days from click; events older than that lose attribution.
Stable dedup key. Reuse to suppress duplicate events (Meta dedupes against pixel events with the same id).
1 <= lengthZernio Conversation _id (preferred lookup). The
conversation must have a captured ctwa_clid in metadata
(set automatically by the WhatsApp webhook on the first
inbound message after a CTWA ad click).
1 <= lengthContact phone number, digits only with no '+'. When used
in lieu of conversationId, the handler resolves to the
most recent CTWA-attributed conversation for this phone
on the supplied account.
1 <= lengthConversion value (e.g. order total).
ISO 4217 currency code (e.g. USD).
3 <= length <= 3Optional product / content identifiers.
User email. Normalized + SHA-256 hashed before sending to Meta.
emailStable customer identifier. Lowercased + SHA-256 hashed before sending to Meta.
Meta test_event_code passthrough. Routes the event to
the Test Events tab in Events Manager instead of the
production dataset, useful for development.
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.whatsapp.sendWhatsAppConversion({ body: { accountId: 'account_abc123', eventName: 'LeadSubmitted', eventId: 'event_abc123', },});console.log(data);{
"platform": "metaads",
"eventsReceived": 0,
"eventsFailed": 0,
"failures": [
{
"eventIndex": 0,
"eventId": "string",
"message": "string",
"code": "string"
}
],
"traceId": "string"
}{
"error": "Unauthorized"
}Send conversion events to an ad platform POST
Relay one or more conversion events to the target ad platform's native Conversions API. Supported platforms: Meta (metaads) via Graph API, Google Ads (googleads) via Data Manager API `ingestEvents`. Platform is inferred from the provided `accountId`. `destinationId` semantics differ per platform: - Meta: pixel (dataset) ID, e.g. "123456789012345" - Google: conversion action resource name, e.g. "customers/1234567890/conversionActions/987654321" Callers can list valid destinations via `GET /v1/accounts/{accountId}/conversion-destinations`. All PII (email, phone, names, external IDs) is hashed with SHA-256 server-side per each platform's normalization spec (including Google's Gmail-specific dot/plus-suffix stripping). Send plaintext. Requires the Ads add-on. Batching: Meta caps at 1000 events per request and rejects the entire batch if any event is malformed. Google caps at 2000. Both are handled automatically by chunking. Dedup: pass a stable `eventId` on every event. Meta uses it to dedupe against pixel events; Google maps it to transactionId.
List campaigns GET
Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID. Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign. Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected).