Skip to main content
Any message sent outside a 24-hour customer service window — marketing blasts, order updates — must use a pre-approved template. Use this endpoint to submit new templates for Meta review.

Endpoint

POST https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/templates

Request body

name
string
required
Unique lowercase, underscore-separated name, e.g. order_shipped.
category
string
required
One of marketing, utility, or authentication.
language
string
required
BCP-47 language code, e.g. en, hi.
body
string
required
Template body text. Use {{1}}, {{2}} etc. for variables. Not required for authentication category.
buttons
array
Optional array of buttons.

Response

template_id
string
Internal identifier for this template (a UUID) — use it to check status or as template_id in Send Templates.
status
string
pending_review immediately after submission.
cURL
curl https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/templates \
  -H "Authorization: Bearer tvk_live_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "order_shipped",
    "category": "utility",
    "language": "en",
    "body": "Hi {{1}}, your order {{2}} has shipped and will arrive by {{3}}."
  }'
Response
{
  "template_id": "9c858901-8a57-4791-81fe-4c455b099bc9",
  "status": "pending_review"
}

Checking status

GET https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/templates/{template_id}
Response
{
  "id": "9c858901-8a57-4791-81fe-4c455b099bc9",
  "name": "order_shipped",
  "category": "utility",
  "language": "en",
  "status": "approved",
  "template_type": "standard",
  "rejection_reason": null,
  "created_at": "2026-07-14T10:02:00Z"
}
status is one of pending, approved, rejected, paused, or deleted. If rejected, rejection_reason has Meta’s explanation. You can also list every template on the account:
GET https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/templates
returns { "templates": [...] } with the same fields, newest first.
Register a template.status webhook to be notified the moment Meta reviews it, rather than polling — see Webhooks. Review typically takes minutes to a few hours, occasionally up to 24 hours.