A platform, not a black box.
WatAgent exposes stable WordPress actions, filters, a REST API, and WP-CLI so you can hook in without forking. It's GPL — read it, extend it, ship it.
// React to every inbound WhatsApp message
add_action( 'watagent_message_ingested', function ( $message, $contact ) {
if ( str_contains( $message->body, 'refund' ) ) {
wp_mail( 'ops@store.com', 'Refund request', $contact->phone );
}
}, 10, 2 );
// Inject a dynamic template variable
add_filter( 'watagent_template_variables', function ( $vars, $order ) {
$vars['loyalty_points'] = get_points( $order );
return $vars;
}, 10, 2 );
Hook in however you like.
Actions
Fire your code on message, contact, campaign, OTP, and flow-node events.
Filters
Reshape outbound payloads, template variables, AI prompts, and vector queries.
REST API
The full watagent/v1 namespace with nonce / Bearer auth.
WP-CLI
Script bulk operations and CI tasks with wp watagent.
Actions
watagent_message_ingested
watagent_message_sent
watagent_contact_created
watagent_campaign_dispatched
watagent_otp_verified
watagent_flow_node_executed
Filters
watagent_outbound_payload
watagent_template_variables
watagent_ai_system_prompt
watagent_vector_query
watagent_capabilities_map
A complete REST surface.
Conversations, contacts, campaigns, flows, templates, analytics, and webhooks — all available over REST with nonce / Bearer auth, pagination, filtering, and rate limiting.
- Nonce auth for in-WP requests, Bearer tokens for external clients.
- Cursor pagination, rich filtering, and per-token rate limits.
- Outbound webhooks with HMAC-signed payloads and retry/backoff.
# Send a templated WhatsApp message
curl -X POST https://yoursite.com/wp-json/watagent/v1/messages \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155550192",
"template": "order_shipped",
"variables": {
"name": "Aisha",
"tracking_url": "dhl.com/4821"
}
}'
# → 202 Accepted
{ "id": "msg_9f2c", "status": "queued" }
Automate from the command line.
Run bulk operations, reindex the AI knowledge base, dispatch campaigns, and wire WatAgent into CI — all without touching the admin UI.
- Scriptable for deploys, cron, and migrations.
- Reindex, import, export, and health-check commands included.
$ wp watagent kb:reindex --post-type=product
Indexing 1,284 products… done (12,902 chunks)
$ wp watagent contacts:import customers.csv
Imported 4,820 contacts, 12 skipped (no opt-in)
$ wp watagent campaign:send 42 --throttle=60
Dispatching "Spring Sale" → 4,820 recipients…
$ wp watagent health
DB ✓ Cache ✓ Webhook ✓ Rate-limit ✓
Modern stack. Honest engineering.
Extend it, don't replace it.
Read the full API reference, hook catalog, and WP-CLI guide in the docs.