Chatbot Streaming API

Stream AI chatbot responses over Server-Sent Events (SSE). Use this to embed the Boei chatbot in your own UI, mobile app, or backend integration.

How to get there: Get your chatbot UUID from Setup → Chatbot → click your chatbot → Install tab.

Endpoint

POST https://app.boei.help/api/ai_chat/send

Send a JSON body and receive an SSE stream back. Each chunk in the stream is part of the AI response.

Request

curl https://app.boei.help/api/ai_chat/send \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "chatbot_id": "CHATBOT_UUID",
    "load_key": "unique-session-id",
    "message": "How long does shipping take?"
  }' \
  --no-buffer

Required Fields

  • chatbot_id — UUID of the chatbot
  • load_key — a unique identifier per visitor session; reuse the same key to continue the same conversation
  • message — the visitor's message

Optional Fields

  • customer_email, customer_name, customer_phone — prefill contact info
  • page_url, page_title — page context for the AI
  • language — override auto-detected language

Response

The response is a stream of SSE events. Each event has the form:

data: {"type":"chunk","content":"Shipping "}

data: {"type":"chunk","content":"usually takes 3-5 days."}

data: {"type":"done"}

Concatenate the content fields from all chunk events to assemble the full response. The stream ends with a done event.

Event Types

  • chunk — partial text content
  • tool_call — the AI is invoking a tool (e.g., looking up order status)
  • lead_field — the AI is asking for a contact field (email, phone, etc.)
  • escalate — the AI handed off to a live agent
  • done — the response is complete

Continuing a Conversation

To continue a thread, send the next request with the same load_key. Boei automatically reconstructs the conversation context.

Authentication

Public chatbots do not require authentication for this endpoint (they are designed to be embedded on public pages). If your chatbot is configured as private, include an API key per API Authentication.

Rate Limits

Per load_key: 1 message every 2 seconds. Per IP: 60 messages per minute.