Dify

Managed auth required

Dify chat and agent apps

BotChap connects your website chat widget to a Dify app via the Dify chat-messages API. The BotChap server proxy handles authentication — your Dify API key stays on the server and is never exposed to the browser.

BotChap uses blocking response mode. Streaming responses from Dify are not supported.
BotChap passes the session ID as conversation_id so Dify can maintain conversation history across turns.

Why use this integration

Use this integration when your chatbot already runs on Dify and you need a more branded, customizable widget than the default Dify embed — with animated triggers, custom colors, voice input, and GDPR consent.

How it works

  1. 1
    Visitor sends a message in the BotChap widget
  2. 2
    BotChap widget sends the message to the BotChap server proxy
  3. 3
    The server calls the Dify chat-messages endpoint with your API key
  4. 4
    Dify processes the message through your configured app
  5. 5
    BotChap reads the answer field and displays it in the widget

Required fields

Dify Endpoint
Your Dify API base URL. Defaults to https://api.dify.ai/v1.
Dify API Key
Stored on the BotChap server. Used as the Authorization: Bearer header.
App Mode
Chat, Completion, or Agent. This controls which Dify API path is used.
User Identifier (optional)
A stable identifier for the visitor. Defaults to the session ID.

What BotChap sends

BotChap sends a POST to your Dify chat-messages (or completion-messages) endpoint:

{
  "inputs":           {},
  "query":            "<visitor message>",
  "response_mode":    "blocking",
  "user":             "<user identifier or sessionId>",
  "conversation_id":  "<sessionId>"
}

Sample request

POST https://api.dify.ai/v1/chat-messages
Authorization: Bearer <your-dify-api-key>
Content-Type: application/json

{
  "inputs": {},
  "query": "How do I connect BotChap to Shopify?",
  "response_mode": "blocking",
  "user": "visitor_42",
  "conversation_id": "bc_7f3a9d"
}

Sample response

{
  "answer": "Use the Shopify integration in BotChap to search products from your storefront.",
  "conversation_id": "bc_7f3a9d"
}

Best use cases

  • Customer support with Dify knowledge base
  • Dify agent apps as a branded website chat
  • FAQ bots built in Dify
  • Multi-step intake flows

Frequently asked questions

Which Dify app types does BotChap support?
Chat, Completion, and Agent. Set the App Mode in the editor to match your Dify app type.
Is streaming supported?
No. BotChap calls Dify in blocking mode and waits for the full response before displaying it.
Can I pass custom inputs to Dify?
Not directly from the editor UI yet. Contact us if you need to pass custom input variables per request.

Related integrations

Ready to connect Dify to BotChap?

Create a free widget, configure the integration, and embed it on your site in minutes.

View all integrations