send_whatsapp
REAL ACTION: sends a WhatsApp message to a lead, a contact or a bare number, and records it on that record's timeline. Recipient: exactly one of lead_id, contact_id or to_number (E.164, no record needed - it is matched like find_by_phone, incl. contact mobiles; with no unique match the entry is kept as 'unassigned'). Consent, legal basis and purpose are checked for leads AND contacts. Beeper: the chat is the one linked to the record, otherwise the WhatsApp chat of the number - found or started on the bridge (startWhatsappChat; starting sends nothing) and only used if a participant really has that number. dry_run:true resolves everything (recipient, consent, route, chat) and sends NOTHING. Which way it goes out is the tenant's setting (tenants.whatsapp_provider): 'beeper' sends through the local bridge from a personal account, 'twilio' sends through the connected AI-Call-Bot from one of its numbers, and 'twilio_direct' sends WhatsApp Business straight from the tenant's OWN Twilio account and approved sender. The timeline entry is the same either way. Required: body and one recipient. Optional: to_number next to a record = send to that number instead, chat_id (beeper, defaults to the linked WhatsApp channel), phone_number_id (twilio, the bot number to send FROM — required when the bot owns more than one). If sending fails, it is NOT retried, and the timeline says the message MAY have gone out anyway — check the chat before trying again rather than sending twice. ATTACHMENT (twilio_direct only): document_id (a stored CallPilotAI document, sent via a short-lived signed link) or media_url (a public https file, e.g. a PDF). body becomes the caption and may then be empty. Never pass file contents.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "send_whatsapp"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Message text. | |
| chat_id | No | Beeper path: the Beeper chatID. Defaults to the WhatsApp channel linked to the lead. | |
| dry_run | No | Only resolve recipient, consent, route and chat - send nothing, create nothing. | |
| lead_id | No | Recipient: a lead. Exactly one of lead_id, contact_id, to_number. | |
| purpose | No | The processing purpose of this message (e.g. akquise, terminabstimmung). A consent is always for ONE purpose; without one, only the record's state and any withdrawal are checked. Refused outright if the tenant has switched on legal_basis_enforced. | |
| media_url | No | twilio_direct: attach the file at this public https address (PDF, image). Use exactly one of document_id or media_url. | |
| to_number | No | Recipient without a record (E.164, e.g. +491701234567), matched via find_by_phone. Next to lead_id/contact_id: send to this number instead of the stored one. | |
| contact_id | No | Recipient: a contact (person). Number: mobile, then phone. | |
| content_sid | No | twilio_direct path: a Meta-approved template (Twilio ContentSid). Required OUTSIDE the 24-hour window, where free text is refused — send this instead of body. | |
| document_id | No | twilio_direct: attach this stored document (documents.id). Use exactly one of document_id or media_url. | |
| human_approved | No | EU AI Act Art. 50: true ONLY if a human has read and approved this exact text before sending. Otherwise the line 'Diese Nachricht wurde mit KI erstellt. / This message was created with AI.' is appended to body. | |
| phone_number_id | No | Twilio path: which of the bot's numbers to send from. | |
| content_variables | No | twilio_direct path: the template's variables, e.g. {"1": "Frau Muster"}. Only with content_sid. |