> For the complete documentation index, see [llms.txt](https://help.skoobot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.skoobot.com/api-documentation/whatsapp-cloud-api/post-whatsapp-template-message.md).

# POST WhatsApp Template Message

**Parameter Description**

1. `userName`: refers to the name of the user we intend to send the message
2. `wa_id`: refers to the WhatsApp number of the user we intend to send the message **NOTE**: The number must contain the country code without the plus sign
3. `templateId`: refers to the ID of the template **NOTE:** Template must be approved before using this API
4. `assingTo` : refers to the email of custom user or agent.
5. `params`: is used for the variables used in the template, it is an empty array in the case of a plain text template with no variables. In case of variables in the template, please refer to the JSON below
6. `tags`: refers to label you can assign to conversations or chats to help organize and manage effectively.

***

#### API End Points <a href="#api-end-points" id="api-end-points"></a>

```
https://api-v7.express-chat.com/whatsapp-automation/wa/templates?apiKey=*API KEY*
```

#### Request Headers <a href="#request-headers" id="request-headers"></a>

| Header | Details                                       |
| ------ | --------------------------------------------- |
| apiKey | <p>API KEY</p><h4 id="query-params"><br></h4> |

#### **Query Params** <a href="#query-params" id="query-params"></a>

| Header | Details                                       |
| ------ | --------------------------------------------- |
| apiKey | <p>API KEY</p><h4 id="query-params"><br></h4> |

#### Body <a href="#body" id="body"></a>

```
{
    "userName": "Divyansh Test",
    "wa_id": "9175080****",
    "templateId": "62b5c16bf*****cfa9a72335",
    "params": [
			{
				"type" : "header",
				 "parameters": [
                {
                            "type": "document",
                            "document": {
                            "link": "<https://www.africau.edu/images/default/sample.pdf>"
                            }
                }
            ]
			},
			{
                    "type": "body",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "Abc"
                        },
                         {
                            "type": "text",
                            "text": "def"
                        },
                         {
                            "type": "text",
                            "text": "Monday"
                        }
                    ]
        }
		 ],
		 "assignTo": "example@gmail.com",
		 "tags": [ "test" ]
}
```

#### Example: <a href="#example" id="example"></a>

**Request**

```
curl --location --request POST '<https://api-v7.express-chat.com/whatsapp-automation/wa/send-template?apiKey=> *Shared Separately*' \\
--header 'apiKey: *API KEY*' \\
--header 'Content-Type: application/json' \\
--data-raw '{
    "userName": "Test",
    "wa_id": "91885917****",
    "templateId": "63dba1617****52face07078",
    "params": [
        {
            "type": "header",
            "parameters": [
                {
                            "type": "document",
                            "document": {
                            "link": "<https://www.africau.edu/images/default/sample.pdf>"
                            }
                }
            ]
        },
        {
                    "type": "body",
                    "parameters": [
                        {
                            "type": "text",
                            "text": "Abc"
                        },
                         {
                            "type": "text",
                            "text": "def"
                        },
                         {
                            "type": "text",
                            "text": "Monday"
                        }
                    ]
        }

    ],
     "assignTo": "example@gmail.com",
     "tags": [ "test" ]
}'
```

**Response**

Header

| Header                           | Details                             |
| -------------------------------- | ----------------------------------- |
| X-Powered-By                     | Express                             |
| Vary                             | Origin                              |
| Access-Control-Allow-Credentials | true                                |
| \_user                           | 61c1c2058e0\*\*\*\*e9bb420f8        |
| \_bot                            | 62e77a807f1\*\*\*\*ecce980f0        |
| whatsAppId                       | \*\*\*\*bsIWcYgazd5ZDAK             |
| Content-Type                     | application/json; charset=utf-8     |
| Content-Length                   | 507                                 |
| Etag                             | W/"1fb-urlVjgGZAUBRNyxQDAOnZ3ONF1I" |
| Date                             | Wed, 03 Aug 2022 11:16:13 GMT       |
| Connection                       | keep-alive                          |
| Keep-Alive                       | timeout=5                           |

#### &#x20; <a href="#body" id="body"></a>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.skoobot.com/api-documentation/whatsapp-cloud-api/post-whatsapp-template-message.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
