Sync templates from WhatsApp
Changed onReconcile this project's templates against WhatsApp. Three things happen per connected WhatsApp Business Account: templates that exist on Meta but not in Zavu are imported (or linked to an existing template with the same name), the approval status of the templates Zavu already knows about is refreshed from Meta, and their category is refreshed from Meta.
The category matters because it is what each message is billed under, and Meta reassigns it on its own — commonly UTILITY to MARKETING, on a template that is already approved and whose status therefore never moves. A template whose category changed but whose status did not is still counted in updated. This is the way to repair templates whose category drifted before you started listening for template.status_changed.
This is what to call when a template was created outside Zavu — in Meta Business Manager, or by another tool — or when a template.status_changed webhook was missed and a template is stuck in pending. Status changes normally arrive by webhook; this endpoint is the recovery path and the only path for a template Zavu never created.
Templates that Meta reports as rejected or disabled are not imported; they are counted in skipped. Existing local templates are matched first by Meta template ID, then by name.
By default every sender in the project with a WhatsApp Business Account is synced. Pass senderId to sync only that sender's account. The call is synchronous — it waits for Meta and returns what changed — so it can take a few seconds per account. A failure on one account does not fail the request: it is reported in errors and the remaining accounts are still synced.
Request
- Base URLhttps://api.zavu.dev
- URLhttps://api.zavu.dev/v1/templates/sync
- AuthHTTP bearer
Request body
Example request
{
"senderId": "sender_12345"
}Response
Sync completed. Counts are totals across every account synced.
Changes
- info
endpoint added
- info