ingest_whatsapp_lead
Take an incoming WhatsApp message and turn it into (or attach it to) a lead — the intake path for Click-to-WhatsApp ads. Pass the raw webhook payload (or just the referral object) as payload and the sender's number; the ad reference is read from it. IMPORTANT: the referral only arrives with the FIRST message of a conversation, so it is recorded once and never overwritten by a later message that has none. Writing the same number twice does not create a second lead — the message joins the existing one. A message without an ad reference is still taken in, explicitly marked 'Herkunft unbekannt': someone wrote, that is the event; discarding it loses a real enquiry, and attributing it to whichever ad happens to run would be an invented number in the ad report.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"from": "<from>"
},
"name": "ingest_whatsapp_lead"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | The sender's phone number, any format. | |
| name | No | Profile name, if WhatsApp supplied one. | |
| text | No | The message text. | |
| payload | No | The raw webhook bundle, a single message, or the referral object. The ad reference is read from whichever it is. | |
| message_id | No | WhatsApp message id (wamid.…) — the guard against double delivery. | |
| campaign_id | No | Campaign to file the lead under. | |
| received_at | No | ISO timestamp of the message. |