> For the complete documentation index, see [llms.txt](https://docs.altu.d1.cx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.altu.d1.cx/connect/canais/bot_api.md).

# Bot API

O bot API é um serviço que permite iniciar atendimentos com integração por meio de uma API.&#x20;

## Configurações

Adicione uma nova API com as seguintes informações:

![](/files/-MRyV8m8MuRFFYyOr437)

* **Nome:** nome que deseja para a API
* **Assistente:** selecione o assistente >adicionar o link da página de assistentes da doc<
* **Squad:** selecione o nome da squad se estiver disponível na lista, caso contrário mantenha como “geral”

Após criar, acesse sua área de edição para configurar algumas opções:

![](/files/-MRyVlwDISy6xfRlz57_)

O processo assíncrono é utilizado na V2, nesta temos a possibilidade de configurar um callback, que é o endpoint informado na tela de configuração da API que irá receber a resposta do assistente após uma requisição com input.

<mark style="color:green;">`POST`</mark> `https://connector.ms.altubots.com/<slug>/api/<id_integracao>`

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Content-Type:<mark style="color:red;">\*</mark> | string | application/json |

#### Request Body

| Name                                            | Type   | Description          |
| ----------------------------------------------- | ------ | -------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | token gerado no ALTU |

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

```
{
    "code": 200,
    "message": "Message sent."
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "code": 400,
    "message": "Bad request: body"
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    "code": 401,
    "message": "Unauthorized."
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "code": 404,
    "message": "Client not found."
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    "code": 500,
    "message": "Unexpected Error."
}
```

{% endtab %}
{% endtabs %}

#### **Body:**

```
{
    "input": {
        "text": "Olá"
    },
    "identifier": "{identificador_do_contato}",
    "context": {
        "var1": "value1",
        "var2": "value2"
    }
}
```

Para obter o contexto é necessário marcar a opção "Incluir contexto do atendimento na resposta", disponível na tela de configuração da API.

#### **Header:**

```
Content-Type: application/json
Authorization: <token autogerado pelo ALTU> 
```

{% hint style="info" %}
Para que o POST no *callback* seja realizado, é **obrigatório** informar tanto a `URL` quanto o `Token`.
{% endhint %}

![](/files/-MRy_BhrAV3ctzaH1Zfd)


---

# 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.altu.d1.cx/connect/canais/bot_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.
