WhatsApp Business message-template CRUD β draft locally, submit to Meta for approval, upload header media, and pull-to-refresh sync against Meta's catalogue.
Create a template (DRAFT)
Persists a new WhatsApp template locally as DRAFT β no Meta-side call. Call POST /whatsapp-templates/{id}/submit when you are ready to push it to Meta for approval. This split lets agents iterate on a draft locally before burning a Meta submission slot.
Name normalisation: the supplied name is lower-cased + trimmed to Meta's [a-z0-9_] rule before persistence.
Header media: when the components carry a HEADER with format IMAGE / VIDEO / DOCUMENT, upload the sample via POST /whatsapp-templates/media first and pass the returned handle as header_media_handle.
Create a template (DRAFT) βΊ Request Body
channel_idWhatsApp channel that owns this template. Must be an active WHATSAPP_OFFICIAL inbox.
nameWill be lower-cased + trimmed to Meta's [a-z0-9_] rule before persistence.
languagecategoryAUTHENTICATION templates are not creatable via the public API in v1.
header_media_handlemessage_send_ttl_secondsCreate a template (DRAFT) βΊ Responses
Template created (DRAFT).
successGet template detail
Returns the full template envelope for the mobile + dashboard detail view. components is the raw jsonb so the renderer can preview the template exactly as Meta sees it.
path Parameters
template_idWhatsApp template UUID owned by the caller's organization. Cross-tenant or soft-deleted IDs return 404 whatsapp template not found.
Get template detail βΊ Responses
Template detail.
successDelete a template
Soft-deletes the local row. When the template has been pushed to Meta (waba_template_id is set), the Meta-side delete is issued best-effort β failures don't block the local delete because the caller's intent is make this row go away regardless.
path Parameters
template_idWhatsApp template UUID owned by the caller's organization. Cross-tenant or soft-deleted IDs return 404 whatsapp template not found.
Delete a template βΊ Responses
Template deleted.
successmessagedataUpdate a template
Partial update β only DRAFT and REJECTED rows accept this. APPROVED edits go through a different (currently dashboard-only) flow.
name / language / category are intentionally NOT editable; Meta keys templates on (waba_id, name, language), so changing any of those is a delete-and-recreate flow.
path Parameters
template_idWhatsApp template UUID owned by the caller's organization. Cross-tenant or soft-deleted IDs return 404 whatsapp template not found.
Update a template βΊ Request Body
header_media_handlemessage_send_ttl_secondsUpdate a template βΊ Responses
Template updated.
successSync templates from Meta
Pulls every template from Meta for the given channel and reconciles the local table. Use cases: the dashboard's Sync button + mobile pull-to-refresh on the templates list.
Returns row-level counters (created / updated / skipped) so the mobile UI can render a single Synced N templates toast.
Sync templates from Meta βΊ Request Body
channel_idWhatsApp channel whose Meta catalogue to sync.
Sync templates from Meta βΊ Responses
Sync completed.
successUpload header media (returns Meta handle)
Multipart upload that returns Meta's media handle for use in the next create / update payload's header_media_handle. Handles are scoped to the channel's phone_number_id and remain valid until the template that consumes them is approved by Meta.
Upload header media (returns Meta handle) βΊ Request Body
channel_idWhatsApp channel that owns the future template.
fileUpload header media (returns Meta handle) βΊ Responses
Meta media handle.
successSubmit a draft template to Meta
Pushes a DRAFT (or REJECTED, after edits) template to Meta. On success the local row flips to PENDING with waba_template_id + submitted_at populated. On failure the upstream Meta error is surfaced verbatim so the agent can fix components and retry.
path Parameters
template_idWhatsApp template UUID owned by the caller's organization. Cross-tenant or soft-deleted IDs return 404 whatsapp template not found.
Submit a draft template to Meta βΊ Responses
Template submitted, now PENDING.
success