# List WhatsApp templates

GET /v1/whatsapp/templates. Lists the workspace's WhatsApp templates, newest first, with the variables and buttons each takes.

`GET https://api.chatwise.so/v1/whatsapp/templates`

Lists the workspace's WhatsApp templates, newest first, with the variables and buttons each takes.

The API key needs the `templates:read` scope. See [authentication and scopes](https://chatwise.so/docs/authentication.md).

## Example

**curl**:

```bash
curl 'https://api.chatwise.so/v1/whatsapp/templates?limit=25&language=en_US&sendable=true' \
  -H "Authorization: Bearer $CHATWISE_API_KEY"
```

**Node.js**:

```js
const response = await fetch("https://api.chatwise.so/v1/whatsapp/templates?limit=25&language=en_US&sendable=true", {
  headers: {
    Authorization: `Bearer ${process.env.CHATWISE_API_KEY}`,
  },
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${body.message}`);
console.log(body.data);
```

**Python**:

```python
import json
import os
import urllib.request

request = urllib.request.Request(
    "https://api.chatwise.so/v1/whatsapp/templates?limit=25&language=en_US&sendable=true",
    headers={
        "Authorization": f"Bearer {os.environ['CHATWISE_API_KEY']}",
    },
)
with urllib.request.urlopen(request) as response:
    print(json.load(response)["data"])
```

## Query parameters

| Name | Type | Description |
| --- | --- | --- |
| `limit` | integer | How many to return, from 1 to 100. Default: `50`. |
| `cursor` | string | The previous page's `pagination.nextCursor`. Repeat the same filters and order with it. At most 512 characters. |
| `q` | string | Text in the template's name, in any case. Spaces around it are ignored. Can't be blank, or contain NUL characters or unpaired surrogates. At most 200 characters. |
| `name` | string | The exact name, in any case. Finds every translation of a template. Spaces around it are ignored. Can't be blank, or contain NUL characters or unpaired surrogates. At most 100 characters. |
| `language` | string | The language code, such as `en_US`. Spaces around it are ignored. |
| `category` | string | Only templates in this category. One of `UTILITY`, `MARKETING`, `AUTHENTICATION`. |
| `status` | string | Meta's review status, such as `APPROVED` or `PENDING`, in any case. Spaces around it are ignored. |
| `sendable` | string | `true` for templates the send routes can send, `false` for the others. Leave out for both. |

Unknown query parameters are refused with a 400.

## Response

**200.** A page of templates.

```json
{
  "data": [
    {
      "id": "123456789012345",
      "name": "order_ready",
      "language": "en_US",
      "category": "UTILITY",
      "status": "APPROVED",
      "rejectionReason": null,
      "sendable": true,
      "parameterFormat": "NAMED",
      "requiresOtp": false,
      "authentication": null,
      "components": {
        "header": null,
        "body": {
          "text": "Your order {{order_number}} is ready to collect.",
          "variables": [
            "order_number"
          ]
        },
        "footer": null,
        "buttons": []
      },
      "unsupportedReason": null,
      "createdAt": "2026-11-19T09:00:00.000Z",
      "updatedAt": "2026-11-19T09:05:00.000Z"
    }
  ],
  "pagination": {
    "nextCursor": null
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `data[].id` | string | The template's id: Meta's, or Chatwise's for an older template without one. Send it as `templateId`. |
| `data[].name` | string | The template's name. |
| `data[].language` | string | The template's language code, such as `en_US`. |
| `data[].category` | string or null | The template's category. |
| `data[].status` | string or null | Meta's review status, such as `APPROVED`, `PENDING`, `REJECTED` or `PAUSED`. |
| `data[].rejectionReason` | string or null | Why Meta rejected it, when it is rejected. |
| `data[].sendable` | boolean | Whether the send routes can send it: approved, with a layout they support. |
| `data[].parameterFormat` | string or null | How its variables are written. Null without variables. |
| `data[].requiresOtp` | boolean | Whether sending it needs a one-time code, as the `otp` value in `templateParams`. |
| `data[].authentication` | object or null | Settings of an authentication template. Otherwise null. |
| `data[].authentication.addSecurityRecommendation` | boolean or null | Whether it tells the customer not to share the code. |
| `data[].authentication.codeExpirationMinutes` | number or null | How long it says the code is valid. |
| `data[].components` | object | What the template contains. |
| `data[].components.header` | object or null | The header, if any. |
| `data[].components.header.format` | string | `TEXT`, `IMAGE`, `VIDEO` or `DOCUMENT`. |
| `data[].components.header.text` | string or null | The text of a text header. |
| `data[].components.header.variables` | array of strings | The header's variables. |
| `data[].components.body` | object | The body. |
| `data[].components.body.text` | string or null | The body's text. |
| `data[].components.body.variables` | array of strings | The body's variables. |
| `data[].components.footer` | string or null | The footer's text, if any. |
| `data[].components.buttons` | array of objects | The buttons. |
| `data[].components.buttons[].index` | integer | The button's position, from 0. Use it as `index` when sending. |
| `data[].components.buttons[].type` | string | The button's type, such as `URL`, `QUICK_REPLY`, `PHONE_NUMBER`, `COPY_CODE` or `OTP`. |
| `data[].components.buttons[].text` | string or null | The button's label. |
| `data[].components.buttons[].url` | string or null | The URL of a `URL` button. |
| `data[].components.buttons[].phoneNumber` | string or null | The phone number of a `PHONE_NUMBER` button. |
| `data[].components.buttons[].variable` | string or null | The variable at the end of a dynamic URL, if any. |
| `data[].components.buttons[].parameterType` | string or null | The parameter the button takes when sending, if any. |
| `data[].components.buttons[].otpType` | string or null | The kind of one-time code button, on authentication templates. |
| `data[].unsupportedReason` | string or null | Why the send routes can't send it, if they can't because of its layout. |
| `data[].createdAt` | string | When Chatwise stored the template. ISO 8601, in UTC. |
| `data[].updatedAt` | string | When the template last changed in Chatwise. ISO 8601, in UTC. |
| `pagination.nextCursor` | string or null | Send it as `cursor` for the next page. Null on the last page. |

## Errors

| Status | Message | What it means |
| --- | --- | --- |
| 400 | Validation failed | A parameter or body field is missing, unknown or malformed. `errors` lists each one. |
| 400 | Invalid cursor or cursor does not match this request | The cursor isn't one this route returned, or the filters or order changed since. |
| 401 | A valid Bearer API key is required | The `Authorization` header is missing or isn't `Bearer <API key>`. |
| 401 | Invalid or revoked API key | The key doesn't exist, was revoked, or has expired. |
| 401 | Invalid API key | Chatwise couldn't check the key. Try again. |
| 403 | API key does not have the required scope: templates:read | The key lacks the route's scope. Create a key that has it. |
| 429 | API key rate limit exceeded | Wait the number of seconds in the `Retry-After` header. |
| 500 | Internal server error | Something failed in Chatwise. Retry reads with backoff. |

The body of an error is described in [errors](https://chatwise.so/docs/errors.md).
