---
title: "Send template message"
method: POST
path: "/messages/template"
tags: ["Messages"]
---

# Send template message

`POST /messages/template`

Sends an approved WhatsApp template message. This is the only message type that reaches recipients that never messaged the business or whose service window is closed.

When the template contains a FLOW button, the request must include the matching `button` component with `sub_type: flow`.

## Request body

- object
  - `from` string, required — WhatsApp id of the sender phone number
  - `to` string, required — Recipient phone number, digits only, including country code
  - `template` object, required
    - `name` string, required — Name of the approved WhatsApp template
    - `language` object, required
      - `code` string, required — Language code of the template, e.g. `pt_BR`
    - `components` object[]
      - `type` string, required — Component type, e.g. `header`, `body` or `button`
      - `sub_type` string — Button sub type, e.g. `flow` or `url`
      - `index` integer — Index of the button, starting at 0
      - `parameters` unknown[] — Parameters that fill the component placeholders
        - unknown
      - `cards` object[] — Cards of a carousel template
        - `card_index` number, required
        - `components` object[]
          - `type` string, required — Component type, e.g. `header`, `body` or `button`
          - `sub_type` string — Button sub type, e.g. `flow` or `url`
          - `index` integer — Index of the button, starting at 0
          - `parameters` unknown[] — Parameters that fill the component placeholders
            - unknown

## Response `200`

Message sent successfully

- object
  - `id` string, uuid, required — Id of the created message
  - `contact` object, required
    - `waId` string, nullable, required — WhatsApp id of the recipient
    - `waUserId` string, nullable

## Other responses

- `400` — Bad request — invalid input data, or the message was rejected by the WhatsApp Cloud API (e.g. invalid template)
- `401` — Unauthorized
- `404` — Sender phone number not found or not linked to a WhatsApp Business Account

---

[API](https://skmtc.net/indigohive/apis/cogfy-messenger-public-api.md) · [All operations](https://skmtc.net/indigohive/apis/cogfy-messenger-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/indigohive/cogfy-messenger-public-api/revisions/30bd33ee45c9/schema)
