Public: Get Agent Info
GET /api/public/chatbot/{chatbot_id}
Returns the public-facing configuration for an agent — name, welcome message, and widget appearance settings. No authentication required. Use this to render a custom chat UI with the correct branding.
string
required
The unique ID of the agent.
200 OK):
string
The agent’s unique identifier.
string
The agent’s display name.
string
The first message shown to users when the chat widget opens.
string
Primary hex color for the widget UI.
string
Where the widget appears on the page:
"bottom-right", "bottom-left", "top-right", or "top-left".boolean
Whether the widget shows a lead capture form before the first message.
string | null
Custom branding text shown at the bottom of the widget (available on paid plans), or
null to show the default branding.Public: Send a Message
POST /api/public/chat/{chatbot_id}
Sends a message to a publicly accessible agent. No authentication required — this endpoint is designed for end-users visiting your website.
To maintain conversation context across multiple messages, pass the same session_id in every request for a given user session. BotSmith uses the session_id to group messages into a single conversation thread.
The agent must have
public_access enabled and status set to "active". If the agent is inactive, this endpoint returns a 400 error.string
required
The unique ID of the agent to chat with.
string
required
The user’s message text.
string
required
A client-generated session identifier. Use the same value across all messages from the same user session so the agent retains conversation context. Generate a UUID on first load and store it for the duration of the session.
string
Optional display name for the user. Stored against the conversation for reference.
string
Optional email address for the user. Stored against the conversation for reference.
200 OK):
string
The agent’s reply to the user’s message.
string
The unique ID of the conversation this message belongs to.
string
The session ID echoed back from the request.
Authenticated: Send a Message
POST /api/chat
Sends a message to an agent from a server-side or authenticated context. Requires a valid Bearer token. Use the same session_id across requests to maintain conversation context.
string
required
The user’s message text.
string
required
The unique ID of the agent to send the message to.
string
A session identifier. Use a consistent value across messages to maintain conversation context.
string
Optional display name for the user.
string
Optional email address for the user.
200 OK):
List Conversations
GET /api/chat/conversations/{chatbot_id}
Returns all conversations for the specified agent, sorted by most recently updated. Requires authentication.
string
required
The unique ID of the agent whose conversations you want to list.
200 OK):
string
Unique identifier for the conversation.
string | null
The session ID associated with this conversation.
string | null
The name of the user who started the conversation, if provided.
string | null
The email of the user, if provided.
string
Conversation status:
"active", "resolved", or "escalated".integer | null
User-submitted satisfaction rating (1–5 stars), or
null if not rated.integer
Total number of messages (user + assistant combined) in the conversation.
Get Messages in a Conversation
GET /api/chat/messages/{conversation_id}
Returns all messages in a conversation in chronological order. Requires authentication.
string
required
The unique ID of the conversation to fetch messages from.
200 OK):
string
Unique identifier for the message.
string
Who sent the message:
"user" or "assistant".string
The text content of the message.
string
ISO 8601 timestamp of when the message was sent.