Use the Automation API when another system needs to trigger a WhatsApp workflow in WApp Chat.
Common sources include CRMs, property tools, appointment systems, Google Sheets, n8n, Shopify, lead forms, and business dashboards.
Endpoint #
POST https://wapp.chat/api/whatsapp/automation/events
Required headers:
Content-Type: application/json
x-wappchat-key: wchat_live_...
You can also send the key as:
Authorization: Bearer wchat_live_...
Example Request #
{
"event": "lead.created",
"source": "property-management-app",
"idempotency_key": "lead.created:lead_123",
"contact": {
"name": "Alex Guest",
"phone": "919999999999"
},
"payload": {
"property": {
"name": "Sea View Villa"
},
"check_in": "2026-06-01",
"check_out": "2026-06-05",
"cleaner": {
"phone": "918888888888"
}
}
}
Response #
{
"ok": true,
"event_id": "evt_...",
"status": "accepted",
"duplicate": false,
"matched_workflows": 1
}
If the event is accepted, WApp Chat records it and runs any matching automation rule for your account.
Event Matching #
Automation rules are configured in https://wapp.chat/whatsapp/integrations.
The event name in your API request must match the rule event:
lead.created
order.shipped
payment.received
appointment.created
booking.created
If you see no_match, the event was accepted but no workflow matched that event name. Create or update a workflow in https://wapp.chat/whatsapp/integrations.
Idempotency #
idempotency_key prevents duplicate sends when the external system retries the same event.
Use a stable key from the source system:
lead.created:LEAD_ID
order.shipped:ORDER_ID
payment.received:PAYMENT_ID
appointment.created:APPOINTMENT_ID
booking.created:BOOKING_ID
If the same tenant sends the same key again, WApp Chat returns the existing event instead of processing messages again.
Template Actions #
External automation often runs outside the 24-hour WhatsApp service window, so production workflows should use approved Meta templates.
In https://wapp.chat/whatsapp/integrations:
- Create or select a workflow.
- Set the action type to Template.
- Pick an approved synced template.
- Map body parameters in the same order as
{{1}},{{2}}, etc.
Read Templates and Consent before sending production messages.
Event Details #
You can fetch an event and its workflow/delivery status:
GET https://wapp.chat/api/whatsapp/automation/events?id=<event_id>
x-wappchat-key: wchat_live_...
Use this for debugging event status, matched workflows, delivery rows, retry counts, and failure reasons.