Input: {"body":{"messages":[{"content":"Extract the following information from the input:\n{ \n/** The name of the feature */\nfeature?: string\n; \n/** The parent feature */\nparent?: string | null\n; \n/** The description of the feature */\ndescription?: string\n }\n====\n\n• Extract all things that looks like a Botpress feature in the provided input. You must extract a minimum of one element.\n• You may have multiple elements, or zero elements in the input.\n• You must extract each element separately.\n• Each element must be a JSON object with exactly the format: ■json_start■{ \"feature\": ..., \"parent\": ..., \"description\": ... }■json_end■\n• If there are no elements to extract, respond with ■ZERO_ELEMENTS■.\n• When you are done extracting all elements, type \"■NO_MORE_ELEMENT■\" to finish.\n• For example, if you have zero elements, the output should look like this: ■ZERO_ELEMENTS■■NO_MORE_ELEMENT■\n• For example, if you have two elements, the output should look like this: ■json_start■{ ... }■json_end■■json_start■{ ... }■json_end■■NO_MORE_ELEMENT■\n• You may ignore any fields that are not present in the input. All keys are optional.","role":"system"},{"content":"Here's an example to help you understand the format:\n\n<|start_schema|>\nArray<{ name: string, age: number }>\n<|end_schema|>\n\n<|start_instructions|>\nExtract all people\n<|end_instructions|>\n\n<|start_input|>\nThe story goes as follow.\nOnce upon a time, there was a person named Alice who was 30 years old.\nThen, there was a person named Bob who was 25 years old.\nThe end.\n<|end_input|>","role":"user","type":"text"},{"content":"■json_start■\n{\n  \"name\": \"Alice\",\n  \"age\": 30\n}\n■json_end■\n■json_start■\n{\n  \"name\": \"Bob\",\n  \"age\": 25\n}\n■json_end■■NO_MORE_ELEMENT■","role":"assistant","type":"text"},{"content":"Here's an example to help you understand the format:\n\n<|start_schema|>\n{ \n/** The name of the feature */\nfeature?: string\n; \n/** The parent feature */\nparent?: string | null\n; \n/** The description of the feature */\ndescription?: string\n }\n<|end_schema|>\n\n<|start_instructions|>\nExtract all things that looks like a Botpress feature in the provided input. You must extract a minimum of one element.\n<|end_instructions|>\n\n<|start_input|>\nSun (Light Mode)\n[Guides](/docs)[API Reference](/reference)[Changelog](/changelog)\nSDK\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# SDK\n[ Suggest Edits](/edit/sdk)\nInstallation\n[](#installation)\nThe SDK is an npm package that can be installed with the following command:\n`npm install @botpress/sdk # for npm\nyarn add @botpress/sdk # for yarn\npnpm add @botpress/sdk # for pnpm\n`\nChatbot Development\n[](#chatbot-development)\nThe first step in developing a Bot with the SDK is to instantiate the Bot class as follows:\nts\n`import { Bot } from \"@botpress/sdk\";\nconst bot = new Bot();\nexport default bot;\n`\nThis is the minimal functional code that can be executed by Botpress as a Bot. It does absolutely nothing.\nTo add behavior to the Bot, you can register a message handler as follows:\nts\n`` bot.message(\"\", async ({ message, client, ctx }) => {\nconsole.info(\"Received message\", message);\nlet responseText: string;\nif (message.payload.text === \"/ping\") {\nresponseText = \"Pong !\";\n} else if (message.payload.text === \"/order_pizza\") {\nawait orderPizza();\nresponseText = \"Pizza successfully ordered\";\n} else {\nresponseText = `Unknown command: ${message.payload.text} ...`;\n}\nawait client.createMessage({\nconversationId: message.conversationId,\nuserId: ctx.botId,\ntags: {},\ntype: \"text\",\npayload: {\ntext: responseText,\n},\n} satisfies CreateMessageBody<\"text\">);\nconsole.info(\"text message sent\");\n});\n``\nThis handler will be called every time the Bot receives a message. It will then check the content of the message and send a response accordingly.\nThe Bot's constructor is what we call its definition. It contains information such as the Bot's configuration or the type of events the Bot can receive. The message handler, on the other hand, is part of the Bot's implementation. The Bot's definition restricts its implementation and influences intellisense during development.\nThe Bot's definition is described by the following fields:\n* `tags`\nThis field is used to specify the Tags used by the **Bot**.\n**Tags** are strings that allow to filter messages, conversations or users when querying the API.\n* `states`\nThis field is used to specify the **States** used by the **Bot**.\n**States** are used to persist data in between a **Bot**'s invocations.\nA **State** can be attached to a conversation, a user or can be global to the **Bot**.\n**States** have a schema, meaning that only the data that matches the schema can be persisted and retrieved.\n* `integrations`\nThis field is used to specify the **Integrations** installed in the **Bot**.\n**Integrations** are used to connect a **Bot** to external services.\nDisabled **Integrations** are not used by the **_Bot_**. They can however be enabled later in the [CDM](https://app.Botpress.cloud) or through the [API](https://botpress.com/docs/api/).\nSetting an **Integration** in the **Bot**'s definition does two things:\n* it allows the **Integration** to call your **Bot** with events and messages.  \n   * it allows your **Bot** to call the **Integration** with actions.\n* `configuration`\nThis field is used to specify the schema of the **Configuration** provided to the **Bot** when it's called.\nThe actual **Configuration** is provided by the user when deploying the **Bot**.\n* `events`\nThis field is used to specify the schema of the **Events** that can be sent to the **Bot** by **Integrations**.\n**Events** are just like messages, only they have a more general purpose, a custom schema and a wider use case.\n* `recurringEvents`\nThis field is used to specify **Recurring Events**.\n**Recurring Events** are events that are sent to the **Bot** following a certain cron schedule.\nHere's an example of a more complete Bot's definition:\nts\n`` const bot = new Bot({\nintegrations: [\n{\nenabled: true,\nid: `${YOUR_INTEGRATION_ID}`,\nconfiguration: YOUR_INTEGRATION_CONFIGURATION,\n},\n],\nconfiguration: {\nschema: {\nbotName: z.string(),\n},\n},\nstates: {\nprofile: {\ntype: \"user\",\nschema: {\nuserName: z.string(),\n},\nexpiry: 1000 * 60 * 60, // 1 hour\n},\n},\ntags: {\nusers: [\"inventoryAdmin\"], // will allow to target users with the tag \"inventoryAdmin\"\n},\nevents: {\nscheduledEvent: {\nschema: {},\n},\n},\nrecurringEvents: {\ncrawlInventory: {\ntype: \"scheduledEvent\",\npayload: {},\nschedule: {\ncron: \"*/5 * * * *\", // crawl and sync inventory every 5 minutes\n},\n},\n},\n});\n``\nIn addition to the message handler, a Bot can also implement an event handler and an expired state handler as follows:\nts\n`bot.event(\"scheduledEvent\", async ({ event, client, ctx }) => {\nlog.info(\"Received event\", event);\n});\nbot.stateExpired(\"profile\", async ({ state, client, ctx }) => {\nlog.info(\"State expired\", state);\n});\n`\nIntegration Development\n[](#integration-development)\nIntegrations are developped in a similar fashion to Bots. The only difference is that there is 2 classes to instantiate: `IntegrationDefinition` and `Integration` wich stands for the Integration's implementation.\nThis means that a typical Integration's code would require at least 2 files. Here's an example:\nts\n`` // integration.definition.ts\nimport { IntegrationDefinition } from \"@botpress/sdk\";\nexport default new IntegrationDefinition({\nname: \"myintegration\",\nversion: \"0.1.0\",\n});\n// integration.ts\nimport { Integration } from \"@botpress/sdk\";\nexport default new Integration({\nchannels: {},\nactions: {},\nregister: async ({ ctx }) => {\nconsole.info(`integration installed in bot ${ctx.botId}`);\n},\nunregister: async ({ ctx }) => {\nconsole.info(`integration uninstalled from bot ${ctx.botId}`);\n},\nhandler: async ({ req }) => {\nconsole.info(\"received request from external service\", req);\n},\n});\n``\nThe implementation code is actually the one that must be transpiled and bundled to run in Botpress Cloud, but the definition contains fields that are required when creating the Integration with the API. The reason why the definition and the implementation are separated might be obscure for now, but it will become clearer when introducing the CLI and the `generate` command.\nHere's an example of a more complete Integration's definition with a proper implementation:\nts\n`` // integration.definition.ts\nimport * as sdk from \"@botpress/sdk\";\nimport { z } from \"zod\";\nexport default new sdk.IntegrationDefinition({\nname: \"myintegration\",\nversion: \"0.1.0\",\npublic: true,\nconfiguration: {\nschema: z.object({\nappId: z.string(),\nappSecret: z.string(),\n}),\n},\nchannels: {\nchannel: {\nmessages: {\ntext: sdk.messages.defaults.text,\nimage: sdk.messages.defaults.image,\n},\ntags: {\nmessages: [\"id\"],\nconversations: [\"id\"],\n},\n},\n},\ntags: {\nusers: [\"id\"],\n},\nactions: {\nfetchInventory: {\ninput: {\nschema: z.object({\nitemId: z.string(),\n}),\n},\noutput: {\nschema: z.object({\nname: z.string(),\nprice: z.number(),\n}),\n},\n},\n},\nevents: {},\nstates: {},\n});\n// integration.ts\nimport * as sdk from \"@botpress/sdk\";\nimport { ExternalService } from \"@externalservice/client\";\nexport default new sdk.Integration({\nregister: async () => {},\nunregister: async () => {},\nactions: {\nfetchInventory: async (props) => {\nconst { appId; appSecret } = props.ctx.configuration;\nconst client = new ExternalService(appId, appSecret);\nconst inventory = await client.fetchInventory(props.input.itemId);\nreturn {\nname: inventory.name,\nprice: inventory.price,\n};\n},\n},\nchannels: {\nchannel: {\nmessages: {\ntext: async (props) => {\nconst { appId; appSecret } = props.ctx.configuration;\nconst client = new ExternalService(appId, appSecret);\nconst convId = props.conversation.tags[\"myintegration:id\"]\nawait client.sendMessage(convId, { text: props.payload.text });\n},\nimage: async (props) => {\nconst { appId; appSecret } = props.ctx.configuration;\nconst client = new ExternalService(appId, appSecret);\nconst convId = props.conversation.tags[\"myintegration:id\"]\nawait client.sendImage(convId, { imageUrl: props.payload.imageUrl });\n},\n},\n},\n},\nhandler: async ({ req, client }) => {\nif (!req.body) {\nlog.warn(\"Handler received an empty body\");\nreturn;\n}\nconst activity: Activity = JSON.parse(req.body);\nlog.info(`Handler received event of type ${activity.type}`);\nif (!activity.id) {\nreturn;\n}\nconst convRef: Partial<ConversationReference> =\nTurnContext.getConversationReference(activity);\nswitch (activity.type) {\ncase \"message\":\nconst { conversation } = await client.getOrCreateConversation({\nchannel: \"channel\",\ntags: {\n[`${name}:id`]: activity.conversation.id,\n},\n});\nconst { user } = await client.getOrCreateUser({\ntags: {\n[`${name}:id`]: activity.from.id,\n},\n});\nawait client.createMessage({\ntags: { [`${name}:id`]: activity.id },\ntype: \"text\",\nuserId: user.id,\nconversationId: conversation.id,\npayload: { text: activity.text },\n});\nbreak;\ndefault:\nreturn;\n}\n},\n});\n``\nThe Integration's definition is described by the following fields:\n* `name`\nThe name of the Integration. It must be unique accross all Integrations.\n* `version`\nThe version of the Integration. It must be unique accross all versions of the same Integration.\nCurrently, only the version `0.2.0` is allowed for public Integrations and `0.0.1` for private Integrations. This is a temporary limitation that will be lifted in a near future.\n* `public`\nWhether the Integration is public or not. A public Integration can be installed by any Bot, while a private Integration can only be installed by Bots in the same workspace.\n* `title`\nDisplay name of the Integration.\n* `description`\nA description of the Integration.\n* `icon`\nPath to an SVG file containing the Integration's icon. This path can either be absolute or relative to the Integration's working directory.\n* `readme`\nPath to a Markdown file containing the Integration's documentation. This path can either be absolute or relative to the Integration's working directory.\n* `tags`\nA list of tags that can be used to filter users when querying the API.\n* `configuration`\nThe configuration schema of the Integration. The actual configuration is provided by the bot when installing the Integration.\n* `events`\nA map of events that can be emitted by the Integration. Events can be used to trigger handlers in the Bot.\n* `actions`\nA map of actions that can be called by the Bot. Actions can be used to trigger handlers in the Integration. Actions are defined by their input and output schemas.\n* `channels`\nA map of communication channels that can be used by the Bot send a message to the external service. Channels are defined by their messages types. The SDK provides a set of default messages types that can be used to send text, images, videos, etc.\n* `states`\nJust like for Bots, Integrations can define states that can be used to store data. States are defined by their schema.\n* `user`\nAllows the Integration to proactively create a user. This is usefull if the Integration needs to send a message to a user that has not yet interacted with the Bot.\nThe Integration's implementation must implement handlers for the defition's actions and channels as well as a handler for the external service's requests. The first two handlers are called by the Bot when an action or a message is triggered. The last handler is called by the external service when an event is triggered.\nUpdated 4 months ago\n---\n* [Table of Contents](#)\n* * [Installation](#installation)  \n         * [Chatbot Development](#chatbot-development)  \n         * [Integration Development](#integration-development)[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)\nNotion\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# Notion\n[ Suggest Edits](/edit/notion)\n![](https://files.readme.io/5295aaf-image.png)\nThe Notion Integration with Botpress enables seamless integration to boost productivity, allowing interactions such as commenting on discussions or pages and database manipulations right from your Botpress bot.\nEnhance your workflows and experience a streamlined interaction between Botpress and Notion.\nPrerequisites\n[](#prerequisites)\n* A [Notion Account](https://www.notion.so/signup) and a [Notion Workspace](https://www.notion.so/onboarding)\n* A [Botpress Cloud account](https://sso.botpress.cloud) and a [Botpress Bot](https://botpress.com/docs/cloud/getting-started/create-and-publish-your-chatbot/)\nSetting up the Notion integration in Botpress\n[](#setting-up-the-notion-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 Notion integration then click on the \"Install to Bot\" button, now go back to your bot settings.\nThe Notion integration has the following settings:\n* **Enabled**: Whether Botpress will communicate with Telegram\n* **Webhook URL**: The URL for receiving data in Botpress\n* **Auth Token**: The token for authenticating requests from Notion\nSetting up Notion\n[](#setting-up-notion)\n1. To get the **Auth Token**, visit [My Integrations](https://www.notion.so/my-integrations) in Notion. Initiate a new integration, associate it with a workspace, and note down the `Internal Integration Secret`. Insert this secret in the `Auth Token` field under the **Integrations** tab of your bot.\n![](https://files.readme.io/ba1af96-image.png)\n2. Enable Notion Comment Capabilities under the **Capabilities** tab of your bot.\n![](https://files.readme.io/bc4dec2-image.png)\nThat's it! Now the Notion integration is operational and ready for use within your bot.\n> ## ���\n>\n> Info\n>\n> To execute certain actions, identification of Notion entities like pages or databases is essential. These IDs can be derived from the URL while viewing the entity or by choosing \"Copy Link\" from the options menu. For more details, refer to [Get a Database Id - NotionDevelopers](https://developers.notion.com/docs/create-a-notion-integration#step-3-save-the-database-id) .\nFunctionality\n[](#functionality)\nCards\n[](#cards)\nThe integration offers various actions encapsulated in cards, providing an interactive way to communicate between Botpress and Notion.\nAdd Comment to a Discussion\n[](#add-comment-to-a-discussion)\nAllows the bot to append a comment to an existing discussion in Notion.\n| Input             | Description                                                                                |\n| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| **Discussion ID** | To get the Discussion ID, look for the d parameter in the URL. The format is notion.so/pageTitle-pageID?d=**DiscussionID**&pvs=4 |\n| **Comment Body**  | The comment body can be a simple text that you want to add as a comment.                                                         |\nAdd Comment to a Page\n[](#add-comment-to-a-page)\nFacilitates adding comments at the page level in Notion.\n| Input            | Description                                                                                |\n| ---------------- | ------------------------------------------------------------------------------------------------------------------- |\n| **Page ID**      | To get the Page ID, go to the page and copy the ID from the URL. The format is often notion.so/pageTitle-**pageID** |\n| **Comment Body** | The comment body can be a simple text that you want to add as a comment.                                            |\nGet a Database\n[](#get-a-database)\nRetrieve details of a specific database to synchronize with `Add Page to a Database` action.\n| Input           | Description                                                                         | Format                   |\n| --------------- | ----------------------------------------------------------------------------------- | ------------------------ |\n| **Database ID** | To retrieve the Database ID, navigate to the database and copy the ID from the URL. | notion.so/**databaseID** |\nAdd Page to a Database\n[](#add-page-to-a-database)\nDesigned to work in combination with `Get a Database` to guide an [AI task](../docs/ai-task) in generating payloads.\n| Input           | Description                                                                         | Format                         |\n| --------------- | ----------------------------------------------------------------------------------- | ------------------------------ |\n| **Database ID** | To retrieve the Database ID, navigate to the database and copy the ID from the URL. | notion.so/**databaseID**       |\n| **Page ID**     | To get the Page ID, go to the page and copy the ID from the URL.                    | notion.so/pageTitle-**pageID** |\nDelete a block\n[](#delete-a-block)\nPermits deletion of entities like pages, blocks, or pages within a database.\n| Input        | Description                                                                                | Format                                       |\n| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |\n| **Block ID** | Blocks also have unique IDs. To find the Block ID, right-click on the block and choose \"Copy Link\". The ID is often at the end of the link. | notion.so/pageTitle-pageID?pvs=4#**BlockID** |\nUpdated 4 months ago\n---\n* [Table of Contents](#)\n* * [Prerequisites](#prerequisites)  \n   * [Setting up the Notion integration in Botpress](#setting-up-the-notion-integration-in-botpress)  \n   * [Setting up Notion](#setting-up-notion)  \n   * [Functionality](#functionality)  \n         * [Cards](#cards)[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)\nSafety\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# Safety\nBotpress provides a robust feature set that ensure AI-driven interactions are safe, controlled, and compliant.\n[ Suggest Edits](/edit/safety)\nOverview\n[](#overview)\nEnsuring the safety of AI-driven interactions is a core priority for our team, and for bot builders. The Botpress platform is designed to empower developers while maintaining strict safety standards, giving you the tools needed to build reliable and controlled AI solutions. This overview covers the key safety aspects of Botpress, including constraint management, data privacy, access control, and mitigation of AI-related risks like hallucinations.\nKey Safety Features\n[](#key-safety-features)\n1. **Policy Agent**: Control AI behavior with predefined rules and constraints to ensure responses align with your organization’s standards. The Policy Agent acts as a gatekeeper, enforcing guardrails and mitigating hallucinations by filtering outputs against customizable policies.\n2. **Access Control & Permissions**: Secure your environment with granular access control. Define roles and permissions to regulate who can view, edit, and deploy AI models, ensuring that only authorized users can make changes.\n3. **Data Privacy & Security**: Botpress prioritizes data security with encryption, anonymization, and secure API connections. Our platform helps you comply with privacy regulations, safeguarding sensitive information across all interactions.\n4. **Monitoring & Analytics**: Gain insights into AI behavior and performance through monitoring and analytics tools. Track usage patterns, detect anomalies, and adjust policies in real time to maintain optimal safety levels.\n5. **Error Mitigation & Recovery**: Implement fallback mechanisms that catch errors or misbehaviors, redirecting interactions to human agents or predefined safe states. This ensures continuity and reliability even when the AI is uncertain or encounters edge cases.\n**Why Safety Matters**\n[](#why-safety-matters)\nBuilding trust in AI systems starts with safety. By implementing robust safety measures, Botpress ensures your AI solutions are not only effective but also secure and compliant with industry standards. Our commitment to safety helps you deploy AI with confidence, knowing that you are in control of every interaction.\nUpdated 27 days ago\n---\n* [Table of Contents](#)\n* * [Overview](#overview)  \n         * [Key Safety Features](#key-safety-features)[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)\nSchemas\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# Schemas\nBlueprint that defines the structure, format, and validation rules for data.\n[ Suggest Edits](/edit/schemas)\nA schema is a blueprint that defines the structure, required fields, data types, and validation rules for a piece of data. In Botpress, schemas are primarily used to ensure that data passed between various components—such as actions, modules, or API requests—meets the expected format and constraints.\nSchemas are useful for:\n* **Data Validation**: Preventing errors by ensuring that data adheres to the expected format.\n* **Consistency**: Enforcing a consistent structure for data across different components.\n* **Error Reduction**: Reducing the likelihood of runtime errors caused by unexpected or malformed data.\n* **Ease of Maintenance**: Making it easier to understand and manage data flow within your Botpress application.\nCreating and Using Schemas\n[](#creating-and-using-schemas)\nJSON Schema Basics\n[](#json-schema-basics)\nBotpress uses JSON Schema, a standard for describing the structure and validation constraints of JSON documents.\nA JSON Schema can define:\n* **Types**: The type of data (e.g., string, number, object, array).\n* **Required Fields**: Fields that must be present in the data.\n* **Enum Values**: Specific allowed values for a field.\n* **Nested Structures**: Complex data structures with multiple levels.\nCreating a schema\n[](#creating-a-schema)\nYou can create a new schema by navigating to the Schema menu in the left-hand menu. You can also create a new schema when adding a new variable through the Variables menu.\nUsing schemas\n[](#using-schemas)\nYou can use schemas instead of selecting a variable type like String or Number. This means that the variable will contain the information in the structure you've defined in your schema.\nFor example, you might use a variable to contain information about your end user. This variable can use a schema to contain information like email, age, name, and home address, all contained in a single variable and structured by your schema.\nTesting Schemas\n[](#testing-schemas)\nHere's a simple demo schema you can create to familiarize yourself with them.\n1. Create a schema for a user object with the following properties:\nJavaScript\n`zui.object({\nname: zui.string(),\nage: zui.number(),\nemail: zui.string().email(),\naddress: zui.object({\nstreet: zui.string(),\ncity: zui.string(),\nzip: zui.string().length(5)\n})\n})\n`\n1. Create a Variable of the user schema type and name it `UserInformation`.\n2. \\[optionally\\] you can use these variables as inputs for workflows, allowing the user to fill in the schema as though it were a form.\nUsage in AI Task\n[](#usage-in-ai-task)\n* Task Instructions:\n`Fetch name, age, email and address from the provided input\n`\n* AI Task Input:\n`Rohan Kokkula, 26, at [[email protected]](/cdn-cgi/l/email-protection), received a mysterious parcel at his doorstep:\n42 Emerald Lane, Mystic Falls, 560078.\nInside, a map beckoned him to a hidden world beneath Mumbai's bustling streets,\nwhere history and magic intertwined.\n`\n* Store result in variables: Select the Variable we created above.\nConditionally Show Inputs - Input trees\n[](#conditionally-show-inputs---input-trees)\nWe'll show you how to use discriminated unions in Zod to conditionally include fields in an object schema. We'll go through two examples:\n1. Changing the type of a variable based on user input.\n2. Conditionally showing an extra setting when an \"Advanced Setting\" toggle is activated.\n![selecting input type text, with no advanced settings](https://files.readme.io/4015772fa59ea2e70290e5c00ed8a78cde7aa3c0d229d5ead1543671f73a90e7-image.png)\nselecting input type text, with no advanced settings\n![selecting input type number, with advanced settings](https://files.readme.io/71423052c8b254a3d97bc8f02b00b488f5996817d0313c862d62548b7a8cc27b-image.png)\nselecting input type number, with advanced settings\nExample 1: Changing the Type of a Variable\n[](#example-1-changing-the-type-of-a-variable)\nIn this example, we'll create a schema that allows a variable (`value`) to be either a string or a number, depending on the user's choice.\nTypeScript\n`z.object({\ninputData: z.discriminatedUnion('inputType', [\nz.object({\ninputType: z.literal('Text'),\n// When inputType is 'Text', value is a string\nvalue: z.string().title('Text Value').placeholder('Enter text')\n}),\nz.object({\ninputType\n<|end_input|>","role":"user","type":"text"}],"meta":{"integrationName":"zai","promptCategory":"zai:zai.extract","promptSource":"zai:zai.extract:default"},"model":"fast","signal":{},"stopSequences":["■NO_MORE_ELEMENT■"]},"method":"POST","url":"https://api.botpress.cloud/v2/cognitive/generate-text"}

Output:
■json_start■{ "feature": "LINE integration", "parent": "integrations", "description": "The LINE integration has settings such as Enabled, Webhook URL, Channel Access Token, and Channel Secret, allowing Botpress to communicate with the LINE messaging platform." }■json_end■
■json_start■{ "feature": "Messenger integration", "parent": "integrations", "description": "The Messenger integration includes settings like Enabled, Webhook URL, App Id, App Secret, Verify Token, Page Id, and Access Token to connect Botpress with Facebook Messenger." }■json_end■
■json_start■{ "feature": "Microsoft Teams integration", "parent": "integrations", "description": "The Microsoft Teams integration provides settings for Enabled, Webhook URL, App Id, and App Password, enabling Botpress to interact with Microsoft Teams channels." }■json_end■