> ## Documentation Index
> Fetch the complete documentation index at: https://developers.tanvik.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Templates

> Submit WhatsApp message templates for Meta approval

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

```text theme={null}
POST https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/templates
```

### Request body

<ParamField body="name" type="string" required>
  Unique lowercase, underscore-separated name, e.g. `order_shipped`.
</ParamField>

<ParamField body="category" type="string" required>
  One of `marketing`, `utility`, or `authentication`.
</ParamField>

<ParamField body="language" type="string" required>
  BCP-47 language code, e.g. `en`, `hi`.
</ParamField>

<ParamField body="body" type="string" required>
  Template body text. Use `{{1}}`, `{{2}}` etc. for variables. Not required for `authentication` category.
</ParamField>

<ParamField body="buttons" type="array">
  Optional array of buttons.
</ParamField>

### Response

<ResponseField name="template_id" type="string">
  Internal identifier for this template (a UUID) — use it to check status or as `template_id` in [Send Templates](/whatsapp/send-templates).
</ResponseField>

<ResponseField name="status" type="string">
  `pending_review` immediately after submission.
</ResponseField>

```bash cURL theme={null}
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}}."
  }'
```

```json Response theme={null}
{
  "template_id": "9c858901-8a57-4791-81fe-4c455b099bc9",
  "status": "pending_review"
}
```

## Checking status

```text theme={null}
GET https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/templates/{template_id}
```

```json Response theme={null}
{
  "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:

```text theme={null}
GET https://xwialxkobwygraiddimj.supabase.co/functions/v1/public-api/v1/templates
```

returns `{ "templates": [...] }` with the same fields, newest first.

<Note>
  Register a `template.status` webhook to be notified the moment Meta reviews it, rather than polling — see [Webhooks](/webhooks-overview). Review typically takes minutes to a few hours, occasionally up to 24 hours.
</Note>
