# Get a WhatsApp template

GET /v1/whatsapp/templates/{templateId}. Reads one WhatsApp template.

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

Reads one WhatsApp template. After creating one, poll it until `status` is no longer `PENDING`. `sendable` then says whether the send routes can send it.

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/123456789012345' \
  -H "Authorization: Bearer $CHATWISE_API_KEY"
```

**Node.js**:

```js
const response = await fetch("https://api.chatwise.so/v1/whatsapp/templates/123456789012345", {
  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/123456789012345",
    headers={
        "Authorization": f"Bearer {os.environ['CHATWISE_API_KEY']}",
    },
)
with urllib.request.urlopen(request) as response:
    print(json.load(response)["data"])
```

## Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `templateId` | string | **Required.** The template's id: Meta's, or Chatwise's own numeric id. Not `.` or `..`, which a URL can't carry. At most 128 characters. |

## Response

**200.** The template.

```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"
  }
}
```

| 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. |

## Errors

| Status | Message | What it means |
| --- | --- | --- |
| 400 | Validation failed | A parameter or body field is missing, unknown or malformed. `errors` lists each one. |
| 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. |
| 404 | Template not found | No such template in the key's workspace. Sending by name finds approved templates only. |
| 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).
