# Messages

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 %}


---

# Agent Instructions: 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:

```
GET https://help.whautomate.com/product-guides/whautomate-rest-api/messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
