> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comix-flow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Templates

> List WhatsApp message templates for a specific sender

This endpoint returns all message templates associated with a specific WhatsApp sender. Templates are required for initiating conversations or messaging users outside the 24-hour messaging window.

### Path Parameters

**senderId** `integer` *required*

The ID of the WhatsApp sender (obtained from the [Get Senders](https://docs.comix-flow.com/api-reference/whatsapp/get-senders.md) endpoint)

### Query Parameters

**status** `string`

Filter templates by approval status. Default: `approved`. Use `all` to return all templates regardless of status.

### Response Fields

**data** `array`

**Template object properties**

**id** `integer`

The unique identifier of the template. Use this when sending template messages.

**name** `string`

The template name as registered with Meta (e.g., `order_confirmation`, `appointment_reminder`)

**language** `string`

The template language code (e.g., `en`, `es`, `pt_BR`)

**category** `string`

The template category: `marketing`, `utility`, or `authentication`

**status** `string`

The approval status: `approved`, `pending`, or `rejected`

**body\_text** `string`

The template body text, with variable placeholders shown as `{{1}}`, `{{2}}`, etc.

**variables** `array`

The variable numbers the template needs when sending, as strings (`"1"`, `"2"`, ...). They cover the header, body, link buttons and coupon code. Empty array if the template has no variables.

**has\_variables** `boolean`

Whether this template requires variables to be provided when sending

**header\_format** `string | null`

`TEXT`, `IMAGE`, `VIDEO` or `DOCUMENT`, or `null` if the template has no header. Image, video and document headers send the file attached to the template.

**header\_text** `string | null`

The header text for `TEXT` headers, with its variable shown as `{{N}}`.

**footer\_text** `string | null`

The footer text, if the template has one.

**buttons** `array`

The template's buttons in order. Each has a `type` (`QUICK_REPLY`, `URL`, `PHONE_NUMBER`, `COPY_CODE` or `VOICE_CALL`) and, depending on the type, `text`, `url`, `phone_number` or `code`. A link or coupon code that contains `{{N}}` takes that variable's value when sending.

### Error Responses

**404 Not Found**

**Error Response**

**success** `boolean`

`false`

**error** `string`

`Sender not found`

**error\_code** `string`

`SENDER_NOT_FOUND`

```bash cURL theme={null} theme={null}
curl -X GET "https://ai.comix-flow.com/api/user/whatsapp/senders/12/templates" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```bash All templates (including pending/rejected) theme={null} theme={null}
curl -X GET "https://ai.comix-flow.com/api/user/whatsapp/senders/12/templates?status=all" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```javascript JavaScript theme={null} theme={null}
const senderId = 12;

const response = await fetch(
  `https://ai.comix-flow.com/api/user/whatsapp/senders/${senderId}/templates`,
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const data = await response.json();
console.log(data.data); // Array of templates
```

```python Python theme={null} theme={null}
import requests

sender_id = 12

response = requests.get(
    f'https://ai.comix-flow.com/api/user/whatsapp/senders/{sender_id}/templates',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)

templates = response.json()['data']
for template in templates:
    print(f"{template['name']} ({template['language']}): {template['body_text']}")
```

```json 200 Response theme={null} theme={null}
{
  "data": [
    {
      "id": 45,
      "name": "appointment_reminder",
      "language": "en",
      "category": "utility",
      "status": "approved",
      "body_text": "Hi {{1}}, this is a reminder for your appointment on {{2}} at {{3}}. Reply YES to confirm or NO to reschedule.",
      "variables": ["1", "2", "3"],
      "has_variables": true,
      "header_format": "TEXT",
      "header_text": "Appointment reminder",
      "footer_text": null,
      "buttons": [
        { "type": "QUICK_REPLY", "text": "YES" },
        { "type": "QUICK_REPLY", "text": "NO" }
      ]
    },
    {
      "id": 46,
      "name": "welcome_message",
      "language": "en",
      "category": "marketing",
      "status": "approved",
      "body_text": "Welcome to Acme Corp! We're excited to have you. How can we help you today?",
      "variables": [],
      "has_variables": false,
      "header_format": null,
      "header_text": null,
      "footer_text": null,
      "buttons": []
    }
  ]
}
```

```json 404 Sender Not Found theme={null} theme={null}
{
  "success": false,
  "error": "Sender not found",
  "error_code": "SENDER_NOT_FOUND"
}
```

### Notes

* Only `approved` templates are returned by default. Templates with `pending` or `rejected` status cannot be used to send messages.
* Template approval status is synced with Meta every 4 hours automatically.
* Variables in `body_text` are shown as `{{1}}`, `{{2}}`, etc. The `variables` array provides human-readable names for each placeholder.
* Templates are required when messaging a user for the first time or outside the 24-hour messaging window.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.