---
title: "Send an interactive template button message to an WhatsApp User"
method: POST
path: "/rest/sendMessage/{instance_key}/templateMessage"
tags: ["SendMessageController"]
---

# Send an interactive template button message to an WhatsApp User

`POST /rest/sendMessage/{instance_key}/templateMessage`

The templateMessage is a special type of message that allows <br />
    you to send a message with a special buttons like copyButton, <br />
    urlButton, callButton, etc. <br />
    <br>
    <strong>How to send templateMessage?</strong> <br />
    <br>
    The messageData object requires you to specify the type of button you <br />
    want to send to the user. <br />
    The type of button you can send are: <br />
    <br>
    <code>copy</code><br><br>
    <code>url</code><br><br>
    <code>call</code><br><br>
    <br>
    In the <i>payload</i> field, you have to enter the payload <br>
    i.e. url in case of the url or phone number in case of call <br>
    <br>
    <strong>Example of templateMessage? </strong> <br />
    <br>
    <code><br>
{<br>
   "messageData":{<br>
      "to": "918788889688@s.whatsapp.net",<br>
      "title": "Message Title",<br>
      "text": "Message Text",<br>
      "footer": "Message Footer",<br>
      "type": "image", // ("text" | "image" | "video" | "document")<br>
      "mediaUrl": "https://www.example.com/imagem.jpg",<br>
      "buttons": [<br>
         {<br>
            "type": "copy",<br>
            "title": "This is a copyButton"<br>
            "payload": "Your text for copy"<br>
         },<br>
         {<br>
            "type": "url",<br>
            "title": "This is a urlButton",<br>
            "payload": "https://google.com"<br>
         },<br>
         {<br>
            "type": "call",<br>
            "title": "This is a callButton",<br>
            "payload": "918788889688"<br>
         }<br>
      ]<br>
   }<br>
}<br>
    </code>
    <br>
    <strong>NOTE: </strong>
    <i>Due to certain limitations from WhatsApp, when you send templateMessage to someone, <br>
    the message won't be visible in you phone. Also you will also see that the message has been sent <br>
    too your own phone number.<br>
    </i>

## Path parameters

- `instance_key` string, required

## Request body

- object
  - `messageData` TemplateMessage
    - `to` string
    - `title` string
    - `text` string
    - `footer` string
    - `type` string
    - `mediaUrl` string
    - `buttons` TypeTemplate[]
      - `type` string
      - `title` string
      - `payload` string

## Response `200`

Success

---

[API](https://skmtc.net/megaapi/apis/documentation-megaapi.md) · [All operations](https://skmtc.net/megaapi/apis/documentation-megaapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/megaapi/documentation-megaapi/versions/09ca1205343e/schema)
