> For the complete documentation index, see [llms.txt](https://docs.pt.posit.us/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pt.posit.us/integracao/api.md).

# API - Documentação

## Arquitetura Positus - WhatsApp Business API

![](/files/-MDXYHcBQLDk3Ri96odh)

| SDK                                                                                                                     |                        |                                                        |
| ----------------------------------------------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------ |
| <https://github.com/positusapps/positus-api-laravel-client>                                                             | Laravel / PHP          | Youtube                                                |
| <https://github.com/positusapps/positus-api-php-client>                                                                 | PHP                    | [Youtube](https://www.youtube.com/watch?v=6hhHz73bsc4) |
| [https://www.nuget.org/packages/positus-api-csharp-client/](https://www.nuget.org/packages/positus-api-csharp-client/#) | Nuget .NET / .NET Core | [YouTube](https://www.youtube.com/watch?v=E8MZWwfQSZY) |
| <https://github.com/positusapps/positus-api-csharp-client>                                                              | Github para .NET       |                                                        |

{% hint style="info" %}
**Token de Produção:** O seu token será gerado e fornecido pela Positus, ele dará acesso a todos os seus números de WhatsApp Business API. A chave será fornecido após ativação de cada número de WhatsApp Business API.\
\
**Sandbox - Token desenvolvimento**: Você poderá gerar o seu token diretamente pelo <http://studio.posit.us/>.&#x20;
{% endhint %}

## Postman file

*O **Postman** é uma ferramenta que tem como objetivo testar serviços RESTful (Web APIs) por meio do envio de requisições HTTP e da análise do seu retorno.*\
[Download Postman App](https://www.postman.com/downloads/)

{% file src="/files/-MKocOHkPEcVZbDHMFG9" %}
API for production
{% endfile %}

{% file src="/files/-MLmBkSP997NiiDQ\_RiC" %}
API for development SandBox
{% endfile %}

## messages

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Utilize esta rota para enviar mensagens de texto via WhatsApp

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Content-Type   | string | application/json                 |
| Authentication | string | Autenticação usando Bearer Token |

#### Request Body

| Name | Type   | Description                                                                            |
| ---- | ------ | -------------------------------------------------------------------------------------- |
|      | object | { "to": "+5511999999999", "type": "text", "text": { "body": "your-message-content" } } |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## HSM

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Utilize esta rota para enviar mensagens de notificação via WhatsApp\
HSM - São templates de mensagens pré-aprovadas pelo Facebook, podem mensagens de texto, midia ou arquivos.

#### Path Parameters

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| Chave | string |             |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name     | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Completo | string | { "to": "+551199999999", "type": "template", "template": { "namespace": "xxxxxxx", "language": { "policy": "deterministic", "code": "pt\_BR" }, "name": "xxxxxx", "components": \[ { "type": "header", "parameters": \[ { "type": "image", "image": { "link": "<https://dealers.rewebmkt.com/images/20190417084518-actros-3-1280.jpg>" } } ] }, { "type": "body", "parameters": \[ { "type": "text", "text": "Rafael" }, { "type": "text", "text": "Mercedes-Benz" }, { "type": "text", "text": "Actros" }, { "type": "text", "text": "Cardiesel - Belo Horizonte" }, { "type": "text", "text": "08/05/2020" } ] }, { "type": "button", "sub\_type" : "url", "index": "0", "parameters": \[ { "type": "text", "text": "fMYMyV8x" } ] } ] } } |
| Botões   | string | { "to": "+5511999999999", "type": "template", "template": { "namespace": "dc730af3\_d5a86", "language": { "policy": "deterministic", "code": "pt\_BR" }, "name": "carteiro\_botoes", "components": \[ { "type": "body", "parameters": \[ { "type": "text", "text": "Robbu" }, { "type": "text", "text": "Thiago Thamiel" } ] }, { "type": "button", "sub\_type": "quick\_reply", "index": "0" } ] } }                                                                                                                                                                                                                                                                                                                                        |
| Texto    | object | <p>{ "to": "+55119999999999", "type": "hsm", "hsm": { "namespace": "52\_2bca4fad4c4a", "element\_name": "fgv\_3", "language": { "policy": "deterministic", "code": "pt\_BR" }, "localizable\_params": \[ { "default": "Thiago" } ] }<br>}</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## Contact

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Compartilhe contatos

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                                                                                                                                                                                                                          |
| ---- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      | object | { "to": "+5511999999999", "type": "contacts", "contacts":\[{ "addresses": \[], "emails": \[], "ims": \[], "name": { "first\_name": "Positus Provider", "formatted\_name": "Positus Provider" }, "org": \[], "phones": \[{ "phone": "+55 11 2626-4234", "type": "CELL", "wa\_id": "551126264234" }], "urls": \[] }] } |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## Location

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Compartilhe localizações

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                                                                                                                      |
| ---- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      | object | { "to": "+5511999999999", "type": "location", "location": { "longitude": -46.662787, "latitude": -23.553610, "name": "Robbu Brazil", "address": "Av. Angélica, 2530 - Bela Vista, São Paulo - SP, 01228-200" } } |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## Image

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Compartilhe imagens

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                                        |
| ---- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- |
|      | object | {  "to": "+5511999999999", "type": "image", "image": { "link": "<https://picsum.photos/200>", "caption": "your-document-caption" } |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## Document

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Compartilhe imagens

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                                                          |
| ---- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|      | object | {  "to": "+5511941489395", "type": "document", "document": { "link": "<http://www.pdf995.com/samples/pdf.pdf>", "caption": "your-document-caption" } |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## Video

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Compartilhe videos

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                                                                                             |
| ---- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      | object | {  "to": "+5511999999999", "type": "video", "video": { "link": "<https://sample-videos.com/video123/mp4/720/big\\_buck\\_bunny\\_720p\\_1mb.mp4>", "caption": "your-document-caption" } |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## Audio

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Compartilhe audios

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                                |
| ---- | ------ | -------------------------------------------------------------------------------------------------------------------------- |
|      | object | { "to": "+5511999999999", "type": "audio", "audio": { "link": "<https://sample-videos.com/audio/mp3/crowd-cheering.mp3>" } |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## Sticker

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Compartilhe adesivos. O Formato do adesivo tem que ser exatamente 512x512

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                              |
| ---- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
|      | object | { "to": "+5511999999999", "type": "sticker", "sticker": { "link": "<https://studio.posit.us/api/samples/sticker.webp>" } |

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

```
```

{% endtab %}
{% endtabs %}

## Download Midia

<mark style="color:blue;">`GET`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/media/{{messages.type.id}}`

Faça o download das midias

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

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

```
{
    "messages": [
        {
            "id": "gBGHVRGZmZmZnwIJpWDiExk7olMZ"
        }
    ],
    "message": "The message was successfully sent"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "errors": [
        {
            "code": ,
            "title": "",
            "details": ""
        }
    ],
    "message": ""
}
```

{% endtab %}
{% endtabs %}

## Mensagens Interativas - Lista

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Listar Mensagens: Mensagens incluindo um menu de até 10 opções. Esse tipo de mensagem oferece uma maneira mais simples e consistente para os usuários fazerem uma seleção ao interagir com uma empresa.\
\
Mensagens de botão de lista ou de resposta não podem ser usadas como notificações. Atualmente, eles só podem ser enviados dentro de 24 horas da última mensagem enviada pelo usuário. Se você tentar enviar uma mensagem fora da janela de 24 horas, você receberá uma mensagem de erro.

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ---- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|      | string | {"to":"+5511999999999","type":"interactive","interactive":{"type":"list","header":{"type":"text","text":"CryptoBank"},"body":{"text":"Olá senhor Thiago Thamiel, me chamo Francisco Dabus estou falando referente ao Banco CryptoBank e você já pode regular sua pendência financeira por aqui. Veja as opções que preparamos para você!\n\n💼 Contrato: 82782361236213\n🗓️ Vencimento: 01/01/2021\n💰 Valor Atualizado: 232,83"},"footer":{"text":"Demonstração Robbu"},"action":{"button":"Opções de pagamento","sections":\[{"title":"Atualização","rows":\[{"id":"7","title":"Vencimento Hoje","description":"💰 R$ 201,23 - Parcelas 17 até 19 de 24"},{"id":"1","title":"Vencimento Amanha","description":"💰 R$ 219,32 - Parcelas 17 até 19 de 24"}]},{"title":"Quitação","rows":\[{"id":"3","title":"Vencimento Hoje","description":"💰 R$ 1.323,21 - Todas as parcelas restantes"},{"id":"4","title":"Vencimento Amanha","description":"💰 R$ 1.382,34 - Todas as parcelas restantes"}]}]}}} |

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

```
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Documentação completa: <https://developers.facebook.com/docs/whatsapp/guides/interactive-messages>
{% endhint %}

## Mensagens Interativas - Botões

<mark style="color:green;">`POST`</mark> `https://api.positus.global/v2/whatsapp/numbers/{{chave}}/messages`

Botões de resposta: Mensagens incluindo até 3 opções — cada opção é um botão. Esse tipo de mensagem oferece uma maneira mais rápida para os usuários fazerem uma seleção a partir de um menu ao interagir com uma empresa. Os botões de resposta têm a mesma experiência do usuário que modelos interativos com botões.\
\
Mensagens de botão de lista ou de resposta não podem ser usadas como notificações. Atualmente, eles só podem ser enviados dentro de 24 horas da última mensagem enviada pelo usuário. Se você tentar enviar uma mensagem fora da janela de 24 horas, você receberá uma mensagem de erro.

#### Path Parameters

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| Chave | string | Código único por número de WhatsApp |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | Autenticação usando Bearer Token |
| Content-Type   | string | application/json                 |

#### Request Body

| Name | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      | string | {"to":"+5511999999999","type":"interactive","recipient\_type":"individual","interactive":{"type":"button","header":{"type":"text","text":"1 mês grátis"},"body":{"text":"Ótima escolha, agora você já pode ativar o seu número e realizar testes por 1 mês sem compromisso."},"footer":{"text":"[https://posit.us"},"action":{"buttons":\\\[{"type":"reply","reply":{"id":"unique-postback-id-1","title":"Criar](https://docs.pt.posit.us/integracao/https:/posit.us"},"action":{"buttons":\\\[{"type":"reply","reply":{"id":"unique-postback-id-1","title":"Criar) conta grátis"}},{"type":"reply","reply":{"id":"unique-postback-id-2","title":"Falar com atendente"}}]}}} |

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

```
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Documentação completa: <https://developers.facebook.com/docs/whatsapp/guides/interactive-messages>
{% endhint %}


---

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

```
GET https://docs.pt.posit.us/integracao/api.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.
