Configure the Chat Widget
Reference for web chat deployments, appearance, greetings, suggestions, attention grabbers, live chat, behavior, and the MCP tools that manage configurations.
Each web chat configuration controls where one version of the widget appears and how it looks and behaves. A business can have multiple configurations—for example, one for the main storefront and another for a regional subdomain.
Configure them in Settings → Channels → Web Chat. Choose a configuration from the menu at the top of the page, or select Add New Configuration to create one.
Every configuration uses the same widget. Product cards, order tracking and the other widget elements are a setting of their own. enableWidgetV2 is a retired field kept only for compatibility; it no longer changes which widget loads.
Avoid overlapping deployments
If multiple enabled configurations match the same hostname, path, and query conditions, the widget prefers the rule with more query conditions, then the first matching configuration returned by the service. Keep equally specific deployment rules mutually exclusive unless that ordering is intentional.
Deployment and visibility
The Deployment section decides which pages load the widget.
| Setting | MCP field | What it controls |
|---|---|---|
| Domain | deployments[].hostname | Hostname without a path, such as example.com. www.example.com and example.com are treated as the same hostname. |
| Path pattern | deployments[].pathRegex | Optional regular expression tested against window.location.pathname, such as ^/products/. An empty or null value allows every path on that hostname. |
| Query conditions | deployments[].queryConditions | Optional parameter rules evaluated against the parsed query string. Every condition must match. |
| Enable deployment | deployments[].enableDeployment | Turns that domain/path/query rule on or off without removing it. |
| Hidden by default (advanced) | hideInitially | Starts the launcher and chat hidden. Your JavaScript must reveal the widget with showWidgetEvent or open it with openChatEvent. See Showing a hidden widget for examples and explicit-open exceptions. |
| Hide other chat widgets | removeCompetitorWidgets | Attempts to remove other known chat widgets when Octocom loads. Test this after changing storefront apps. |
Every hostname needs its own deployment entry. Different paths on the same hostname can be assigned to different configurations with non-overlapping regular expressions.
Deployments choose among your own organization's configurations; they never let another organization's chat load on your site. The script from Install on your website includes your organization ID, so it only loads your organization's chats. An older script without data-organization-id loads only on the domains where it was live on 3 November 2026, and only for the organization it served then; on any other domain, install the current script. See Launch Chat Widget. If an older script stopped loading on a domain that is yours, for example after a domain moved between organizations, contact Octocom support.
Each query condition contains parameter, operator, and value. Use equals for an exact decoded value, matches for a regular expression against the decoded value, or exists to require the parameter regardless of its value. Set value to null for exists. Repeated parameters match when any value satisfies the condition. Deployments without query conditions retain the existing domain-and-path-only behavior.
Supported regular expressions
Every page-targeting and URL pattern (deployment paths and matches query conditions, greetings, first-message suggestions, attention grabbers, autoOpenPaths, interaction button and virtual try-on paths, and product URL matching rules) must run in linear time, so a long or unusual URL can never slow matching down. New or changed patterns cannot use:
- lookaheads:
(?=...)and(?!...); - backreferences such as
\1; - repeat counts above 16, such as
{2,40}. Use+or{2,}instead.
Lookbehinds such as (?<=/products/) are fine. A save that adds or changes a pattern like this is refused with an explanation. Patterns the business saved before November 2026 keep working unchanged and can be saved again as they are.
To leave out some pages, list the pages to include instead of excluding the others, for example ^/(products|collections)/ rather than ^(?!/checkout).*$. To stop before a character, include it in the match or end the pattern with \b or $.
You can also configure a support-hours schedule with supportHours using Hide Web Chat During Specific Hours. The widget is hidden during the configured intervals, when your support team is online, and shown outside them. Set it to null to disable the schedule:
{
"timezone": "Europe/London",
"Monday": [{ "open": "09:00", "close": "17:30" }],
"Tuesday": [{ "open": "09:00", "close": "17:30" }]
}Omitting a weekday or leaving its intervals empty keeps the widget available all day. Times use the configured IANA timezone and a 24-hour clock.
The dashboard's Bot Playground and its shareable link (https://<business-slug>.octocom.page/chat?organizationId=<organization-id>&playground, copied with Share link) always bypass this schedule, so you can test and share the bot at any time. Conversations from the shareable link are test conversations, like the Playground's. Older shareable links on octocom.ai/try?business=<business-slug> redirect to the new link.
Appearance
Most size and spacing values are CSS values, such as 20px, 3rem, or 64px. Colors accept CSS color strings; hexadecimal colors are the simplest choice.
| Area | Configurable fields |
|---|---|
| Top bar | Title, logo, background/text/icon colors, and border (topBarTitle, topBarBackgroundColor, topBarTextColor, topBarIconColor, enableTopBarBorder) |
| Bot messages | Bot icon and message background/text colors (botMessageBackgroundColor, botMessageTextColor) |
| Customer messages | Message background/text colors (customerMessageBackgroundColor, customerMessageTextColor) |
| Cards & buttons | Widget elements: colors of order tracking, confirmations and product cards, and of their buttons (cardBackgroundColor, cardTextColor, cardAccentColor, cardAccentTextColor). Unset, cards use the bot message colors and buttons the customer message colors |
| Desktop launcher | Type (icon, icon_text, or image), text, image/icon, colors, launcher size, and icon size (launcherType, launcherText, launcherBackgroundColor, launcherTextColor, launcherIconColor, launcherSize, launcherIconSize) |
| Mobile launcher | Copy the desktop launcher or configure a separate icon, icon-and-text, or image launcher with the corresponding launcherMobile* fields |
| Desktop position | Bottom offset, left or right offset, and stacking order (positionBottom, positionLeft, positionRight, zIndex) |
| Mobile position and window | Bottom/left/right offsets and optional window width/height percentages (mobilePositionBottom, mobilePositionLeft, mobilePositionRight, mobileWidthPercentage, mobileHeightPercentage) |
Set only one of positionLeft and positionRight, and only one of mobilePositionLeft and mobilePositionRight; set the unused side to null.
Image uploads are managed in the dashboard. MCP returns image file IDs and public URLs when reading a configuration, but the general update tool does not accept image IDs.
Conversation start
Greetings
greetings controls the opening message. Each entry contains:
content: the greeting text.pathRegex: an optional pathname regular expression. Null is a fallback that matches any page.priority: a non-negative number. Higher priority entries are evaluated first, and the first matching greeting wins.
Keep one null-path greeting at the lowest priority when you want a default.
Suggested replies
firstMessageSuggestions displays buttons before the visitor's first message. Each entry has:
displayText: the button label.messageText: the message sent to the bot when the button is clicked.pathRegex: an optional pathname regular expression. On pages where any path-specific suggestion matches, only those show; otherwise the suggestions without apathRegexshow.url: optional. Set it to make a link button.
Link buttons
A suggestion with a url is a link button. Clicking it opens that page in a new tab and sends nothing to the bot, so the chat stays where it was. Use link buttons to point visitors to help-center articles or FAQ pages before they ask, while the bot stays one message away.
urlmust be a complete address starting withhttps://, up to 2048 characters. Other addresses are rejected with a validation error.messageTextis optional for link buttons and is never sent. When omitted it is stored as thedisplayText, so a visitor whose browser still runs an older widget sends the label instead of an empty message.- Link buttons show even before the visitor enters an email when
requestEmailBeforeChatis on. Message buttons still wait for the email. - The widget shows a small new-tab icon on link buttons. Screen readers announce that the link opens in a new tab.
- Message and link buttons can be mixed, and both follow the same
pathRegexrules. - To hide link buttons on the help center itself, give that hostname its own configuration without them.
In the dashboard, choose Open a link under When clicked on a suggestion in First Message Suggestions.
This patch shows two FAQ links next to a button that starts a chat:
{
"firstMessageSuggestions": [
{
"displayText": "Shipping times",
"url": "https://help.example.com/articles/shipping-times"
},
{
"displayText": "Returns and refunds",
"url": "https://help.example.com/articles/returns"
},
{
"displayText": "Track my order",
"messageText": "Where is my order?"
}
]
}Send it as the patch argument of the MCP update_web_chat_config tool, or as the body of PATCH /rest/v1/web-chat-configs/{id} in the REST API. The array replaces every existing suggestion, so read the configuration first and include the suggestions you want to keep. Reads return url on every suggestion (null for message buttons). Use test_web_chat_url to check which suggestions match a page; it doesn't model the email gate, which hides message buttons until the visitor enters an email.
secondMessageSuggestions can add a second choice after a first suggestion. Each entry contains messageText and an optional firstMessagesAllowed array. Values in firstMessagesAllowed must match the first suggestion's message text, not its display label.
Passing either array through MCP or REST replaces the complete existing array. Read the configuration first when modifying only one suggestion.
Widget elements
enableWidgetElements (dashboard: Chat behavior -> Show widget elements) lets the bot show richer content than text: product cards with photo, price and link, optionally with a button such as "Add to cart" that sends a message to the bot (showProducts), side-by-side product comparisons (compareProducts), order tracking cards for orders the bot has looked up (showOrders), confirmation buttons before changing an order (askForConfirmation), quick replies (suggestReplies) and cards built by custom Python actions. Products and prices come from the catalog, so the bot never writes them by hand.
Each message's text still carries a plain version for the inbox, transcripts and emails. With the setting off, the bot writes everything as text. A visitor whose browser still runs a widget from before elements existed gets text until the page reloads.
Data collection, terms, and text
| Setting | MCP field |
|---|---|
| Ask for an email before the first message | requestEmailBeforeChat |
| Require a yes/no terms choice | requireTermsAndConditionsAgreement, termsAndConditionsYesButtonText, termsAndConditionsNoButtonText |
| Show a disclaimer above the input | enableDisclaimer, disclaimerText, disclaimerButtonBackgroundColor, disclaimerButtonTextColor |
| Input placeholder | messageInputPlaceholder |
| Widget interface language | languageOverride (en, cs for Czech, el for Greek, es, lt, no, or ru; null auto-detects the browser language) |
Set languageOverride to cs (Czech) or el (Greek) for that interface language, including product card buttons, screen-reader labels and the chat window's language attribute. In the dashboard, choose the language under Web Chat -> Language. This translates built-in interface text; configure custom titles, placeholders, greetings, and disclaimer text separately.
Attention grabbers
Attention grabbers invite a visitor to start a conversation before they open the widget. They are the attentionGrabbers array: an ordered list of rules, each with its content, trigger (a delay, exit intent or page code), conditions (pages, page views this visit, devices, chat history) and frequency. For each trigger, the first enabled grabber whose conditions pass is shown.
The sender name, label, icon, pill style and the four attentionGrabberSuggestionBubble*Color fields set their appearance for the whole configuration. See Attention Grabbers for every field, examples and the retired single-grabber fields.
Live chat
Whether live chat is on, the expected response time and the timeout belong to the business, in Handoff settings, and apply to every configuration. enableLiveChat, liveChatResponseTime and liveChatTimeout are still accepted here and returned, but a change saves the business setting.
The response time is what the AI agent quotes at handoff, and what the widget's waiting status shows as "Usually replies within N min".
Each configuration keeps its own agent icon: liveChatUseAgentInitialsAsIcon shows each agent's initials instead of the uploaded icon, which is managed in the dashboard.
See Live Chat for routing, assignment, and availability behavior.
Advanced behavior
These settings are available through MCP even when they are not shown in the main dashboard form:
| MCP field | Behavior |
|---|---|
hideInitially | Advanced Deployment toggle: starts hidden until JavaScript shows or opens the widget. See Showing a hidden widget. |
openChatAfter | Opens the chat window after this many seconds when the visitor has not interacted recently. Null disables it. |
autoOpenPaths | Array of pathname regular expressions that open the window immediately on matching pages. |
logLevel | Widget console logging threshold: debug, info, warn, error, or null to disable. |
enableCustomJs, customJs | Runs the business's own JavaScript snippet on the page once the widget loads. See Custom JavaScript. |
Interaction buttons and virtual try-on are linked to web chat but have dedicated configuration and MCP tools. See Interaction Buttons and Virtual Try-On.
Manage configurations through MCP
Use these MCP tools to manage web-chat configurations:
| Tool | Purpose |
|---|---|
list_web_chat_configs | List every configuration for a business. |
get_web_chat_config | Read one configuration by ID. |
test_web_chat_url | Explain deployment matching and the greeting, suggestions, language, auto-open, and attention behavior. |
create_web_chat_config | Create a named configuration using Octocom defaults. |
update_web_chat_config | Patch only the supplied fields. |
archive_web_chat_config | Stop serving one configuration while preserving its settings for restoration. |
The tools above require organizationId and businessId; get, update, and archive also require configId. The create tool starts with defaults. Create it first, then update it.
Find archived configurations with list_archived_configuration_resources using resourceType: "webChatConfig". Restore one with restore_web_chat_config, passing organizationId and resourceId (the configuration ID). Its settings, deployments and suggestions are retained. Restoring it makes its saved deployment configuration available to widgets again.
Example update arguments:
{
"organizationId": "org-id",
"businessId": "business-id",
"configId": "config-id",
"patch": {
"name": "UK storefront",
"deployments": [
{
"hostname": "example.com",
"pathRegex": "^/uk(?:/|$)",
"queryConditions": [
{
"parameter": "campaign",
"operator": "matches",
"value": "^(summer|autumn)-sale$"
},
{
"parameter": "preview",
"operator": "exists",
"value": null
}
],
"enableDeployment": true
}
],
"topBarTitle": "Ask us anything",
"languageOverride": "en",
"firstMessageSuggestions": [
{
"displayText": "Track my order",
"messageText": "Where is my order?",
"pathRegex": null
},
{
"displayText": "Shipping FAQ",
"url": "https://help.example.com/articles/shipping",
"pathRegex": null
}
]
}
}For patch fields, omission means “leave unchanged,” while null clears a nullable value. Arrays are full replacements; pass [] to remove every item. Archival removes a configuration from active use and ordinary lists. It supports restoration of the retained configuration, rather than rollback to any earlier edit.
Use test_web_chat_url after changing URL-sensitive behavior. Pass the complete URL, including protocol and query string. Its response reports the selected configuration and selection reason, then breaks down the enabled state, normalized hostname, pathname regular expression, and actual values seen by every query condition for every deployment. unpinnedScriptAllowed reports whether an older script without data-organization-id may load your organization's chat on that hostname; scripts copied from Web Chat settings never depend on it.
For the selected configuration, resolvedExperience also reports:
- the greeting that would be used, its matching rule, and every other candidate;
- the effective first-message suggestions and whether path-specific or default suggestions won;
- the configured conversation-language rule or business-language fallback;
- URL/query-based auto-open matches and the configured delayed-open value;
- which attention grabber shows after a page view and on exit intent, with every failed condition of the others. Pass
visitorto assume page views, a mobile device, an existing chat or earlier shows.
Greeting, suggestion, and language rules continue to match the pathname only; query conditions apply to deployment selection. Browser-dependent decisions such as the current open state, embed attributes, support hours, and actual AI-generated content are explicitly listed as unevaluated runtime state. The tool is read-only and evaluates configuration data without requesting the storefront URL.