WhatsApp Apex and Flow reference

This is the developer surface of the package: the Flow actions you call, the Apex you can call directly, the inbound webhook and the platform event you can subscribe to.

Invocable actions (Flow + Apex)

Four @InvocableMethod actions, all in the WhatsApp category. The text, template and media actions are bulk-safe: every row in one Flow run is sent asynchronously in a single job.

Send WhatsApp Text: WhatsAppSendText

Input (Request) Type Required Notes
Contact Id Id — Contact to message and link. Phone taken from Mobile/Phone if no number supplied.
To Phone Number String — Overrides the Contact phone. Country code required, e.g. +447700900123.
Message Body String yes The text to send.
Configuration Name String — DeveloperName of the sending number. Blank = default.

Send WhatsApp Template: WhatsAppSendTemplate

Same Contact/phone/config inputs, plus:

Input Type Required Notes
Template Name String yes Approved template name. Use Get WhatsApp Templates to list.
Language Code String — e.g. en_US. Defaults to en_US.
Body Parameters List<String> — Ordered values for {{1}}, {{2}}, ….
Body Parameter Names List<String> — Variable names for named-variable templates, e.g. first_name (braces optional), same order/size as Body Parameters. Blank for positional.
Button URL Parameter String — Dynamic suffix for a URL button (button index 0), if the template has one.

The action stores the rendered body plus the URL button label and resolved URL on the message record, so the WhatsApp Messager conversation shows the actual text that was sent rather than the template name.

Send WhatsApp Media: WhatsAppSendMedia

Same Contact/phone/config inputs, plus:

Input Type Required Notes
Media Type String — Image, Document, Video or Audio. Defaults to Image.
Media URL String yes Publicly reachable HTTPS URL of the media.
Caption String — Optional caption (ignored for audio).

Get WhatsApp Templates: WhatsAppTemplateService

Input Type Notes
Configuration Name String Which configuration (WABA) to read templates from. Blank = default.

Returns a Template Names collection (List<String>). Bind it to a dynamic choice in a Screen Flow so admins pick a template instead of typing it. This makes a synchronous callout, so use it in Screen Flows, not record-triggered flows, which can't call out synchronously.

Calling from Apex

WhatsAppSendText.Request r = new WhatsAppSendText.Request();
r.contactId = someContactId;
r.messageBody = 'Hi there';
WhatsAppSendText.send(new List<WhatsAppSendText.Request>{ r });

Global classes (package surface)

Class Access Role
WhatsAppSendText / WhatsAppSendTemplate / WhatsAppSendMedia global The three send invocable actions.
WhatsAppTemplateService global Get WhatsApp Templates action + fetchTemplates() used by the LWC.
WhatsAppWebhookHandler global @RestResource The inbound webhook endpoint.

Inbound webhook: WhatsAppWebhookHandler

@RestResource(urlMapping='/whatsapp/webhook'), public URL /services/apexrest/whatsapp/webhook.

Method Behaviour
GET Meta verification handshake. Echoes hub.challenge when hub.mode=subscribe and hub.verify_token matches the default configuration's Webhook_Verify_Token__c; otherwise 403.
POST Receives inbound messages and delivery statuses. Processing failures are logged to Log_Entry__c.

The webhook must be reachable by Meta. Host it on a Site/community that allows guest access to the REST resource. See Installation and post-install setup.

Automations and platform event

There are no packaged Flows. The package ships the actions; drop them into Flows you build (Screen, Record-Triggered, Scheduled).

Component Type Role
WhatsApp_Message_Event__e Platform event Published when a Whatsapp_Message__c record is inserted or updated. Carries the changed Contact_Id__c to subscribers, such as the WhatsApp Messager component.

Limits