Sends a visitor’s message into a webchat conversation and returns the AI agent’s reply in
the same response. The call blocks while the model writes, typically a few seconds.
Choosing the thread. Send visitorId to start or continue the thread keyed
webchat_<visitorId>, or conversationId (from a previous response) to continue that exact
conversation. At least one is required. If conversationId does not exist in the workspace,
a thread keyed by visitorId (or by the id itself) is used, creating a new conversation
with a different id. Always keep the conversationId from the latest response. A
closed thread is reopened by the next message.
Agent. agentId picks the agent that answers and binds it to a thread that has none yet.
It never replaces an agent already bound. Without any agent, a generic assistant answers
without inventing business details. A paused agent, a deleted agent or a visitor on the
exclusion list get a fixed notice instead of an AI reply.
Messages longer than 4000 characters are truncated to 4000 before processing. A message made
only of whitespace passes validation but fails processing, so trim before sending.
Side effects. Stores the visitor’s message and the reply. Calls the LLM (or the agent’s
voice-engine chat agent) and may run the agent’s tools and knowledge-base lookups. Each
model-written reply spends one AI message of the plan’s monthly allowance. Fixed notices
spend none. Broadcasts a realtime update to the dashboard and writes an audit entry.
Idempotency. Not idempotent. A retry stores the visitor’s message again, generates a new
reply and spends another AI message.
Webhook events. audit.log_recorded for subscribers that selected it explicitly. See Webhooks.
Access
- Required scope:
write.
- Rate limit: General API (120–600 requests/min per workspace by plan) and the webchat limiter — 20 requests/min per client IP. See Rate limits.
- Plan: Available on every plan. Requires an active plan with AI messages left; otherwise 403
BILLING_ERROR.