> For the complete documentation index, see [llms.txt](https://zaiadocs.gitbook.io/recursos/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zaiadocs.gitbook.io/recursos/agentes/integracoes-e-canais/manychat.md).

# Manychat

### Introdução

Antes de começarmos, é importante definir claramente o propósito desta integração. Atualmente, nosso aplicativo na plataforma Manychat permite que seu agente responda direct e comentários no seu `Instagram`, `WhatsApp` ou `Messenger`. Veja abaixo como funciona o processo de integração em cada um deles:

### Gerando chave para o Manychat

Para poder utilizar a aplicação Zaia dentro da plataforma Manychat, você deve gerar a API Key do seu agente.

{% stepper %}
{% step %}

### Dentro da plataforma [Zaia](https://platform.zaia.app/platform/my-agents/), selecione o seu agente.

{% endstep %}

{% step %}

### Selecione configurações na engrenagem do canto superior direito

{% endstep %}

{% step %}

### Clique em <mark style="color:red;">`onde usar`</mark>.

{% endstep %}

{% step %}

### Selecione o card com o título <mark style="color:red;">`Manychat`</mark> .

<figure><img src="/files/LcaKW7q0nWyNhk45LMN7" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Clique em Gerar do lado direito

<figure><img src="/files/MOwyABHgkSPZZbcxCjte" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Clique em <mark style="color:red;">`Copiar`</mark> e vamos para o Manychat

{% endstep %}
{% endstepper %}

### Integrando seu Agente com o Manychat

Para integrar seu agente via Manychat você precisa seguir os seguintes passos:

{% stepper %}
{% step %}

### Instale o aplicativo Zaia no Manychat

{% embed url="<https://manychat.com/apps/47ab7663e470680cb4eba6a232c08090c1fece7f/install>" %}
Clique aqui para acessar o Manychat
{% endembed %}

<figure><img src="/files/lZf7dVeIN5e1FiMm8U4b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Insira a `Api Key` do seu Agente e salve.

<figure><img src="/files/pOtFyvI9Eerobcai6w4n" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Agora antes de iniciarmos a automatização precisamos criar um campo para as respostas do Agente. Vá nas configurações do Manychat e depois clique em "Campos” ou "Fields”.

<figure><img src="/files/aofTkV3S8VHaOdH892Ue" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Clique em "Novo Campo do Usuário”.

<figure><img src="/files/8W4FcnF3BTmaiMLGINj3" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Feito isso, crie um campo com o nome que quiser e depois clique em "Criar”, aqui vamos colocar com o nome "agent\_response” para identificarmos que é especificamente para as respostas do Agente.

<figure><img src="/files/riQmd2mP6hYLdGy6pPPq" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Ótimo, após criar, vá para "Automatizações” e inicie uma nova automação:

<figure><img src="/files/LYeAI95X9noyHRBLCT7i" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Clique no primeiro bloco e clique em "**Novo Gatilho”**

<figure><img src="/files/3betHtuRlG6vnsmnCEcn" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Supondo que você queira integrar seu Agente para responder direct no seu `Instagram`, selecione a opção "**O usuário envia uma mensagem**”.

<figure><img src="/files/ML6oblABR4ZEX1xXLvKE" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Clique em “**Detectar determinadas palavras em uma mensagem**”

<figure><img src="/files/pw28ZNALw3SLt8K9SGoK" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Aqui você pode criar o gatilho da forma que precisar, nesse exemplo queremos responder qualquer tipo de mensagem, então vamos preencher como o exemplo abaixo, incluindo as <mark style="color:red;">**vogais**</mark> (a, e, i, o e u) e clique em <mark style="color:purple;">**CRIAR**</mark> .

<figure><img src="/files/A6CRR5dGyQSrJU496bo4" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Após configurar o gatilho, clique em <mark style="color:purple;">`Ações`</mark> .

<figure><img src="/files/BhxPkD9narLbNZJCzoA6" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Selecione o aplicativo <mark style="color:purple;">`Zaia`</mark> e selecione a ação: “**Gere a resposta do seu Agente.”.**

<figure><img src="/files/5pA2dft1j8PD0gUZjhBz" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Selecione o canal que deseja fazer a automatização

<figure><img src="/files/Yrvfec8iE872KIFR77jJ" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
No campo "Última entrada de texto” clique e selecione a opção "Última entrada de texto”.

<figure><img src="/files/lA9MvdfdrD33dsHDGNHR" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
O mesmo para o campo "ID do contato” e depois clique em Salvar.

<figure><img src="/files/YR5lMJwajBQvwqbHEg6D" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Agora em “Manychat Data” selecione o campo que criamos para a resposta do Agente e salve

<figure><img src="/files/D6uyCkDco6bXyKTvFN7Y" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Clique em "Escolher Próximo Passo” e selecione Instagram .

<figure><img src="/files/evswB7LOtTgUCan7wP5D" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### No "bloco” da ação do <mark style="color:purple;">`Instagram`</mark> clique em **"Adicionar texto”.**

<figure><img src="/files/tGDrNEZfuvA92gNSlccT" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Selecione a resposta do agente do aplicativo <mark style="color:purple;">`Zaia`</mark>.

<figure><img src="/files/nt86dy7NZe2WwhTAFx81" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Parabéns, agora basta ativar o seu cenário e ele irá funcionar.

<figure><img src="/files/lCTVB5vStaiSYkEEWnj8" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# 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://zaiadocs.gitbook.io/recursos/agentes/integracoes-e-canais/manychat.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.
