Input: {"body":{"maxTokens":2000,"messages":[{"content":"You are summarizing a text. The text is split into 1 parts, and you are currently working on part 1.\nAt every step, you will receive the current summary and a new part of the text. You need to amend the summary to include the new information (if needed).\nThe summary needs to cover the main points of the text and must be concise.\n\nIMPORTANT INSTRUCTIONS:\n- At each step, you will receive a part of the text to summarize. Make sure to reply with the new summary in the tags ■START■ and ■END■.\n- Summarize the text and make sure that the main points are included.\n- Ignore any unnecessary details and focus on the main points.\n- Use short and concise sentences to increase readability and information density.\n- When looking at the new information, focus on: Extract the Table of Contents for the Botpress Documentation. Start with a short sentence explaining what Botpress is. Pay special attention to all the different features. Focus on horizontal coverage of features rather than going in depth into one feature. The goal is to have a complete overview of what the documentation covers.\n- The current summary is empty. You need to generate a summary that covers the main points of the text.\n- This is the last part you will have to summarize. Make sure the summary is complete and covers all the main points.\n- The current summary is 0 tokens long. You need to make sure it is 2000 tokens or less.\n\nFORMAT OF THE SUMMARY:\nA normal text with multiple sentences and paragraphs. Use markdown to format the text into sections. Use headings, lists, and other markdown features to make the text more readable. Do not include links, images, or other non-text elements.","role":"system"},{"content":"■START■\n<summary still empty>\n■END■\n\nPlease amend the summary between the ■START■ and ■END■ tags to accurately reflect the prompt and the additional text below.\n\n<|start_new_information|>\n)  \n   * [Viber](/docs/viber)  \n   * [Vonage](/docs/vonage)  \n   * [Webhook](/docs/webhook)  \n   * [WhatsApp](/docs/whatsapp)  \n         * [Manual Configuration](/docs/manual-configuration)  \n   * [Zapier](/docs/zapier)  \n   * [Zendesk](/docs/zendesk)\n* [Building](/docs/building-integrations)  \n   * [Getting Started](/docs/getting-started-1)  \n         * [Getting Started](/docs/getting-started-1)  \n         * [Adding Messaging Channel Capabilities](/docs/adding-messaging-channel-capabilities)  \n         * [Adding Actions & Triggers to Botpress Studio](/docs/adding-actions-triggers-to-botpress-studio)  \n         * [Publish your integration on Botpress Hub](/docs/publish-your-integration-on-botpress-hub)  \n   * [Use Your Own LLM](/docs/llm-interfaces)  \n   * [Connect a live agent platform with Botpress](/docs/hitl)  \n   * [Moving Parts](/docs/moving-parts)  \n   * [CLI](/docs/cli)  \n   * [SDK](/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)\n/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)  \n         * [Tags](/docs/tags)  \n         * [Channels](/docs/channels)  \n         * [Configuration](/docs/configuration)  \n         * [User](/docs/user)  \n         * [Conversations](/docs/conversations-1)  \n         * [Messages](/docs/messages)  \n         * [Event](/docs/event)  \n         * [States](/docs/states-1)  \n         * [Actions](/docs/actions)  \n         * [Definitions](/docs/definitions)  \n         * [Secrets](/docs/secrets)  \n         * [ZUI - Zod schema UI components in Botpress \\[BETA\\]](/docs/zui-zod-schema-ui-components-in-botpress)  \n   * [How to](/docs/states)  \n         * [States](/docs/states)  \n         * [Register & Unregister](/docs/register-unregister)  \n         * [Integrations Actions](/docs/integrations)  \n         * [Integration Events](/docs/integration-events)  \n         * [Handler](/docs/handler)  \n         * [Logging](/docs/logging)  \n         * [Building a Custom Integration](/docs/building-a-custom-integration)\n## Webchat\n* [Webchat](/docs/webchat)  \n   * [Webflow](/docs/webflow)  \n   * [Wix](/docs/wix)  \n   * [Wordpress](/docs/wordpress)\n* [Webchat v1 (deprecated)](/docs/web-chat-v1old)  \n   * [Controlling Web Chat using JavaScript](/docs/controlling-web-chat-using-javascript)  \n   * [Styling your webchat](/docs/chatbot-button)  \n         * [Chatbot Button](/docs/chatbot-button)  \n         * [Chat Header](/docs/chat-header)  \n         * [User Input Area](/docs/user-input-area)  \n         * [Show Bot Info](/docs/show-bot-info)  \n   * [Embedding Webchat](/docs/react-app)  \n         * [React App](/docs/react-app)  \n         * [React Native App](/docs/react-native-app)  \n         * [Web Chat Iframe](/docs/web-chat-iframe)  \n         * [Full Screen Chatbot](/docs/full-screen-chatbot)\n* [Webchat v2](/docs/embedded-webchat)  \n   * [Embedded Webchat](/docs/embedded-webchat)  \n         * [Custom CSS Reference](/docs/custom-css-reference)  \n   * [React Components](/docs/react-js)  \n   * [Webchat Client](/docs/webchat-client)\n## Botpress APIs\n* [Files API](/docs/files-api)\n* [Chat API](/docs/chat-api)\n## Appendix\n* [Safety](/docs/safety)  \n   * [Preventing Abuse](/docs/preventing-abuse)  \n   * [Brand Safety Framework](/docs/brand-safety-framework)\n* [Exporting Data](/docs/exporting-data)  \n   * [Raw Conversations](/docs/exporting-raw-conversations-with-the-botpress-api)  \n   * [Conversation History](/docs/getting-the-conversation-history-from-within-your-bot)  \n   * [Streaming Analytics](/docs/streaming-analytics-from-within-your-bot-with-hooks)  \n   * [Compiled Bot Analytics](/docs/exporting-compiled-bot-analytics-with-the-botpress-api)\nPowered by\n# Key Concepts\nOverview\n[ Suggest Edits](/edit/key-concepts)\nBotpress Integration Documentation\n[](#botpress-integration-documentation)\nThe Botpress SDK provides a structured way for developers to create new integrations for their chatbots. In this documentation, we're using the [Slack integration class](https://github.com/botpress/botpress/blob/master/integrations/slack/src/index.ts) as a reference to illustrate the process.\nKey Concepts\n[](#key-concepts)\n1\\. [Tags](./tags.md)\n[](#1-tags)\nThese identify users, conversations, and messages in the external system (e.g., Slack). Each tag is assigned a unique identifier.\n2\\. [Channels](./channels.md)\n[](#2-channels)\nDefine which channels the integration supports. Channels can be group conversations, direct messages, or others, depending on the external system.\n3\\. [Configuration](./configuration.md)\n[](#3-configuration)\nThis is where sensitive information, such as API keys and tokens, is stored. The configuration is used to validate the integration setup.\n4\\. [User](./user.md)\n[](#4-user)\nThis refers to the mapping between the external system and Botpress. It defines how users are identified and created in the bot system.\n5\\. [Conversation](./conversation.md)\n[](#5-conversation)\nThis refers to the dialogue happening between the external system, the user, and the bot. It holds the mapping between the conversation ID in the external system and the conversation ID in Botpress.\n6\\. [Messages](./messages.md)\n[](#6-messages)\nThese are payloads exchanged between the external system, the user, and the bot within a conversation. Messages contain information essential to map interactions between the systems and hold valuable data for the conversation designer.\n7\\. [States](./states.md)\n[](#7-states)\nThe state is responsible for associating data with a user, a conversation, or in a global context to store important information that needs to be tracked.\n8\\. [Actions](./actions.md)\n[](#8-actions)\nActions are tasks that the integration can perform. These could be sending a message, adding a reaction, or any other function that the external system supports.\n9\\. [Events](./events.md)\n[](#9-events)\nThese are non-conversational incidents that are triggered and captured by the system. For example, in Linear, an event could be when a new issue is created; in WhatsApp, it could be when someone opens the chat.\n10\\. [Definition](./definition.md)\n[](#10-definition)\nEverything within the integration needs to be defined before use. This is done in the IntegrationDefinition class.\n11\\. [Secrets](./secrets.md)\n[](#11-secrets)\nFinally, Botpress securely handles sensitive information like API keys or tokens in the **Secrets** field of the **IntegrationDefinition** class. This field defines and manages the secrets needed by the integration, keeping them secure from potential security breaches.\nUpdated 4 months ago\n---\n* [Table of Contents](#)\n* * [Botpress Integration Documentation](#botpress-integration-documentation)  \n   * [Key Concepts](#key-concepts)  \n         * [1\\. Tags](#1-tags)  \n         * [2\\. Channels](#2-channels)  \n         * [3\\. Configuration](#3-configuration)  \n         * [4\\. User](#4-user)  \n         * [5\\. Conversation](#5-conversation)  \n         * [6\\. Messages](#6-messages)  \n         * [7\\. States](#7-states)  \n         * [8\\. Actions](#8-actions)  \n         * [9\\. Events](#9-events)  \n         * [10\\. Definition](#10-definition)  \n         * [11\\. Secrets](#11-secrets)[Jump to Content](#content)\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\n---\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\nGuides\nMoon (Dark Mode)Sun (Light Mode)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\nInstagram\nSearch\n## Home\n* [Botpress Documentation](/docs/home)\n## Getting Started\n* [Build](/docs/build)\n* [Deploy](/docs/deploy)\n* [Monitor](/docs/monitor)\n## DASHBOARD\n* [Workspace](/docs/workspace)  \n   * [Home](/docs/home-1)  \n   * [Members](/docs/members)  \n   * [Audits](/docs/audits)  \n   * [Your integrations](/docs/your-integrations)  \n   * [Usage](/docs/usage-2)  \n   * [Settings](/docs/settings)  \n   * [Profile Setting](/docs/user-profile)\n* [Bot](/docs/bot)  \n   * [Overview](/docs/overview-1)  \n   * [Integrations](/docs/integrations-1)  \n   * [Webchat](/docs/webchat-1)  \n   * [Logs](/docs/logs)  \n   * [Conversations](/docs/conversations)  \n   * [Analytics](/docs/analytics-1)  \n   * [Events](/docs/events-2)  \n   * [Issues](/docs/issues)  \n   * [Configuration variables](/docs/configuration-variables-1)\n## STUDIO\n* [Interface](/docs/interface)  \n   * [Nodes](/docs/nodes)  \n   * [Home](/docs/home-2)  \n   * [Flows](/docs/studio-interface-flows)  \n   * [Knowledge Base](/docs/knowledge-base)  \n   * [Tables](/docs/tables)  \n   * [Agents](/docs/agents)  \n         * [Summary Agent](/docs/summary-agent)  \n         * [Personality Agent](/docs/personality-agent)  \n         * [Policy Agent](/docs/policy-agent)  \n         * [Translator Agent](/docs/translator-agent)  \n         * [Knowledge Agent](/docs/knowledge-agent)  \n         * [HITL Agent](/docs/hitl-agent)  \n         * [Vision Agent](/docs/vision-agent)  \n         * [Analytics Agent](/docs/analytics-agent)  \n   * [Library](/docs/library)  \n   * [Hooks](/docs/hooks)  \n   * [Integrations](/docs/integrations-3)  \n   * [Schemas](/docs/schemas)  \n   * [Card Hub](/docs/card-hub)  \n   * [Versions](/docs/versions-1)  \n   * [Chatbot Settings](/docs/chatbot-settings-1)  \n   * [Find](/docs/find)  \n   * [Variables](/docs/variables)  \n   * [Card Tray](/docs/card-tray)  \n   * [Debugger, Logs & JSON](/docs/debugger-logs-json)  \n   * [Emulator](/docs/emulator)  \n   * [Keyboard Shortcuts](/docs/keyboard-shortcuts)  \n   * [Commands](/docs/studio-commands)  \n   * [Studio Preferences](/docs/studio-preferences)  \n   * [Import & Export](/docs/import-export-bots)\n* [Cards](/docs/cards)  \n   * [Send Messages](/docs/send-messages)  \n   * [Execute](/docs/execute)  \n   * [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n        \n* [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n         * [AI Task](/docs/ai-task-1)  \n         * [AI Transition](/docs/ai-transition)  \n         * [AI Generate Text](/docs/ai-generate-text)  \n   * [Capture Information](/docs/capture-information)  \n   * [Events](/docs/events-3)  \n   * [Agents](/docs/agents-2)  \n   * [Utilities](/docs/utilities)\n## integrations\n* [Usage](/docs/using-integrations)  \n   * [Asana](/docs/asana-integration)  \n   * [HITL](/docs/hitl-1)  \n   * [Instagram](/docs/instagram)  \n   * [Intercom](/docs/intercom)  \n   * [Line](/docs/line)  \n   * [Messenger](/docs/messenger)  \n   * [Microsoft Teams](/docs/microsoft-teams)  \n   * [Notion](/docs/notion)  \n   * [Slack](/docs/slack)  \n   * [Sunshine Conversations](/docs/sunshine-conversations)  \n   * [Telegram](/docs/telegram)  \n   * [Trello](/docs/trello)  \n   * [Twilio](/docs/twilio)  \n   * [Viber](/docs/viber)  \n   * [Vonage](/docs/vonage)  \n   * [Webhook](/docs/webhook)  \n   * [WhatsApp](/docs/whatsapp)  \n         * [Manual Configuration](/docs/manual-configuration)  \n   * [Zapier](/docs/zapier)  \n   * [Zendesk](/docs/zendesk)\n* [Building](/docs/building-integrations)  \n   * [Getting Started](/docs/getting-started-1)  \n         * [Getting Started](/docs/getting-started-1)  \n         * [Adding Messaging Channel Capabilities](/docs/adding-messaging-channel-capabilities)  \n         * [Adding Actions & Triggers to Botpress Studio](/docs/adding-actions-triggers-to-botpress-studio)  \n         * [Publish your integration on Botpress Hub](/docs/publish-your-integration-on-botpress-hub)  \n   * [Use Your Own LLM](/docs/llm-interfaces)  \n   * [Connect a live agent platform with Botpress](/docs/hitl)  \n   * [Moving Parts](/docs/moving-parts)  \n   * [CLI](/docs/cli)  \n   * [SDK](/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)\n/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)  \n         * [Tags](/docs/tags)  \n         * [Channels](/docs/channels)  \n         * [Configuration](/docs/configuration)  \n         * [User](/docs/user)  \n         * [Conversations](/docs/conversations-1)  \n         * [Messages](/docs/messages)  \n         * [Event](/docs/event)  \n         * [States](/docs/states-1)  \n         * [Actions](/docs/actions)  \n         * [Definitions](/docs/definitions)  \n         * [Secrets](/docs/secrets)  \n         * [ZUI - Zod schema UI components in Botpress \\[BETA\\]](/docs/zui-zod-schema-ui-components-in-botpress)  \n   * [How to](/docs/states)  \n         * [States](/docs/states)  \n         * [Register & Unregister](/docs/register-unregister)  \n         * [Integrations Actions](/docs/integrations)  \n         * [Integration Events](/docs/integration-events)  \n         * [Handler](/docs/handler)  \n         * [Logging](/docs/logging)  \n         * [Building a Custom Integration](/docs/building-a-custom-integration)\n## Webchat\n* [Webchat](/docs/webchat)  \n   * [Webflow](/docs/webflow)  \n   * [Wix](/docs/wix)  \n   * [Wordpress](/docs/wordpress)\n* [Webchat v1 (deprecated)](/docs/web-chat-v1old)  \n   * [Controlling Web Chat using JavaScript](/docs/controlling-web-chat-using-javascript)  \n   * [Styling your webchat](/docs/chatbot-button)  \n         * [Chatbot Button](/docs/chatbot-button)  \n         * [Chat Header](/docs/chat-header)  \n         * [User Input Area](/docs/user-input-area)  \n         * [Show Bot Info](/docs/show-bot-info)  \n   * [Embedding Webchat](/docs/react-app)  \n         * [React App](/docs/react-app)  \n         * [React Native App](/docs/react-native-app)  \n         * [Web Chat Iframe](/docs/web-chat-iframe)  \n         * [Full Screen Chatbot](/docs/full-screen-chatbot)\n* [Webchat v2](/docs/embedded-webchat)  \n   * [Embedded Webchat](/docs/embedded-webchat)  \n         * [Custom CSS Reference](/docs/custom-css-reference)  \n   * [React Components](/docs/react-js)  \n   * [Webchat Client](/docs/webchat-client)\n## Botpress APIs\n* [Files API](/docs/files-api)\n* [Chat API](/docs/chat-api)\n## Appendix\n* [Safety](/docs/safety)  \n   * [Preventing Abuse](/docs/preventing-abuse)  \n   * [Brand Safety Framework](/docs/brand-safety-framework)\n* [Exporting Data](/docs/exporting-data)  \n   * [Raw Conversations](/docs/exporting-raw-conversations-with-the-botpress-api)  \n   * [Conversation History](/docs/getting-the-conversation-history-from-within-your-bot)  \n   * [Streaming Analytics](/docs/streaming-analytics-from-within-your-bot-with-hooks)  \n   * [Compiled Bot Analytics](/docs/exporting-compiled-bot-analytics-with-the-botpress-api)\nPowered by\n# Instagram\n[ Suggest Edits](/edit/instagram)\nPrerequisites\n[](#prerequisites)\n* A [Meta developer app](https://developers.facebook.com/apps) that will serve as the primary platform for managing connection between Instagram and Botpress, including the configuration of webhooks and access tokens.\n* A [Facebook page](https://www.facebook.com/pages/create) in which you have the administrator or developer roles. Instagram accounts must be linked to a Facebook page to use the Facebook Graph API.\n* An [Instagram Professional account](https://business.instagram.com/), necessary to use features specific to Instagram professional accounts.\nSetting up the Instagram integration in Botpress\n[](#setting-up-the-instagram-integration-in-botpress)\n1. Go to the [Integration Hub](https://app.botpress.cloud/hub) in Botpress Cloud (if you don't have the integration installed yet).\n2. Find and open the Instagram integration then click on the \"Install to Bot\" button, now go back to your bot settings.\nThe Instagram integration has the following settings:\n* **Enabled**: Whether Botpress will communicate with Instagram\n* **Webhook URL**: The URL for receiving data in Botpress\n* **App ID**: The ID of your Meta app\n* **App Secret**: The secret of your Meta app\n* **Verify Token**: The token used to verify the webhook requests\n* **Page ID**: The ID of your Facebook page\n* **Access Token**: The access token\nSetting up Instagram\n[](#setting-up-instagram)\nCreate a Facebook Page\n[](#create-a-facebook-page)\nIf you do not already have a Facebook page you will need to create one. You can find details on how to create a new Facebook page [here](https://www.facebook.com/pages/create/). To link your chatbot to a pre-existing page, you must have an administrator or developer role.\nCreate a Meta App\n[](#create-a-meta-app)\n1. Log in to your Facebook account and go to the [Facebook for Developers website](https://developers.facebook.com/).\n2. Select **My Apps** from the top menu, and create a new app.\n3. Select **Business** as App Type.\n4. Give a name to your App.\nAdd Messenger to your Meta App\n[](#add-messenger-to-your-meta-app)\nMessenger is the proxy for Instagram settings, and since is not added by default in your Meta app it must be added manually.\n1. In the left sidebar of your app dashboard, click on **Add Product**.\n2. Look for Messenger and click **Set Up**.\nAPI version\n[](#api-version)\nBotpress can interact with the version 15.0 or higher of the Instagram API. It is not the default version so it must be changed in your app's settings\n1. Go to your Meta app.\n2. In the left sidebar, expand the **Settings** menu and select **Advanced**.\n3. In the **Upgrade API version** section, select v15.0 or higher as the API version.\n4. Click on **Save Changes**.\nApp ID and Secret\n[](#app-id-and-secret)\n1. In the left sidebar, expand the **Settings** menu and select **Basic**. Here you can find the App ID and App Secret.\n2. Click on the **Show** button in the **App Secret** text box. Copy the App Id and App Secret to your channel configuration.\nPage ID and Access Token\n[](#page-id-and-access-token)\n1. In the left sidebar, expand the **Messenger** menu and select **Instagram Settings**\n2. In the **Access Tokens** section, click **Add or Remove Pages** and add your Facebook page.\n3. Copy the number under you page name and paste it in you **Page ID** channel configuration.\n4. Click on **Generate Token**. Copy this token and paste it in the **Access Token** channel configuration.\nVerify Token\n[](#verify-token)\nThe Verify Token is used by Meta to verify that you are the real owner of the provided webhook.\nYou can generate any random alphanumerical string for this configuration. Paste it in your **Verify Token** channel configuration.\nSave Configuration\n[](#save-configuration)\nChannel configuration is completed, you can now click **Save**. It is important to save your configuration in Botpress before updating the webhook in the Meta app settings, otherwise Meta will be unable to validate the webhook URL.\nWebhook Configuration\n[](#webhook-configuration)\nTo receive messages from Instagram in your Botpress bot, you will need to setup a webhook.\n1. Go to your Meta App.\n2. In the left sidebar, expand the **Messenger** menu and select **Instagram Settings**.\n3. In the **Webhooks** section, click **Add Callback URL**.\n4. Copy and paste the **Webhook URL** provided in the integration configuration page in Botpress.\n5. Copy and paste the **Verify Token** that you generated earlier in the integration configuration page in Botpress.\n6. Click on Verify and Save. Make sure your channel configuration was saved before doing this step, otherwise the webhook validation will fail.\n7. Now you will select subscriptions for your webhook. Click on **Add Subscriptions**, then select `instagram_manage_messages` (if app has been [reviewed by Meta](../docs/instagram#submit-your-app-for-meta-review)), `messages` and `messaging_postbacks`. Then click **Save**.\n**Note**: If you can't find the `instagram_manage_messages` subscription in the list above, that's because your app has not been reviewed by Meta yet (see [this section](../docs/instagram#submit-your-app-for-meta-review)). But don't worry, this is not mandatory to test your bot. You can still test it with the `messages` and `messaging_postbacks` subscriptions.\nThat's it, you may now start chatting with your bot on Instagram!\nSubmit your App for Meta Review\n[](#submit-your-app-for-meta-review)\nWhen your app is in Development Mode, your bot will work for admins, developers, and testers of the app only. After your app is approved and made public, it will work for the general public.\nRead more about the App Review process on [the official documentation](https://developers.facebook.com/docs/app-review/submission-guide) and find some help if necessary [in this Github issue](https://github.com/microsoft/botframework-sdk/issues/1465).\nYou can find some troubleshooting [in this documentation](https://developers.facebook.com/docs/app-review/support/rejection-guides/instagram) in case you app get rejected.\nUpdated 4 months ago\n---\n* [Table of Contents](#)\n* * [Prerequisites](#prerequisites)  \n   * [Setting up the Instagram integration in Botpress](#setting-up-the-instagram-integration-in-botpress)  \n   * [Setting up Instagram](#setting-up-instagram)  \n         * [Create a Facebook Page](#create-a-facebook-page)  \n         * [Create a Meta App](#create-a-meta-app)  \n         * [Add Messenger to your Meta App](#add-messenger-to-your-meta-app)  \n         * [API version](#api-version)  \n         * [App ID and Secret](#app-id-and-secret)  \n         * [Page ID and Access Token](#page-id-and-access-token)  \n         * [Verify Token](#verify-token)  \n         * [Save Configuration](#save-configuration)  \n   * [Webhook Configuration](#webhook-configuration)  \n   * [Submit your App for Meta Review](#submit-your-app-for-meta-review)[Jump to Content](#content)\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\n---\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\nGuides\nMoon (Dark Mode)Sun (Light Mode)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\nHooks\nSearch\n## Home\n* [Botpress Documentation](/docs/home)\n## Getting Started\n* [Build](/docs/build)\n* [Deploy](/docs/deploy)\n* [Monitor](/docs/monitor)\n## DASHBOARD\n* [Workspace](/docs/workspace)  \n   * [Home](/docs/home-1)  \n   * [Members](/docs/members)  \n   * [Audits](/docs/audits)  \n   * [Your integrations](/docs/your-integrations)  \n   * [Usage](/docs/usage-2)  \n   * [Settings](/docs/settings)  \n   * [Profile Setting](/docs/user-profile)\n* [Bot](/docs/bot)  \n   * [Overview](/docs/overview-1)  \n   * [Integrations](/docs/integrations-1)  \n   * [Webchat](/docs/webchat-1)  \n   * [Logs](/docs/logs)  \n   * [Conversations](/docs/conversations)  \n   * [Analytics](/docs/analytics-1)  \n   * [Events](/docs/events-2)  \n   * [Issues](/docs/issues)  \n   * [Configuration variables](/docs/configuration-variables-1)\n## STUDIO\n* [Interface](/docs/interface)  \n   * [Nodes](/docs/nodes)  \n   * [Home](/docs/home-2)  \n   * [Flows](/docs/studio-interface-flows)  \n   * [Knowledge Base](/docs/knowledge-base)  \n   * [Tables](/docs/tables)  \n   * [Agents](/docs/agents)  \n         * [Summary Agent](/docs/summary-agent)  \n         * [Personality Agent](/docs/personality-agent)  \n         * [Policy Agent](/docs/policy-agent)  \n         * [Translator Agent](/docs/translator-agent)  \n         * [Knowledge Agent](/docs/knowledge-agent)  \n         * [HITL Agent](/docs/hitl-agent)  \n         * [Vision Agent](/docs/vision-agent)  \n         * [Analytics Agent](/docs/analytics-agent)  \n   * [Library](/docs/library)  \n   * [Hooks](/docs/hooks)  \n   * [Integrations](/docs/integrations-3)  \n   * [Schemas](/docs/schemas)  \n   * [Card Hub](/docs/card-hub)  \n   * [Versions](/docs/versions-1)  \n   * [Chatbot Settings](/docs/chatbot-settings-1)  \n   * [Find](/docs/find)  \n   * [Variables](/docs/variables)  \n   * [Card Tray](/docs/card-tray)  \n   * [Debugger, Logs & JSON](/docs/debugger-logs-json)  \n   * [Emulator](/docs/emulator)  \n   * [Keyboard Shortcuts](/docs/keyboard-shortcuts)  \n   * [Commands](/docs/studio-commands)  \n   * [Studio Preferences](/docs/studio-preferences)  \n   * [Import & Export](/docs/import-export-bots)\n* [Cards](/docs/cards)  \n   * [Send Messages](/docs/send-messages)  \n   * [Execute](/docs/execute)  \n   * [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n        \n* [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n         * [AI Task](/docs/ai-task-1)  \n         * [AI Transition](/docs/ai-transition)  \n         * [AI Generate Text](/docs/ai-generate-text)  \n   * [Capture Information](/docs/capture-information)  \n   * [Events](/docs/events-3)  \n   * [Agents](/docs/agents-2)  \n   * [Utilities](/docs/utilities)\n## integrations\n* [Usage](/docs/using-integrations)  \n   * [Asana](/docs/asana-integration)  \n   * [HITL](/docs/hitl-1)  \n   * [Instagram](/docs/instagram)  \n   * [Intercom](/docs/intercom)  \n   * [Line](/docs/line)  \n   * [Messenger](/docs/messenger)  \n   * [Microsoft Teams](/docs/microsoft-teams)  \n   * [Notion](/docs/notion)  \n   * [Slack](/docs/slack)  \n   * [Sunshine Conversations](/docs/sunshine-conversations)  \n   * [Telegram](/docs/telegram)  \n   * [Trello](/docs/trello)  \n   * [Twilio](/docs/twilio)  \n   * [Viber](/docs/viber)  \n   * [Vonage](/docs/vonage)  \n   * [Webhook](/docs/webhook)  \n   * [WhatsApp](/docs/whatsapp)  \n         * [Manual Configuration](/docs/manual-configuration)  \n   * [Zapier](/docs/zapier)  \n   * [Zendesk](/docs/zendesk)\n* [Building](/docs/building-integrations)  \n   * [Getting Started](/docs/getting-started-1)  \n         * [Getting Started](/docs/getting-started-1)  \n         * [Adding Messaging Channel Capabilities](/docs/adding-messaging-channel-capabilities)  \n         * [Adding Actions & Triggers to Botpress Studio](/docs/adding-actions-triggers-to-botpress-studio)  \n         * [Publish your integration on Botpress Hub](/docs/publish-your-integration-on-botpress-hub)  \n   * [Use Your Own LLM](/docs/llm-interfaces)  \n   * [Connect a live agent platform with Botpress](/docs/hitl)  \n   * [Moving Parts](/docs/moving-parts)  \n   * [CLI](/docs/cli)  \n   * [SDK](/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)\n/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)  \n         * [Tags](/docs/tags)  \n         * [Channels](/docs/channels)  \n         * [Configuration](/docs/configuration)  \n         * [User](/docs/user)  \n         * [Conversations](/docs/conversations-1)  \n         * [Messages](/docs/messages)  \n         * [Event](/docs/event)  \n         * [States](/docs/states-1)  \n         * [Actions](/docs/actions)  \n         * [Definitions](/docs/definitions)  \n         * [Secrets](/docs/secrets)  \n         * [ZUI - Zod schema UI components in Botpress \\[BETA\\]](/docs/zui-zod-schema-ui-components-in-botpress)  \n   * [How to](/docs/states)  \n         * [States](/docs/states)  \n         * [Register & Unregister](/docs/register-unregister)  \n         * [Integrations Actions](/docs/integrations)  \n         * [Integration Events](/docs/integration-events)  \n         * [Handler](/docs/handler)  \n         * [Logging](/docs/logging)  \n         * [Building a Custom Integration](/docs/building-a-custom-integration)\n## Webchat\n* [Webchat](/docs/webchat)  \n   * [Webflow](/docs/webflow)  \n   * [Wix](/docs/wix)  \n   * [Wordpress](/docs/wordpress)\n* [Webchat v1 (deprecated)](/docs/web-chat-v1old)  \n   * [Controlling Web Chat using JavaScript](/docs/controlling-web-chat-using-javascript)  \n   * [Styling your webchat](/docs/chatbot-button)  \n         * [Chatbot Button](/docs/chatbot-button)  \n         * [Chat Header](/docs/chat-header)  \n         * [User Input Area](/docs/user-input-area)  \n         * [Show Bot Info](/docs/show-bot-info)  \n   * [Embedding Webchat](/docs/react-app)  \n         * [React App](/docs/react-app)  \n         * [React Native App](/docs/react-native-app)  \n         * [Web Chat Iframe](/docs/web-chat-iframe)  \n         * [Full Screen Chatbot](/docs/full-screen-chatbot)\n* [Webchat v2](/docs/embedded-webchat)  \n   * [Embedded Webchat](/docs/embedded-webchat)  \n         * [Custom CSS Reference](/docs/custom-css-reference)  \n   * [React Components](/docs/react-js)  \n   * [Webchat Client](/docs/webchat-client)\n## Botpress APIs\n* [Files API](/docs/files-api)\n* [Chat API](/docs/chat-api)\n## Appendix\n* [Safety](/docs/safety)  \n   * [Preventing Abuse](/docs/preventing-abuse)  \n   * [Brand Safety Framework](/docs/brand-safety-framework)\n* [Exporting Data](/docs/exporting-data)  \n   * [Raw Conversations](/docs/exporting-raw-conversations-with-the-botpress-api)  \n   * [Conversation History](/docs/getting-the-conversation-history-from-within-your-bot)  \n   * [Streaming Analytics](/docs/streaming-analytics-from-within-your-bot-with-hooks)  \n   * [Compiled Bot Analytics](/docs/exporting-compiled-bot-analytics-with-the-botpress-api)\nPowered by\n# Hooks\nCustomizable points that allow you to execute custom code in response to specific events.\n[ Suggest Edits](/edit/hooks)\nHooks in Botpress are powerful tools that enable you to customize the behaviour of your bot by executing custom code at specific points during its operation. Hooks allow you to intercept and modify messages, manage sessions, perform logging, integrate with external systems, and more. By leveraging hooks, you can fine-tune your bot's interactions and responses to meet your specific requirements.\nHooks can be customized similarly to the Execute Code cards and Validation fields.\nParameters\n[](#parameters)\nHooks are functions that take parameters. The parameters are different depending on the hook type. `event` is the most common parameter, and it is always available. The event object contains all the information about the event that triggered the hook.\nUsing Hooks\n[](#using-hooks)\nThe instances where you can inject hooks into your bot's flow are as follows:\nAfter Incoming Message\n[](#after-incoming-message)\nThis hook is called right after all incoming middleware have processed the event but before the Dialogue Engine starts processing it. You can access all the required data (including NLU intent) for special processing and decide what happens to the event.\nA typical operation here is to tell Botpress to ignore the event and not process it (e.g., not send it to the dialogue engine).\nBefore Incoming Message\n[](#before-incoming-message)\nBotpress calls this hook after receiving an event but before processing any middleware. It is possible to change event properties.\nBotpress often uses this hook to set flags to skip some processing, for example, to prevent the QnA from processing it when it's a quick reply.\nBefore Outgoing Middleware\n[](#before-outgoing-middleware)\nThe Dialogue Manager calls this hook before the bot's reply is sent to the user.\nHere you can save the bot's complete response.\nUpdated about 1 month ago\n---\n* [Table of Contents](#)\n* * [Parameters](#parameters)  \n   * [Using Hooks](#using-hooks)  \n         * [After Incoming Message](#after-incoming-message)  \n         * [Before Incoming Message](#before-incoming-message)  \n         * [Before Outgoing Middleware](#before-outgoing-middleware)[Jump to Content](#content)\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\n---\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\nGuides\nMoon (Dark Mode)Sun (Light Mode)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\nIntegrations\nSearch\n## Home\n* [Botpress Documentation](/docs/home)\n## Getting Started\n* [Build](/docs/build)\n* [Deploy](/docs/deploy)\n* [Monitor](/docs/monitor)\n## DASHBOARD\n* [Workspace](/docs/workspace)  \n   * [Home](/docs/home-1)  \n   * [Members](/docs/members)  \n   * [Audits](/docs/audits)  \n   * [Your integrations](/docs/your-integrations)  \n   * [Usage](/docs/usage-2)  \n   * [Settings](/docs/settings)  \n   * [Profile Setting](/docs/user-profile)\n* [Bot](/docs/bot)  \n   * [Overview](/docs/overview-1)  \n   * [Integrations](/docs/integrations-1)  \n   * [Webchat](/docs/webchat-1)  \n   * [Logs](/docs/logs)  \n   * [Conversations](/docs/conversations)  \n   * [Analytics](/docs/analytics-1)  \n   * [Events](/docs/events-2)  \n   * [Issues](/docs/issues)  \n   * [Configuration variables](/docs/configuration-variables-1)\n## STUDIO\n* [Interface](/docs/interface)  \n   * [Nodes](/docs/nodes)  \n   * [Home](/docs/home-2)  \n   * [Flows](/docs/studio-interface-flows)  \n   * [Knowledge Base](/docs/knowledge-base)  \n   * [Tables](/docs/tables)  \n   * [Agents](/docs/agents)  \n         * [Summary Agent](/docs/summary-agent)  \n         * [Personality Agent](/docs/personality-agent)  \n         * [Policy Agent](/docs/policy-agent)  \n         * [Translator Agent](/docs/translator-agent)  \n         * [Knowledge Agent](/docs/knowledge-agent)  \n         * [HITL Agent](/docs/hitl-agent)  \n         * [Vision Agent](/docs/vision-agent)  \n         * [Analytics Agent](/docs/analytics-agent)  \n   * [Library](/docs/library)  \n   * [Hooks](/docs/hooks)  \n   * [Integrations](/docs/integrations-3)  \n   * [Schemas](/docs/schemas)  \n   * [Card Hub](/docs/card-hub)  \n   * [Versions](/docs/versions-1)  \n   * [Chatbot Settings](/docs/chatbot-settings-1)  \n   * [Find](/docs/find)  \n   * [Variables](/docs/variables)  \n   * [Card Tray](/docs/card-tray)  \n   * [Debugger, Logs & JSON](/docs/debugger-logs-json)  \n   * [Emulator](/docs/emulator)  \n   * [Keyboard Shortcuts](/docs/keyboard-shortcuts)  \n   * [Commands](/docs/studio-commands)  \n   * [Studio Preferences](/docs/studio-preferences)  \n   * [Import & Export](/docs/import-export-bots)\n* [Cards](/docs/cards)  \n   * [Send Messages](/docs/send-messages)  \n   * [Execute](/docs/execute)  \n   * [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n        \n* [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n         * [AI Task](/docs/ai-task-1)  \n         * [AI Transition](/docs/ai-transition)  \n         * [AI Generate Text](/docs/ai-generate-text)  \n   * [Capture Information](/docs/capture-information)  \n   * [Events](/docs/events-3)  \n   * [Agents](/docs/agents-2)  \n   * [Utilities](/docs/utilities)\n## integrations\n* [Usage](/docs/using-integrations)  \n   * [Asana](/docs/asana-integration)  \n   * [HITL](/docs/hitl-1)  \n   * [Instagram](/docs/instagram)  \n   * [Intercom](/docs/intercom)  \n   * [Line](/docs/line)  \n   * [Messenger](/docs/messenger)  \n   * [Microsoft Teams](/docs/microsoft-teams)  \n   * [Notion](/docs/notion)  \n   * [Slack](/docs/slack)  \n   * [Sunshine Conversations](/docs/sunshine-conversations)  \n   * [Telegram](/docs/telegram)  \n   * [Trello](/docs/trello)  \n   * [Twilio](/docs/twilio)  \n   * [Viber](/docs/viber)  \n   * [Vonage](/docs/vonage)  \n   * [Webhook](/docs/webhook)  \n   * [WhatsApp](/docs/whatsapp)  \n         * [Manual Configuration](/docs/manual-configuration)  \n   * [Zapier](/docs/zapier)  \n   * [Zendesk](/docs/zendesk)\n* [Building](/docs/building-integrations)  \n   * [Getting Started](/docs/getting-started-1)  \n         * [Getting Started](/docs/getting-started-1)  \n         * [Adding Messaging Channel Capabilities](/docs/adding-messaging-channel-capabilities)  \n         * [Adding Actions & Triggers to Botpress Studio](/docs/adding-actions-triggers-to-botpress-studio)  \n         * [Publish your integration on Botpress Hub](/docs/publish-your-integration-on-botpress-hub)  \n   * [Use Your Own LLM](/docs/llm-interfaces)  \n   * [Connect a live agent platform with Botpress](/docs/hitl)  \n   * [Moving Parts](/docs/moving-parts)  \n   * [CLI](/docs/cli)  \n   * [SDK](/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)\n/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)  \n         * [Tags](/docs/tags)  \n         * [Channels](/docs/channels)  \n         * [Configuration](/docs/configuration)  \n         * [User](/docs/user)  \n         * [Conversations](/docs/conversations-1)  \n         * [Messages](/docs/messages)  \n         * [Event](/docs/event)  \n         * [States](/docs/states-1)  \n         * [Actions](/docs/actions)  \n         * [Definitions](/docs/definitions)  \n         * [Secrets](/docs/secrets)  \n         * [ZUI - Zod schema UI components in Botpress \\[BETA\\]](/docs/zui-zod-schema-ui-components-in-botpress)  \n   * [How to](/docs/states)  \n         * [States](/docs/states)  \n         * [Register & Unregister](/docs/register-unregister)  \n         * [Integrations Actions](/docs/integrations)  \n         * [Integration Events](/docs/integration-events)  \n         * [Handler](/docs/handler)  \n         * [Logging](/docs/logging)  \n         * [Building a Custom Integration](/docs/building-a-custom-integration)\n## Webchat\n* [Webchat](/docs/webchat)  \n   * [Webflow](/docs/webflow)  \n   * [Wix](/docs/wix)  \n   * [Wordpress](/docs/wordpress)\n* [Webchat v1 (deprecated)](/docs/web-chat-v1old)  \n   * [Controlling Web Chat using JavaScript](/docs/controlling-web-chat-using-javascript)  \n   * [Styling your webchat](/docs/chatbot-button)  \n         * [Chatbot Button](/docs/chatbot-button)  \n         * [Chat Header](/docs/chat-header)  \n         * [User Input Area](/docs/user-input-area)  \n         * [Show Bot Info](/docs/show-bot-info)  \n   * [Embedding Webchat](/docs/react-app)  \n         * [React App](/docs/react-app)  \n         * [React Native App](/docs/react-native-app)  \n         * [Web Chat Iframe](/docs/web-chat-iframe)  \n         * [Full Screen Chatbot](/docs/full-screen-chatbot)\n* [Webchat v2](/docs/embedded-webchat)  \n   * [Embedded Webchat](/docs/embedded-webchat)  \n         * [Custom CSS Reference](/docs/custom-css-reference)  \n   * [React Components](/docs/react-js)  \n   * [Webchat Client](/docs/webchat-client)\n## Botpress APIs\n* [Files API](/docs/files-api)\n* [Chat API](/docs/chat-api)\n## Appendix\n* [Safety](/docs/safety)  \n   * [Preventing Abuse](/docs/preventing-abuse)  \n   * [Brand Safety Framework](/docs/brand-safety-framework)\n* [Exporting Data](/docs/exporting-data)  \n   * [Raw Conversations](/docs/exporting-raw-conversations-with-the-botpress-api)  \n   * [Conversation History](/docs/getting-the-conversation-history-from-within-your-bot)  \n   * [Streaming Analytics](/docs/streaming-analytics-from-within-your-bot-with-hooks)  \n   * [Compiled Bot Analytics](/docs/exporting-compiled-bot-analytics-with-the-botpress-api)\nPowered by\n# Integrations\nDisplays integrations currently installed on your bot.\n[ Suggest Edits](/edit/integrations-1)\nThis tab lists integrations that are currently installed on your bot.\nFrom this menu, you can uninstall existing integrations, or navigate to the Botpress Hub to search for new ones.\n> ## ���\n>\n> Configure integrations from the Studio\n>\n> Integration configuration has been moved to the Studio.\n>\n> To set up integrations you've installed, or to install new integrations, you can navigate to the integrations menu found directly in the Studio.\nUpdated about 1 month ago\n---[Jump to Content](#content)\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\n---\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\nGuides\nMoon (Dark Mode)Sun (Light Mode)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\nConnect a live agent platform with Botpress\nSearch\n## Home\n* [Botpress Documentation](/docs/home)\n## Getting Started\n* [Build](/docs/build)\n* [Deploy](/docs/deploy)\n* [Monitor](/docs/monitor)\n## DASHBOARD\n* [Workspace](/docs/workspace)  \n   * [Home](/docs/home-1)  \n   * [Members](/docs/members)  \n   * [Audits](/docs/audits)  \n   * [Your integrations](/docs/your-integrations)  \n   * [Usage](/docs/usage-2)  \n   * [Settings](/docs/settings)  \n   * [Profile Setting](/docs/user-profile)\n* [Bot](/docs/bot)  \n   * [Overview](/docs/overview-1)  \n   * [Integrations](/docs/integrations-1)  \n   * [Webchat](/docs/webchat-1)  \n   * [Logs](/docs/logs)  \n   * [Conversations](/docs/conversations)  \n   * [Analytics](/docs/analytics-1)  \n   * [Events](/docs/events-2)  \n   * [Issues](/docs/issues)  \n   * [Configuration variables](/docs/configuration-variables-1)\n## STUDIO\n* [Interface](/docs/interface)  \n   * [Nodes](/docs/nodes)  \n   * [Home](/docs/home-2)  \n   * [Flows](/docs/studio-interface-flows)  \n   * [Knowledge Base](/docs/knowledge-base)  \n   * [Tables](/docs/tables)  \n   * [Agents](/docs/agents)  \n         * [Summary Agent](/docs/summary-agent)  \n         * [Personality Agent](/docs/personality-agent)  \n         * [Policy Agent](/docs/policy-agent)  \n         * [Translator Agent](/docs/translator-agent)  \n         * [Knowledge Agent](/docs/knowledge-agent)  \n         * [HITL Agent](/docs/hitl-agent)  \n         * [Vision Agent](/docs/vision-agent)  \n         * [Analytics Agent](/docs/analytics-agent)  \n   * [Library](/docs/library)  \n   * [Hooks](/docs/hooks)  \n   * [Integrations](/docs/integrations-3)  \n   * [Schemas](/docs/schemas)  \n   * [Card Hub](/docs/card-hub)  \n   * [Versions](/docs/versions-1)  \n   * [Chatbot Settings](/docs/chatbot-settings-1)  \n   * [Find](/docs/find)  \n   * [Variables](/docs/variables)  \n   * [Card Tray](/docs/card-tray)  \n   * [Debugger, Logs & JSON](/docs/debugger-logs-json)  \n   * [Emulator](/docs/emulator)  \n   * [Keyboard Shortcuts](/docs/keyboard-shortcuts)  \n   * [Commands](/docs/studio-commands)  \n   * [Studio Preferences](/docs/studio-preferences)  \n   * [Import & Export](/docs/import-export-bots)\n* [Cards](/docs/cards)  \n   * [Send Messages](/docs/send-messages)  \n   * [Execute](/docs/execute)  \n   * [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n        \n* [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n         * [AI Task](/docs/ai-task-1)  \n         * [AI Transition](/docs/ai-transition)  \n         * [AI Generate Text](/docs/ai-generate-text)  \n   * [Capture Information](/docs/capture-information)  \n   * [Events](/docs/events-3)  \n   * [Agents](/docs/agents-2)  \n   * [Utilities](/docs/utilities)\n## integrations\n* [Usage](/docs/using-integrations)  \n   * [Asana](/docs/asana-integration)  \n   * [HITL](/docs/hitl-1)  \n   * [Instagram](/docs/instagram)  \n   * [Intercom](/docs/intercom)  \n   * [Line](/docs/line)  \n   * [Messenger](/docs/messenger)  \n   * [Microsoft Teams](/docs/microsoft-teams)  \n   * [Notion](/docs/notion)  \n   * [Slack](/docs/slack)  \n   * [Sunshine Conversations](/docs/sunshine-conversations)  \n   * [Telegram](/docs/telegram)  \n   * [Trello](/docs/trello)  \n   * [Twilio](/docs/twilio)  \n   * [Viber](/docs/viber)  \n   * [Vonage](/docs/vonage)  \n   * [Webhook](/docs/webhook)  \n   * [WhatsApp](/docs/whatsapp)  \n         * [Manual Configuration](/docs/manual-configuration)  \n   * [Zapier](/docs/zapier)  \n   * [Zendesk](/docs/zendesk)\n* [Building](/docs/building-integrations)  \n   * [Getting Started](/docs/getting-started-1)  \n         * [Getting Started](/docs/getting-started-1)  \n         * [Adding Messaging Channel Capabilities](/docs/adding-messaging-channel-capabilities)  \n         * [Adding Actions & Triggers to Botpress Studio](/docs/adding-actions-triggers-to-botpress-studio)  \n         * [Publish your integration on Botpress Hub](/docs/publish-your-integration-on-botpress-hub)  \n   * [Use Your Own LLM](/docs/llm-interfaces)  \n   * [Connect a live agent platform with Botpress](/docs/hitl)  \n   * [Moving Parts](/docs/moving-parts)  \n   * [CLI](/docs/cli)  \n   * [SDK](/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)\n/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)  \n         * [Tags](/docs/tags)  \n         * [Channels](/docs/channels)  \n         * [Configuration](/docs/configuration)  \n         * [User](/docs/user)  \n         * [Conversations](/docs/conversations-1)  \n         * [Messages](/docs/messages)  \n         * [Event](/docs/event)  \n         * [States](/docs/states-1)  \n         * [Actions](/docs/actions)  \n         * [Definitions](/docs/definitions)  \n         * [Secrets](/docs/secrets)  \n         * [ZUI - Zod schema UI components in Botpress \\[BETA\\]](/docs/zui-zod-schema-ui-components-in-botpress)  \n   * [How to](/docs/states)  \n         * [States](/docs/states)  \n         * [Register & Unregister](/docs/register-unregister)  \n         * [Integrations Actions](/docs/integrations)  \n         * [Integration Events](/docs/integration-events)  \n         * [Handler](/docs/handler)  \n         * [Logging](/docs/logging)  \n         * [Building a Custom Integration](/docs/building-a-custom-integration)\n## Webchat\n* [Webchat](/docs/webchat)  \n   * [Webflow](/docs/webflow)  \n   * [Wix](/docs/wix)  \n   * [Wordpress](/docs/wordpress)\n* [Webchat v1 (deprecated)](/docs/web-chat-v1old)  \n   * [Controlling Web Chat using JavaScript](/docs/controlling-web-chat-using-javascript)  \n   * [Styling your webchat](/docs/chatbot-button)  \n         * [Chatbot Button](/docs/chatbot-button)  \n         * [Chat Header](/docs/chat-header)  \n         * [User Input Area](/docs/user-input-area)  \n         * [Show Bot Info](/docs/show-bot-info)  \n   * [Embedding Webchat](/docs/react-app)  \n         * [React App](/docs/react-app)  \n         * [React Native App](/docs/react-native-app)  \n         * [Web Chat Iframe](/docs/web-chat-iframe)  \n         * [Full Screen Chatbot](/docs/full-screen-chatbot)\n* [Webchat v2](/docs/embedded-webchat)  \n   * [Embedded Webchat](/docs/embedded-webchat)  \n         * [Custom CSS Reference](/docs/custom-css-reference)  \n   * [React Components](/docs/react-js)  \n   * [Webchat Client](/docs/webchat-client)\n## Botpress APIs\n* [Files API](/docs/files-api)\n* [Chat API](/docs/chat-api)\n## Appendix\n* [Safety](/docs/safety)  \n   * [Preventing Abuse](/docs/preventing-abuse)  \n   * [Brand Safety Framework](/docs/brand-safety-framework)\n* [Exporting Data](/docs/exporting-data)  \n   * [Raw Conversations](/docs/exporting-raw-conversations-with-the-botpress-api)  \n   * [Conversation History](/docs/getting-the-conversation-history-from-within-your-bot)  \n   * [Streaming Analytics](/docs/streaming-analytics-from-within-your-bot-with-hooks)  \n   * [Compiled Bot Analytics](/docs/exporting-compiled-bot-analytics-with-the-botpress-api)\nPowered by\n# Connect a live agent platform with Botpress\n[ Suggest Edits](/edit/hitl)\nThis documentation will guide you through setting up and implementing a Human-In-The-Loop (HITL) integration with Botpress. By following these steps, you'll be able to connect your platform to Botpress, enabling seamless interaction between your end-users and live agents.\nHow HITL Works in Botpress\n[](#how-hitl-works-in-botpress)\nIn Botpress, the Human-In-The-Loop (HITL) functionality is powered by the HITL Agent. This agent consumes integrations that correctly implement the HITL interface, turning agent hand-off on and off.\n![](https://files.readme.io/a11417252c75c4771500955f4b4e6faff70b921c56efb9e292128189c2a57928-Screenshot_2024-09-16_at_10.45.05_AM.png)\nHere is an overview of the HITL workflow in Botpress:\n* **When a conversation is escalated to a live agent:**\n1. A user is created on both Botpress and the third-party live chat platform. The link between the two users can be done on both sides, but we recommend doing it on Botpress's end using user [tags](#tags).\n2. A conversation is initiated on Botpress, and a corresponding ticket is created on the agent handoff platform. The link between the two conversations can be done on both sides, but we recommend doing it on Botpress's end using conversation [tags](#tags).\n* **When the end user sends a message to a live agent:** The message is forwarded to the agent handoff platform through the \"hitl\" channel.\n* **When the live agent sends a message to the end user:** The agent handoff platform calls the integration webhook, which then forwards the message to the end user.\nThis guide will teach you how to make your integration compatible with the HITL agent.\nConfiguring the Integration Definition\n[](#configuring-the-integration-definition)\nAfter completing the steps in our [Quickstart Guide](https://botpress.com/docs/getting-started-1), the next step is to enhance your integration definition to support HITL.\nThe following code snippet accomplishes the following:\n1. Extends the HITL interface, making this integration compatible with HITL in Botpress.\n2. Adds a HITL channel, which will be used to route messages between the end user and the live agent.\n3. Enhances conversation and user tags with additional information, ensuring proper matching of users and conversations between Botpress and your platform.\nintegration.definition.ts\n`import { z, IntegrationDefinition, interfaces } from \"@botpress/sdk\";\nexport default new IntegrationDefinition({\nname: \"My HITL Integration\",\nversion: \"0.0.1\",\nreadme: \"hub.md\",\nicon: \"icon.svg\",\nchannels: {\nhitl: {\ntitle: \"My HITL\",\nmessages: {},\nconversation: {\ntags: {\nticketId: {\n// This is the ticket ID from your platform. It ensures that conversations are correctly matched between Botpress and your platform.\ntitle: \"Ticket ID\",\n},\nadditionalData: {\ntitle: \"You can pass additional data in the tags object.\",\n},\n},\n},\n},\n},\nactions: {},\nuser: {\ntags: {\n// This is the user ID from the live agent platform. It ensures that users are correctly matched between Botpress and live agent platform.\nagentHandoffPlatformUserId: {\ntitle: \"Live Agent Platform User ID\",\n},\n},\n},\n// Extend the HITL interface to implement HITL in your integration.\n}).extend(interfaces.hitl, () => ({}));\n`\nTags\n[](#tags)\nTags in this integration are customizable fields that can store any information relevant to a conversation or user. You can think of them as metadata. These tags are crucial for maintaining context and linking data between Botpress and your platform. While the examples provided focus on using IDs to match conversations and users, you can customize the tags to include any additional data that suits your needs.\nImplementing the HITL Logic\n[](#implementing-the-hitl-logic)\nNow, let’s walk through the process of implementing the integration step by step. Start by adding the following code to `index.ts` to initialize the integration:\nindex.ts\n`import * as sdk from \"@botpress/sdk\";\nimport * as bp from \".botpress\";\nexport default new bp.Integration({});\n`\n1\\. Add Register & Unregister Methods\n[](#1-add-register--unregister-methods)\nThese methods are part of the integration's lifecycle.\n* **register:** This method is executed every time the integration configuration is saved. We use it to set a webhook that will be triggered when a live agent sends a message. If you manually set the webhook on the third-party platform, this step can be skipped.\n* **unregister:** This method is executed when the integration is uninstalled. We use it to remove the Botpress webhook from the third-party platform. If the webhook was set manually, this step can be skipped.\nindex.ts\n`import * as sdk from \"@botpress/sdk\";\nimport * as bp from \".botpress\";\nimport AgentHandoffPlatformClient from \"./agent-handoff-client\"\nexport default new bp.Integration({\nregister: async ({ webhookUrl }) => {\n// Set the webhook to be triggered when a live agent responds\nAgentHandoffPlatformClient.setWebhook(webhookUrl);\n},\nunregister: async ({ webhookUrl }) => {\n// Remove the webhook when the integration is uninstalled\nAgentHandoffPlatformClient.deleteWebhook(webhookUrl);\n}\n});\n`\nThe webhookUrl provided in the parameters points is unique to an bot integration installation. It's refreshed when an integration is installed/re-installed. There are three webhooks that you should implement in the handler method: handling agent messages, assign a conversation to an agent, and stopping HITL. If you can set up webhooks programmatically, this is the right place to do it.\n2\\. Implement Actions\n[](#2-implement-actions)\nWhen extending the HITL interface, you need to implement a set of predefined methods, similar to how you implement methods when working with interfaces in TypeScript. Once these methods are correctly implemented, the integration can be used by the HITL Agent. These actions are automatically called by the HITL Agent and do not need to be triggered manually. You can rely on IntelliSense to guide you on the exact parameters provided to each action.\nHere are the actions you need to implement:\n* **createUser:** Creates a user in both Botpress and the third-party platform and maps them together. Then, the action returns the user ID of the created Botpress user. The mapping between the two users can be done on both sides, but we recommend doing it on Botpress's end using conversation [tags](#tags).\n* **startHitl:** Creates a conversation in Botpress and a corresponding conversation (often called a ticket) on the third-party platform and maps them together. This action must return the ID of the created Botpress conversation. The mapping between the two conversations can be done on both sides, but we recommend doing it on Botpress's end using conversation [tags](#tags).\n* **stopHitl:** Deletes a conversation on the third-party platform.\nHere’s how you can implement these actions:\nindex.ts\n`// import a library to interact with the agent handoff platform\nimport AgentHandoffPlatformClient from \"./agent-handoff-client\"\nexport default new bp.Integration({\n//...\n// Previously added code\nactions: {\n//...\n// create a user in both platforms\ncreateUser: async ({ client: botpressClient }) => {\n// Create a user on the agent handoff platform\nconst userOnAgentPlatform = AgentHandoffPlatformClient.createUser();\n// Create a user on Botpress\nconst { user: botpressUser } = await botpressClient.getOrCreateUser({\ntags: {\n// Link the Botpress user with the user on the agent handoff platform\nagentHandoffPlatformUserId: userOnAgentPlatform.id,\n},\n});\nreturn {\nuserId: botpressUser.id, // always return the newly created botpress user id\n};\n},\n// create a conversation in both platforms\nstartHitl: async ({ client: botpressClient, input }) => {\nconst { user } = await botpressClient.getUser({\n// Retrieve the user ID created in the createUser action\nid: input.userId,\n});\n// These properties are provided from the \"Escalate to a Human\" action in the Studio\nconst { title, description } = input;\n// Create a ticket on the agent handoff platform\nconst ticket = AgentHandoffPlatformClient.createTicket({\nticketTitle: title,\nticketDescription: description,\n});\n// Create a conversation in Botpress\nconst { conversation } = await botpressClient.getOrCreateConversation({\nchannel: \"hitl\",\ntags: {\n// Link the ticket with the Botpress conversation\nticketId: ticket.id,\n},\n});\nreturn {\nconversationId: conversation.id, // always return the newly created botpress conversation id\n};\n},\n// close the conversation in the agent handoff platform\nstopHitl: async ({ client: botpressClient, input }) => {\nconst { conversation } = await botpressClient.getConversation({\nid: input.conversationId,\n});\nconst ticketId = conversation.tags.ticketId;\n// Close the ticket on the agent handoff platform\nAgentHandoffPlatformClient.closeTicket({ ticketId });\nreturn {};\n},\n//...\n},\n});\n`\n3\\. Send Messages from End User to Live Agent\n[](#3-send-messages-from-end-user-to-live-agent)\nTo enable communication between the end user and the live agent, you'll need to add a special HITL channel that interacts with the third-party API.\nJavaScript\n`// index.ts\n//...\nexport default new bp.Integration({\n// Previously implemented code\nchannels: {\nhitl: {\nmessages: {\n// Send a message from the end user to the live agent\ntext: async ({ client, conversation,  ...props }: bp.AnyMessageProps) => {\nconst { text: userMessage } = props.payload;\nconst externalUserId = payload.userId ? (await client.getUser({ id: payload.userId })).tags.externalId : \"BOT\";\n// Retrieve the ticket ID that was set in the startHitl action\nconst ticketId = conversation.tags.ticketId;\n// Use the agent handoff platform's API to send the message\nAgentHandoffPlatformClient.sendMessage(ticketId, externalUserId, userMessage);\n},\n//...  you can add more message types if you want to support them\n},\n},\n},\n});\n`\nWe suggest starting with the text message type and adding more as needed.\n> ## ���\n>\n> Watch out!\n>\n> `payload.userId` is the user id of the chat-user as seen from the HITL conversation. `user.id` is the id of the bot. If you want the agent to know who he's talking to, you must use `payload.userId`.\n4\\. Send Messages from Live Agent to End User\n[](#4-send-messages-from-live-agent-to-end-user)\nWhen a live agent responds, the live-agent platform needs to send a request to the integration's webhook URL. Upon receiving this request, a special **handler** method is triggered. Let's implement this method to forward the message to the end user.\nindex.ts\n`// ...\nexport default new bp.Integration({\n// ...previously implemented logic\nhandler: async ({ req, client: botpressClient, ctx, logger }) => {\nconst liveAgentEvent = JSON.parse(req.body);\n// Fetch the Botpress user based on the user ID from the third-party platform\nconst { user } = await botpressClient.getOrCreateUser({\ntags: {\nagentHandoffPlatformUserId: liveAgentEvent.userId,\n},\n});\n// Fetch a conversation in Botpress associated with the ticket ID\nconst { conversation } = await botpressClient.getOrCreateConversation({\nchannel: 'hitl',\ntags: {\nticketId: liveAgentEvent.ticketId,\n},\n});\nswitch (liveAgentEvent.eventType) {\ncase 'newMessage':\n// Send the received message from the live agent to the end user\nawait botpressClient.createMessage({\ntype: 'text',\nuserId: user.id,\nconversationId: conversation.id,\npayload: { text: liveAgentEvent.message },\n});\nbreak;\n}\n},\n});\n`\nIn the above example, we don't check the route, or method, but we can do that with the `req` parameter of the handler, which returns an express.js-like request object. You can add `if` conditions to route different actions you'd like, such as assigning agents, or releasing the user back to the bot.\n> ## ���\n>\n> Why do I keep seeing getOrCreate?\n>\n> We don't actually want to create users or conversations at this point. Its simply a matter of the `get` methods not supporting finding by tags, while the `getOrCreate` methods do.\n5\\. Inform Bot When HITL Started and Stopped\n[](#5-inform-bot-when-hitl-started-and-stopped)\nWe need to emit two events to inform the bot about the status of the Human-In-The-Loop (HITL) process:\n**hitlAssigned**: Tells the bot that the conversation has been successfully escalated to a live agent.\n**hitlStopped**: Tells the bot that the conversation with the live agent has ended.\nindex.ts\n`// index.ts\n// ...\nexport default new bp.Integration({\n// ...previously implemented logic\nhandler: async ({ req, client: botpressClient, ctx, logger }) => {\nconst liveAgentEvent = JSON.parse(req.body);\nswitch (liveAgentEvent.eventType) {\ncase 'newMessage':\n// ...\nbreak;\ncase 'ticketAssigned':\n// Emit an event to inform the bot that HITL has been assigned\nawait botpressClient.createEvent({\ntype: 'hitlAssigned',\npayload: {\nconversationId: conversation.id,\nuserId: user.id,\n},\n});\nbreak;\ncase 'ticketSolved':\n// Emit an event to inform the bot that HITL has been stopped\nawait botpressClient.createEvent({\ntype: 'hitlStopped',\npayload: {\nconversationId: conversation.id,\n},\n});\nbreak;\n}\n},\n});\n`\nFull Example\n[](#full-example)\n`// index.ts\nimport * as sdk from \"@botpress/sdk\";\nimport * as bp from \".botpress\";\n// Replace with your actual platform client library\nimport AgentHandoffPlatformClient from \"./agent-handoff-client\";\n// Initialize the integration\nexport default new bp.Integration({\n// Register method to set the webhook when configuration is saved\nregister: async ({ webhookUrl }) => {\n// Set the webhook to be triggered when a live agent responds\nAgentHandoffPlatformClient.setWebhook(webhookUrl);\n},\n// Unregister method to remove the webhook when integration is uninstalled\nunregister: async ({ webhookUrl }) => {\n// Remove the webhook when the integration is uninstalled\nAgentHandoffPlatformClient.deleteWebhook(webhookUrl);\n},\n// Define the HITL actions\nactions: {\n// Create a user on both Botpress and the agent handoff platform\ncreateUser: async ({ client: botpressClient }) => {\n// Create a user on the agent handoff platform\nconst userOnAgentPlatform = AgentHandoffPlatformClient.createUser();\n// Create a user on Botpress\nconst { user: botpressUser } = await botpressClient.getOrCreateUser({\ntags: {\n// Link the Botpress user with the user on the agent handoff platform\nagentHandoffPlatformUserId: userOnAgentPlatform.id,\n},\n});\nreturn {\nuserId: botpressUser.id,\n};\n},\n// Start a HITL session by creating a conversation on both platforms\nstartHitl: async ({ client: botpressClient, input }) => {\nconst { user } = await botpressClient.getUser({\n// Retrieve the user ID created in the createUser action\nid: input.userId,\n});\n// These properties are provided from the \"Escalate to a Human\" action in the Studio\nconst { title, description } = input;\n// Create a ticket on the agent handoff platform\nconst ticket = AgentHandoffPlatformClient.createTicket({\nticketTitle: title,\nticketDescription: description,\n});\n// Create a conversation in Botpress\nconst { conversation } = await botpressClient.getOrCreateConversation({\nchannel: \"hitl\",\ntags: {\n// Link the ticket with the Botpress conversation\nticketId: ticket.id,\n},\n});\nreturn {\nconversationId: conversation.id,\n};\n},\n// Stop a HITL session by closing the conversation on the agent handoff platform\nstopHitl: async ({ client: botpressClient, input }) => {\nconst { conversation } = await botpressClient.getConversation({\nid: input.conversationId,\n});\nconst ticketId = conversation.tags.ticketId;\n// Close the ticket on the agent handoff platform\nAgentHandoffPlatformClient.closeTicket({ ticketId });\nreturn {};\n},\n},\n// Define the HITL channel to send messages from the end user to the live agent\nchannels: {\nhitl: {\nmessages: {\n// Send a message from the end user to the live agent\ntext: async ({ client, payload }) => {\nconst { text: userMessage, conversation, userId } = payload;\n// Retrieve the ticket ID that was set in the startHitl action\nconst ticketId = conversation.tags.ticketId;\n// Use the agent handoff platform's API to send the message\nAgentHandoffPlatformClient.sendMessage(ticketId, userId, userMessage);\n},\n},\n},\n},\n// Handler to process messages sent from the live agent to the end user\nhandler: async ({ req, client: botpressClient }) => {\nconst liveAgentEvent = JSON.parse(req.body);\n// Fetch the Botpress user based on the user ID from the agent handoff platform\nconst { user } = await botpressClient.getOrCreateUser({\ntags: {\nagentHandoffPlatformUserId: liveAgentEvent.userId,\n},\n});\n// Retrieve or create a conversation in Botpress associated with the ticket ID\nconst { conversation } = await botpressClient.getOrCreateConversation({\nchannel: \"hitl\",\ntags: {\nticketId: liveAgentEvent.ticketId,\n},\n});\nswitch (liveAgentEvent.eventType) {\ncase \"newMessage\":\n// Send the received message from the live agent to the end user\nawait botpressClient.createMessage({\ntype: \"text\",\nuserId: user.id,\nconversationId: conversation.id,\npayload: { text: liveAgentEvent.message },\n});\nbreak;\ncase \"ticketAssigned\":\n// Emit an event to inform the bot that HITL has been assigned\nawait botpressClient.createEvent({\ntype: \"hitlAssigned\",\npayload: {\nconversationId: conversation.id,\nuserId: user.id,\n},\n});\nbreak;\ncase \"ticketSolved\":\n// Emit an event to inform the bot that HITL has been stopped\nawait botpressClient.createEvent({\ntype: \"hitlStopped\",\npayload: {\nconversationId: conversation.id,\n},\n});\nbreak;\n}\n},\n});\n`\nProduction Example\n[](#production-example)\nFor a production-grade implementation, you can refer to the Zendesk integration maintained by the Botpress team. Check it out [here](https://github.com/botpress/botpress/tree/master/integrations/zendesk).\nHaving difficulties with HITL Interfaces?\n[](#having-difficulties-with-hitl-interfaces)\nContact us at [\\[email protected\\]](/cdn-cgi/l/email-protection#2941405d4504414c4559694b465d595b4c5a5a074a4644) with as much details as possible about your company and your use case.\nUpdated 17 days ago\n---\n* [Table of Contents](#)\n* * [How HITL Works in Botpress](#how-hitl-works-in-botpress)  \n   * [Configuring the Integration Definition](#configuring-the-integration-definition)  \n         * [Tags](#tags)  \n   * [Implementing the HITL Logic](#implementing-the-hitl-logic)  \n         * [1\\. Add Register & Unregister Methods](#1-add-register--unregister-methods)  \n         * [2\\. Implement Actions](#2-implement-actions)  \n         * [3\\. Send Messages from End User to Live Agent](#3-send-messages-from-end-user-to-live-agent)  \n         * [4\\. Send Messages from Live Agent to End User](#4-send-messages-from-live-agent-to-end-user)  \n         * [5\\. Inform Bot When HITL Started and Stopped](#5-inform-bot-when-hitl-started-and-stopped)  \n   * [Full Example](#full-example)  \n   * [Production Example](#production-example)  \n   * [Having difficulties with HITL Interfaces?](#having-difficulties-with-hitl-interfaces)[Jump to Content](#content)\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\n---\n[![Botpress](https://files.readme.io/c8cb63b6d586cd66085b4c960570959a424c7050c5ffeb0aeaf31711e2e1b2ac-small-BPLOGO_new_dark_1.png)](https://botpress.com)\nGuides\nMoon (Dark Mode)Sun (Light Mode)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\nRaw Conversations\nSearch\n## Home\n* [Botpress Documentation](/docs/home)\n## Getting Started\n* [Build](/docs/build)\n* [Deploy](/docs/deploy)\n* [Monitor](/docs/monitor)\n## DASHBOARD\n* [Workspace](/docs/workspace)  \n   * [Home](/docs/home-1)  \n   * [Members](/docs/members)  \n   * [Audits](/docs/audits)  \n   * [Your integrations](/docs/your-integrations)  \n   * [Usage](/docs/usage-2)  \n   * [Settings](/docs/settings)  \n   * [Profile Setting](/docs/user-profile)\n* [Bot](/docs/bot)  \n   * [Overview](/docs/overview-1)  \n   * [Integrations](/docs/integrations-1)  \n   * [Webchat](/docs/webchat-1)  \n   * [Logs](/docs/logs)  \n   * [Conversations](/docs/conversations)  \n   * [Analytics](/docs/analytics-1)  \n   * [Events](/docs/events-2)  \n   * [Issues](/docs/issues)  \n   * [Configuration variables](/docs/configuration-variables-1)\n## STUDIO\n* [Interface](/docs/interface)  \n   * [Nodes](/docs/nodes)  \n   * [Home](/docs/home-2)  \n   * [Flows](/docs/studio-interface-flows)  \n   * [Knowledge Base](/docs/knowledge-base)  \n   * [Tables](/docs/tables)  \n   * [Agents](/docs/agents)  \n         * [Summary Agent](/docs/summary-agent)  \n         * [Personality Agent](/docs/personality-agent)  \n         * [Policy Agent](/docs/policy-agent)  \n         * [Translator Agent](/docs/translator-agent)  \n         * [Knowledge Agent](/docs/knowledge-agent)  \n         * [HITL Agent](/docs/hitl-agent)  \n         * [Vision Agent](/docs/vision-agent)  \n         * [Analytics Agent](/docs/analytics-agent)  \n   * [Library](/docs/library)  \n   * [Hooks](/docs/hooks)  \n   * [Integrations](/docs/integrations-3)  \n   * [Schemas](/docs/schemas)  \n   * [Card Hub](/docs/card-hub)  \n   * [Versions](/docs/versions-1)  \n   * [Chatbot Settings](/docs/chatbot-settings-1)  \n   * [Find](/docs/find)  \n   * [Variables](/docs/variables)  \n   * [Card Tray](/docs/card-tray)  \n   * [Debugger, Logs & JSON](/docs/debugger-logs-json)  \n   * [Emulator](/docs/emulator)  \n   * [Keyboard Shortcuts](/docs/keyboard-shortcuts)  \n   * [Commands](/docs/studio-commands)  \n   * [Studio Preferences](/docs/studio-preferences)  \n   * [Import & Export](/docs/import-export-bots)\n* [Cards](/docs/cards)  \n   * [Send Messages](/docs/send-messages)  \n   * [Execute](/docs/execute)  \n   * [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n        \n* [Webchat](/docs/webchat-2)  \n   * [Flow Logic](/docs/flow-logic)  \n   * [AI](/docs/ai)  \n         * [AI Task](/docs/ai-task-1)  \n         * [AI Transition](/docs/ai-transition)  \n         * [AI Generate Text](/docs/ai-generate-text)  \n   * [Capture Information](/docs/capture-information)  \n   * [Events](/docs/events-3)  \n   * [Agents](/docs/agents-2)  \n   * [Utilities](/docs/utilities)\n## integrations\n* [Usage](/docs/using-integrations)  \n   * [Asana](/docs/asana-integration)  \n   * [HITL](/docs/hitl-1)  \n   * [Instagram](/docs/instagram)  \n   * [Intercom](/docs/intercom)  \n   * [Line](/docs/line)  \n   * [Messenger](/docs/messenger)  \n   * [Microsoft Teams](/docs/microsoft-teams)  \n   * [Notion](/docs/notion)  \n   * [Slack](/docs/slack)  \n   * [Sunshine Conversations](/docs/sunshine-conversations)  \n   * [Telegram](/docs/telegram)  \n   * [Trello](/docs/trello)  \n   * [Twilio](/docs/twilio)  \n   * [Viber](/docs/viber)  \n   * [Vonage](/docs/vonage)  \n   * [Webhook](/docs/webhook)  \n   * [WhatsApp](/docs/whatsapp)  \n         * [Manual Configuration](/docs/manual-configuration)  \n   * [Zapier](/docs/zapier)  \n   * [Zendesk](/docs/zendesk)\n* [Building](/docs/building-integrations)  \n   * [Getting Started](/docs/getting-started-1)  \n         * [Getting Started](/docs/getting-started-1)  \n         * [Adding Messaging Channel Capabilities](/docs/adding-messaging-channel-capabilities)  \n         * [Adding Actions & Triggers to Botpress Studio](/docs/adding-actions-triggers-to-botpress-studio)  \n         * [Publish your integration on Botpress Hub](/docs/publish-your-integration-on-botpress-hub)  \n   * [Use Your Own LLM](/docs/llm-interfaces)  \n   * [Connect a live agent platform with Botpress](/docs/hitl)  \n   * [Moving Parts](/docs/moving-parts)  \n   * [CLI](/docs/cli)  \n   * [SDK](/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)\n/docs/sdk)  \n   * [Key Concepts](/docs/key-concepts)  \n         * [Architecture](/docs/architecture)  \n         * [Tags](/docs/tags)  \n         * [Channels](/docs/channels)  \n         * [Configuration](/docs/configuration)  \n         * [User](/docs/user)  \n         * [Conversations](/docs/conversations-1)  \n         * [Messages](/docs/messages)  \n         * [Event](/docs/event)  \n         * [States](/docs/states-1)  \n         * [Actions](/docs/actions)  \n         * [Definitions](/docs/definitions)  \n         * [Secrets](/docs/secrets)  \n         * [ZUI - Zod schema UI components in Botpress \\[BETA\\]](/docs/zui-zod-schema-ui-components-in-botpress)  \n   * [How to](/docs/states)  \n         * [States](/docs/states)  \n         * [Register & Unregister](/docs/register-unregister)  \n         * [Integrations Actions](/docs/integrations)  \n         * [Integration Events](/docs/integration-events)  \n         * [Handler](/docs/handler)  \n         * [Logging](/docs/logging)  \n         * [Building a Custom Integration](/docs/building-a-custom-integration)\n## Webchat\n* [Webchat](/docs/webchat)  \n   * [Webflow](/docs/webflow)  \n   * [Wix](/docs/wix)  \n   * [Wordpress](/docs/wordpress)\n* [Webchat v1 (deprecated)](/docs/web-chat-v1old)  \n   * [Controlling Web Chat using JavaScript](/docs/controlling-web-chat-using-javascript)  \n   * [Styling your webchat](/docs/chatbot-button)  \n         * [Chatbot Button](/docs/chatbot-button)  \n         * [Chat Header](/docs/chat-header)  \n         * [User Input Area](/docs/user-input-area)  \n         * [Show Bot Info](/docs/show-bot-info)  \n   * [Embedding Webchat](/docs/react-app)  \n         * [React App](/docs/react-app)  \n         * [React Native App](/docs/react-native-app)  \n         * [Web Chat Iframe](/docs/web-chat-iframe)  \n         * [Full Screen Chatbot](/docs/full-screen-chatbot)\n* [Webchat v2](/docs/embedded-webchat)  \n   * [Embedded Webchat](/docs/embedded-webchat)  \n         * [Custom CSS Reference](/docs/custom-css-reference)  \n   * [React Components](/docs/react-js)  \n   * [Webchat Client](/docs/webchat-client)\n## Botpress APIs\n* [Files API](/docs/files-api)\n* [Chat API](/docs/chat-api)\n## Appendix\n* [Safety](/docs/safety)  \n   * [Preventing Abuse](/docs/preventing-abuse)  \n   * [Brand Safety Framework](/docs/brand-safety-framework)\n* [Exporting Data](/docs/exporting-data)  \n   * [Raw Conversations](/docs/exporting-raw-conversations-with-the-botpress-api)  \n   * [Conversation History](/docs/getting-the-conversation-history-from-within-your-bot)  \n   * [Streaming Analytics](/docs/streaming-analytics-from-within-your-bot-with-hooks)  \n   * [Compiled Bot Analytics](/docs/exporting-compiled-bot-analytics-with-the-botpress-api)\nPowered by\n\n<|new_information|>","role":"user","type":"text"}],"meta":{"integrationName":"zai","promptCategory":"zai:summarize","promptSource":"zai:summarize:default"},"model":"fast","signal":{},"stopSequences":["■END■"]},"method":"POST","url":"https://api.botpress.cloud/v2/cognitive/generate-text"}

Output:
**Botpress – Overview**
Botpress is an open‑source platform for creating, deploying, and managing AI‑powered chatbots. Its documentation is organized as a comprehensive table of contents that spans integrations, development tools, runtime features, and operational guidance.

---

## 📚 Table of Contents (High‑Level)

### 1. Getting Started
- **Build**, **Deploy**, **Monitor** – core workflow for new bots.

### 2. Dashboard & Workspace
- Workspace → Home, Members, Audits, Your integrations, Usage, Settings, Profile.
- Bot → Overview, Integrations, Webchat, Logs, Conversations, Analytics, Events, Issues, Configuration variables.

### 3. Studio (Bot Design)
- Interface → Nodes, Home, Flows, Knowledge Base, Tables, Agents (Summary, Personality, Policy, Translator, Knowledge, HITL, Vision, Analytics).
- Library, Hooks, Integrations, Schemas, Card Hub, Versions, Chatbot Settings, Find, Variables, Card Tray, Debugger & Logs, Emulator, Keyboard shortcuts, Commands, Preferences, Import & Export.

### 4. Integrations

#### 4.1 Usage (Pre‑built connectors)
- **Messaging / Channels**: Asana, HITL, Instagram, Intercom, Line, Messenger, Microsoft Teams, Notion, Slack, Sunshine Conversations, Telegram, Trello, Twilio, Viber, Vonage, Webhook, WhatsApp (manual config), Zapier, Zendesk.

#### 4.2 Building Integrations
- **Getting Started** – install, add messaging capabilities, add actions & triggers, publish on Botpress Hub.
- **Custom LLM Interfaces** – connect your own language model.
- **Human‑In‑The‑Loop (HITL)** – integrate live‑agent platforms.
- **Moving Parts** – architecture overview.
- **CLI** – command‑line utilities.
- **SDK** – development kit for new integrations.
- **Key Concepts** – Architecture, Tags, Channels, Configuration, User, Conversations, Messages, Events, States, Actions, Definitions, Secrets, ZUI (beta).
- **How‑to** – States management, Register & Unregister, Integration actions/events, Handlers, Logging, Building a custom integration.

### 5. Key Concepts (Core data model)
| Concept | Purpose |
|--------|---------|
| **Tags** | Identify users, conversations, messages across external systems. |
| **Channels** | Define supported communication mediums (e.g., Slack, WhatsApp). |
| **Configuration** | Store sensitive settings (API keys, tokens). |
| **User** | Mapping between external identities and Botpress users. |
| **Conversation** | Bridge external conversation IDs with Botpress IDs. |
| **Messages** | Payloads exchanged; contain routing & content data. |
| **States** | Persist data per user, conversation, or globally. |
| **Actions** | Operations the integration can perform (send message, add reaction, etc.). |
| **Events** | Non‑conversational triggers (e.g., new issue, chat opened). |
| **Definition** | Blueprint of an integration (class `IntegrationDefinition`). |
| **Secrets** | Secure storage for credentials. |
| **ZUI** | Beta UI components for Zod schema editing. |

### 6. Webchat

#### 6.1 Webchat (Current) – v2
- **Embedded Webchat** – CSS reference, React components, Webchat client.

#### 6.2 Webchat v1 (Deprecated)
- Controlling via JavaScript, styling (Chatbot button, header, input area, bot info).
- Embedding options: React app, React Native, iframe, full‑screen chatbot.

### 7. Botpress APIs
- **Files API** – manage bot assets.
- **Chat API** – programmatic interaction with bots.

### 8. Appendix

#### 8.1 Safety
- Preventing abuse, Brand Safety Framework.

#### 8.2 Exporting Data
- Raw conversations, conversation history, streaming analytics, compiled bot analytics.

---

## 🔧 Sample Feature Highlights

### Instagram Integration (Setup)
1. Create a Meta app & Facebook page.
2. Add Messenger product, set API version ≥ 15.0.
3. Fill Botpress channel config (App ID/Secret, Page ID, Access Token, Verify Token, Webhook URL).
4. Configure webhook in Meta app and subscribe to `instagram_manage_messages`, `messages`, `messaging_postbacks`.

### Human‑In‑The‑Loop (HITL) Flow
- **Tags** map Botpress users ↔ live‑agent platform users and conversations ↔ tickets.
- **Integration definition** extends `interfaces.hitl`, adds a `hitl` channel, and custom tags.
- **Lifecycle methods**: `register` (set webhook), `unregister` (remove webhook).
- **Actions**: `createUser`, `startHitl`, `stopHitl`.
- **Message handling**: user → agent (via `hitl` channel `text` handler) and agent → user (via webhook `handler`).
- **Events**: `hitlAssigned`, `hitlStopped` emitted to inform the bot of escalation status.

---

### 📌 Quick Reference

- **Integrations menu** – manage installed connectors; all configuration now lives in Studio.
- **SDK** – start with the Slack integration example to learn the integration class pattern.
- **Hooks** – customizable points (after incoming, before incoming, before outgoing) for logging, NLU tweaks, or external calls.

---

**Bottom line:** The Botpress documentation is structured to give you a complete, horizontally‑spanning view of every major capability—from core concepts and UI (Studio, Webchat) to integrations, custom development (SDK, CLI, Hooks), APIs, and operational topics (Safety, Data export). Use the table of contents as a roadmap to dive into any area without getting lost in depth‑first details.