Analytics & automations
Pull messaging metrics into your own reports, and trigger dashboard automations from events in your systems.
EndpointsKey permission
- GET
/v1/analytics/overviewTotals, rates, daily series and estimated costanalytics:read - GET
/v1/analytics/agentsPer-agent inbox activityanalytics:read - GET
/v1/analytics/errorsTop delivery errorsanalytics:read - POST
/v1/automations/eventsTrigger automations → 202 { matched_automations }automations:write - GET
/v1/automationsList automationsautomations:read - GET
/v1/automations/{id}/runsRun historyautomations:read
Analytics
Query parameters
fromdateoptionalYYYY-MM-DD. Defaults to 14 days ago.todateoptionalYYYY-MM-DD. Defaults to today. Ranges can span up to 366 days.phone_number_iduuidoptionalOnly this number.
GET /v1/analytics/overview
JSON
{
"range": { "from": "2026-11-01", "to": "2026-11-14" },
"totals": { "sent": 61240, "delivered": 59312, "read": 41870, "failed": 1928, "inbound": 8403, "conversations": 5120 },
"rates": { "delivery": 96.9, "read": 68.4, "failure": 3.1 },
"series": [
{ "day": "2026-11-01", "sent": 4210, "delivered": 4102, "read": 2980, "failed": 108, "inbound": 611 }
],
"costs": {
"currency": "INR",
"total": 21480.35,
"by_category": { "marketing": { "count": 22100, "amount": 19224.79 }, "utility": { "count": 18120, "amount": 2255.56 } },
"note": "Estimated from Meta's published rates; Meta bills your WhatsApp account directly."
}
}Rates are percentages. /v1/analytics/errors returns { "data": [{ code, title, detail, count }] } for failed messages in the range.
Automation events
Automations built in the dashboard can start from an API event trigger. Post an event — an order shipped, a payment failed — and every enabled automation with that trigger runs for the contact.
POST /v1/automations/events → 202
JSON
{
"event": "order_shipped",
"phone": "+14155550101",
"data": { "order_id": "48213", "eta": "Saturday" }
}Body parameters
eventstringrequiredYour event name, 1–64 characters.contact_iduuidoptionalThe contact. Or identify them byphone.phonestringoptionalThe contact's phone number, if you don't have the contact id.dataobjectoptionalAnything the automation should be able to use.
Keys with messages:send can post events too. The response says how many automations were triggered.
Something unclear or missing on this page? Tell us at contact@swastik.ai