> For the complete documentation index, see [llms.txt](https://help.whautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.whautomate.com/product-guides/whautomate-rest-api/messages.md).

# Messages

Use our omnichannel API to send messages across multiple channels using our API.

Effective and efficient communication remains pivotal for businesses seeking to engage with their customers in the ever-evolving digital landscape. Recognising this need, Whautomate's Messages Endpoint emerges as a versatile and powerful tool, designed to streamline and enhance your messaging capabilities across multiple popular platforms, including Telegram, Instagram, WhatsApp, and Messenger.

### **Get Messages of Contact**

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/{contactId}" method="get" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

### WhatsApp

Please note you can only send Media and Text Messages when there is an active session  (24 hr period). You can send template messages to a contact any time even if there is no active session. \
\
You can send WhatsApp messages to&#x20;

* Contact
* Client
* Recepient

Simply send the message to a recepient with phoneNumber and name, the platform will create or use the existing contact in your account.  \
\
If you already have a contact or Client created in Whautomate and you have those identifiers, use those identifiers to send the message to them. If not use recepient instead.

{% openapi src="/files/3x7PWuIh3aMNrbyAIPuD" path="/v1/messages/whatsapp/sendtemplate" method="post" %}
[Whautomate Rest API-Production-oas30.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2F5KLn8iA36t3Yrq92NAaz%2FWhautomate%20Rest%20API-Production-oas30.json?alt=media\&token=37f577a8-7e4c-4a54-ac1a-1f175dc9322b)
{% endopenapi %}

<mark style="color:green;">`POST`</mark> `/users`

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name   | Type   | Description      |
| ------ | ------ | ---------------- |
| `name` | string | Name of the user |
| `age`  | number | Age of the user  |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "id": 1,
  "name": "John",
  "age": 30
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/whatsapp/sendmedia" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/whatsapp/sendtext" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

### Telegram

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/telegram/sendmedia" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/telegram/sendtext" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/telegram/sendtemplate" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

### Instagram

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/instagram/sendmedia" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/instagram/sendtemplate" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/instagram/sendtext" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

### Messenger<br>

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/messenger/sendmedia" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/messenger/sendtemplate" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}

{% openapi src="/files/qI2JcsRGOFfkXOfz8yQ5" path="/v1/messages/messenger/sendtext" method="post" %}
[Whautomate-YourHost.json](https://810714386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF8vuadG7OJ1fFdSBZATv%2Fuploads%2Fl9XmHDoNBJKPmT7Ekyyv%2FWhautomate-YourHost.json?alt=media\&token=81631fe2-ccb7-4df3-8215-8f11fbb966cb)
{% endopenapi %}
