Call it
curl https://api.peume.com/v1/call/send-whatsapp-conversion-event \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"accountId": "your accountId",
"eventName": "LeadSubmitted",
"eventId": "your eventId"
}
}'const res = await fetch("https://api.peume.com/v1/call/send-whatsapp-conversion-event", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"accountId": "your accountId",
"eventName": "LeadSubmitted",
"eventId": "your eventId"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/send-whatsapp-conversion-event",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"accountId": "your accountId",
"eventName": "LeadSubmitted",
"eventId": "your eventId"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: send-whatsapp-conversion-event.
Parameters
accountIdRequiredstringWhatsApp SocialAccount ID.
eventNameRequiredstringEvent names accepted by Meta's CAPI for Business Messaging. 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`) when a lead comes in and `QualifiedLead` once your team qualifies it. `OrderCreated`, `OrderCanceled` and `OrderReturned` track an order placed in the chat; send `value` and `
LeadSubmitted · QualifiedLead · Purchase · AddToCart · InitiateCheckout · ViewContent · OrderCreated · OrderCanceled · OrderReturned
eventTimenumberUnix 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.
eventIdRequiredstringStable dedup key. Reuse to suppress duplicate events (Meta dedupes against pixel events with the same id).
conversationIdstringConversation `_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), unless `pageId` is sent.
phoneE164stringContact 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. When `pageId` is sent and no such conversation exists, the event is sent without a click id.
pageIdstringNumeric id of the Facebook Page linked to the WABA. Needed when the conversation has no `ctwa_clid`, and sent to Meta only then. Meta matches on the hashed phone or `email` (one is required, 422 otherwise) and may still not attribute the event. does not check that the Page is the one linked to the WABA.
valuenumberConversion value (e.g. order total).
currencystringISO 4217 currency code (e.g. `USD`).
contentIdsarrayOptional product / content identifiers.
emailstringUser email. Normalized + SHA-256 hashed before sending to Meta.
externalIdstringStable customer identifier. Lowercased + SHA-256 hashed before sending to Meta.
testCodestringMeta `test_event_code` passthrough, sent at the request root (a root-level `test_event_code` is accepted as an alias). The event shows in Events Manager's Test Events tab for the dataset whose current test code matches. Meta still processes it like any other event, so remove it in production.
