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

# The Template object

> A WhatsApp template in Texter - internal behavior plus WhatsApp provider state

template combines what **Texter** knows (routing rules, departments, send defaults) with what **WhatsApp** knows (`provider_template`: approval status and localized content). A template you just created lives in `localizationDrafts` until you [submit it](/api-reference/manage-templates/submit-template-for-approval); approved content appears under `provider_template.localizations`.

<Info>
  Returned by: [List All Templates](/api-reference/manage-templates/list-all-templates) · [Create New Template](/api-reference/manage-templates/create-new-template) · [Create or Update Localization](/api-reference/manage-templates/create-or-update-localization) · [Submit Template for Approval](/api-reference/manage-templates/submit-template-for-approval)
</Info>

```json Example template object [expandable]  theme={null}
{
  "_id": "690868f7962e17ab3033f91b",
  "name": "inbox_marketing_95",
  "title": "Order ready notification",
  "usage": "inbox",
  "chatStatus": 1,
  "created": 1762158839563,
  "updatedAt": "2025-11-03T08:33:59.563Z",
  "departments": [],
  "isDefault": false,
  "channelInfo": {
    "name": "whatsapp",
    "accountId": "972509876543"
  },
  "provider_template": {
    "name": "inbox_marketing_95",
    "category": "MARKETING",
    "localizations": [
      {
        "language": "he",
        "status": "APPROVED",
        "components": [
          {
            "type": "BODY",
            "text": "היי {{1}} מעדכן שהזמנה מספר {{2}} מוכנה לאיסוף",
            "example": {
              "body_text": [
                [
                  "רועי",
                  "15033"
                ]
              ]
            }
          },
          {
            "type": "FOOTER",
            "text": "להסרה השב הסר"
          }
        ]
      }
    ],
    "metadata": {}
  },
  "defaults": {
    "he": {
      "body": [
        "רועי",
        "15033"
      ]
    }
  },
  "localizationDrafts": {}
}
```

## Top-level

| Field         | Type       | Description                                                                                                                |
| ------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------- |
| `_id`         | `string`   | Unique identifier of the template in Texter                                                                                |
| `name`        | `string`   | Internal template name - **this is the template ID used in API calls** Example: `bulk_marketing_272`                       |
| `title`       | `string`   | Human-readable title shown in Texter's UI                                                                                  |
| `usage`       | `string`   | `inbox` (1-to-1) or `bulk` (broadcast)                                                                                     |
| `created`     | `number`   | When the template was created (epoch ms)                                                                                   |
| `updatedAt`   | `string`   | Last update (ISO date-time)                                                                                                |
| `departments` | `string[]` | Department IDs allowed to use this template. Can be empty                                                                  |
| `isDefault`   | `boolean`  | Whether this is the default template for the account. Only one template can be default                                     |
| `provider`    | `string`   | Channel adapter that owns this template (relevant when multiple WhatsApp account types are connected)                      |
| `channelInfo` | `object`   | The channel account this template belongs to: `{name, accountId}` (for WhatsApp, `accountId` is the business phone number) |

## Reply behavior

What happens after the recipient replies to this template.

| Field                   | Type     | Description                                                                                |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------ |
| `chatStatus`            | `number` | Status the chat moves to after the reply: `0` BOT, `1` PENDING, `2` ASSIGNED, `3` RESOLVED |
| `setBotNode`            | `string` | Bot node to start from, when `chatStatus` routes to the bot                                |
| `bot`                   | `string` | Specific bot to run, when `chatStatus` routes to the bot                                   |
| `replyText`             | `string` | Text automatically sent when the recipient replies                                         |
| `responsibleAgent`      | `string` | Agent (email) the chat is assigned to after the reply                                      |
| `responsibleDepartment` | `string` | Department ID the chat is assigned to after the reply                                      |
| `attachedFile`          | `object` | File (`{name, url}`) automatically sent after the reply, when configured                   |

## provider\_template

| Field                             | Type       | Description                                                                               |
| --------------------------------- | ---------- | ----------------------------------------------------------------------------------------- |
| `provider_template.name`          | `string`   | Template name as registered with WhatsApp. Typically matches `name`                       |
| `provider_template.category`      | `string`   | `MARKETING` or `UTILITY`. WhatsApp may change it on approval                              |
| `provider_template.localizations` | `object[]` | All localizations known to WhatsApp - see the next section. Empty while only drafts exist |
| `provider_template.metadata`      | `object`   | Extra provider metadata                                                                   |

## Localizations

Each item of `provider_template.localizations[]` describes one language variant as seen by WhatsApp.

<Note>
  The WhatsApp provider also passes through raw fields that vary by account type: WhatsApp **Cloud** accounts add `id`, `name`, `category`, `previous_category`, `parameter_format`; other account types add `createdAt`, `lastUpdated` and `qualityScore` (`{score, reasons}` - e.g. `GREEN`, `YELLOW`, `RED`).
</Note>

| Field             | Type       | Description                                                                                                 |
| ----------------- | ---------- | ----------------------------------------------------------------------------------------------------------- |
| `status`          | `string`   | `REQUESTED`, `SUBMIT_FAILED`, `PENDING`, `APPROVED`, `REJECTED`, `DELETION_PENDING`, `DELETED`, `SUBMITTED` |
| `rejectionReason` | `string`   | Reason for rejection Example: `NONE`                                                                        |
| `language`        | `string`   | WhatsApp locale code (`he`, `en`, `en_US`, `pt_BR`... - 71 locales supported)                               |
| `components`      | `object[]` | The HEADER / BODY / FOOTER / BUTTONS that make up this variant - see the next section                       |
| `metadata`        | `object`   | Channel-specific metadata, when present                                                                     |

## Components

Each item of a localization's `components[]` array:

| Field                       | Type         | Description                                                                                                                                      |
| --------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `type`                      | `string`     | `HEADER`, `BODY`, `FOOTER`, `BUTTONS`                                                                                                            |
| `text`                      | `string`     | Text for BODY / FOOTER. BODY supports `{{1}}`-style variables; WhatsApp limits it to \~1024 chars (MARKETING) / \~550 chars (UTILITY)            |
| `format`                    | `string`     | HEADER only: `IMAGE`, `VIDEO`, `DOCUMENT`, `LOCATION`                                                                                            |
| `example.header_handle`     | `string[]`   | Media headers: exactly one HTTP(S) example media URL (required by WhatsApp)                                                                      |
| `example.body_text`         | `string[][]` | Example values for body variables. Required when the body has variables; must match the variable count and order                                 |
| `buttons`                   | `object[]`   | BUTTONS only: up to 3 `QUICK_REPLY` buttons **or** up to 2 call-to-action buttons (`URL` / `PHONE_NUMBER` / `FLOW`) - the groups cannot be mixed |
| `buttons[].text`            | `string`     | Button label. FLOW buttons: max 25 characters                                                                                                    |
| `buttons[].url`             | `string`     | URL buttons: target URL, optionally with a single `{{1}}` variable at the end                                                                    |
| `buttons[].example.url`     | `string`     | Required when `url` has a variable: a resolved example starting with the exact same literal prefix                                               |
| `buttons[].phone_number`    | `string`     | PHONE\_NUMBER buttons: E.164 number                                                                                                              |
| `buttons[].flow_id`         | `string`     | FLOW buttons: published Flow ID from Meta                                                                                                        |
| `buttons[].flow_action`     | `string`     | FLOW buttons: `navigate` (default) or `data_exchange`                                                                                            |
| `buttons[].navigate_screen` | `string`     | FLOW buttons: screen `id` to open first. Required with `navigate`. Case-sensitive                                                                |

## defaults

Per-language values prefilled when [sending the template](/api-reference/manage-templates/send-template-message) if the caller does not provide overrides. Keyed by language code.

| Field                     | Type       | Description                                                                   |
| ------------------------- | ---------- | ----------------------------------------------------------------------------- |
| `defaults.{lang}.body`    | `string[]` | Default BODY variable values, in `{{n}}` order                                |
| `defaults.{lang}.header`  | `object`   | Default header media: `{type, url, filename?}` (`filename` for documents)     |
| `defaults.{lang}.buttons` | `object[]` | Default button payloads (`{type, payload}`), e.g. a default dynamic-URL value |

## localizationDrafts

Map of language code to a draft localization - content created in Texter but not yet submitted to WhatsApp. Same component structure as approved localizations, without `status`.

| Field                                  | Type       | Description                                             |
| -------------------------------------- | ---------- | ------------------------------------------------------- |
| `localizationDrafts.{lang}.language`   | `string`   | Language code of this draft                             |
| `localizationDrafts.{lang}.components` | `object[]` | Draft components (same shape as the Components section) |

## Localization status values

| Status             | Meaning                                      |
| ------------------ | -------------------------------------------- |
| `REQUESTED`        | Submitted, waiting for WhatsApp              |
| `SUBMIT_FAILED`    | Submission to WhatsApp failed                |
| `PENDING`          | Under WhatsApp review                        |
| `APPROVED`         | Approved - can be sent                       |
| `REJECTED`         | Rejected by WhatsApp (see `rejectionReason`) |
| `DELETION_PENDING` | Deletion requested, not yet final            |
| `DELETED`          | Deleted at WhatsApp                          |
| `SUBMITTED`        | Accepted for processing                      |

**Category values:** `MARKETING` · `UTILITY` - WhatsApp may recategorize on approval.

More enums and the ID cheat sheet: [Enums & Common Fields](/api-reference/enums).
