LiveChatButton defines the customer-facing button or invitation used to start a Chat session. It controls agent routing, request queues, chat-window behavior, and pre-chat and post-chat destinations. It also associates the button with skills, images, custom pages, and Chat deployments.
A button is a separate configuration component from LiveChatDeployment, even when they are associated. Activating a button does not establish that qualified agents are available. Chats routed with Omni-Channel are not supported by the Metadata API, so this type cannot fully reproduce an Omni-Channel chat configuration.
Key Elements
| Element | What the Element Controls |
|---|---|
type |
Required. Distinguishes a Standard button from an Invite invitation. |
isActive |
Whether the button or invitation is active. Agent availability and routing remain separate considerations. |
routingType |
How incoming chats route to agents. Allowed values are Choice, LeastActive, and MostAvailable. None represents Omni-Channel routing. |
skills |
Contains skill entries that reference skills by name and identify the skills required for routing. |
deployments |
Contains deployment entries that associate the button with Chat deployments by name. |
optionsIsAutoAccept |
Enables automatic acceptance by the assigned agent for buttons and automated invitations using MostAvailable or LeastActive. |
optionsCustomRoutingIsEnabled |
Whether custom routing is enabled for incoming chat requests. This is separate from automatic acceptance. |
enableQueue |
Whether requests can queue. Interpret it with the total and per-agent queue lengths. |
overallQueueLength |
The maximum number of requests allowed to queue overall. |
perAgentQueueLength |
The number of requests allowed to queue for an agent with the required skills. |
pushTimeOut |
The number of seconds an agent has to answer before the request routes to another agent. |
optionsHasRerouteDeclinedRequest |
Whether to try routing again after all available agents reject a request. |
numberOfReroutingAttempts |
How many additional routing attempts are allowed after all available agents reject the request. |
optionsHasChasitorIdleTimeout |
Whether visitor idle-timeout behavior is enabled. The warning and timeout thresholds are configured separately. |
site |
The Salesforce site hosting custom button images or a custom chat page. Using a Salesforce site with Chat requires the CustomDomain permission in the organization. |
Behavior and Constraints
Activation, routing, and acceptance
isActive controls activation, not agent availability. Each skill inside skills names a routing requirement: customers using the button route to agents with those skills. The references do not describe whether qualified agents are currently available.
optionsIsAutoAccept applies to buttons and automated invitations whose routingType is MostAvailable or LeastActive. Do not treat it as an effective auto-accept setting for Choice routing. optionsCustomRoutingIsEnabled independently enables custom routing for incoming requests.
Queues and routing retries
Read enableQueue, overallQueueLength, and perAgentQueueLength together. The first enables queuing, the second limits the total queued requests, and the third limits queued requests for an agent with the required skills.
An unanswered request and a declined request follow different controls. pushTimeOut sets the answer window in seconds before routing to another agent. optionsHasRerouteDeclinedRequest instead controls another routing attempt after every available agent rejects the request; numberOfReroutingAttempts specifies how many such attempts are allowed.
Visitor timeout and repeated invitations
When optionsHasChasitorIdleTimeout is enabled, chasitorIdleTimeoutWarning controls when the visitor sees a warning and chasitorIdleTimeout controls when the chat times out. Idle time starts counting after the agent sends the last chat message, not simply when the session starts.
For invitations, optionsIsInviteAutoRemove works with timeToRemoveInvite, the display duration in seconds before removal. optionsHasInviteAfterAccept and optionsHasInviteAfterReject independently control whether another invitation triggers after the customer accepts or rejects a previous invitation. These settings govern repeated invitations, not an agent's acceptance of a chat request.
Custom pages, destinations, and images
chatPage supplies a custom page instead of the standard Chat window. preChatFormPage and postChatPage name forms used before and after the chat. preChatFormUrl and postChatUrl specify URL destinations instead of page-name references. The presence of both a page field and a URL field does not establish which takes precedence.
inviteImage supplies the invitation graphic. onlineImage and offlineImage supply button images for when agents are available or unavailable. If a Salesforce site hosts custom images or a custom chat page, the organization must have the CustomDomain permission enabled.
Deployment and Retrieval
In Metadata API file format, configurations are stored as <developer_name>.liveChatButton files in the liveChatButtons directory. The type supports the wildcard * in a package.xml manifest for retrieval.
LiveChatButtonDeployments and LiveChatButtonSkills are nested structures within the button configuration. They hold deployment and skill associations; they are not separate button definitions.
Updating the metadata does not finish the website update. After updating a chat button through the Metadata API, update every web page that uses the same chat button code.
Omni-Channel routing requires work outside this metadata configuration. The allowed routingType values cannot express it. A reported workaround is to deploy with skill-based routing and then configure Omni-Channel in Salesforce, but that does not make Omni-Channel routing supported by the Metadata API.
Unlocked-package removal also has a reported failure case involving components included through --skip-validation. The removal and uninstall failures described below apply to that unvalidated-package scenario; they do not establish how every deletion mechanism behaves.
Relationships
The button's outgoing references connect routing requirements, deployment associations, custom pages, images, and site hosting. Incoming references identify possible consumers in bots, embedded chat, and agent configuration. These schema connections do not by themselves establish actual usage in an organization.
References
-
ApexPage:chatPage,preChatFormPage,postChatPage. -
LiveChatDeployment:deploymentinsidedeployments, by name. -
StaticResource:inviteImage,onlineImage,offlineImage. -
CustomSite:site. -
Skill:skillinsideskills, by name.
Referenced By
-
Bot:chatButtonName. -
BotVersion:chatButtonName. -
EmbeddedServiceLiveAgent:liveChatButton. -
LiveChatAgentConfig:button,supervisorDefaultButtonFilter.
Reported Issues
-
Retrieved metadata may omit the Omni-Channel routing configuration. In a 2024 discussion about packaging an Einstein Bot that used Omni-Channel, a developer reported that the button's retrieved metadata omitted
routingType. An answer described deploying with skill-based routing and then configuring Omni-Channel in Salesforce. This was a reported workaround, not Metadata API support for Omni-Channel routing. See the Omni-Channel packaging discussion. -
Retained package associations reportedly blocked unlocked-package uninstall and component removal. In March 2024, a developer who included
LiveChatButtonandSkillin an unlocked package using--skip-validationreported that the associations remained even when the components were not displayed in the UI. The report included the Metadata API errordelete() not supported for LiveChatButtonand stated that--upgrade-type Deletedid not resolve the problem. This finding is specific to the reported unvalidated-package scenario, not a rule for every deletion mechanism. See the unlocked-package removal report.
Common Questions
Can I deploy an Omni-Channel LiveChatButton through the Metadata API?
The Metadata API does not support chats routed with Omni-Channel. routingType accepts only Choice, LeastActive, and MostAvailable. The reported skill-based deployment workaround still requires configuring Omni-Channel in Salesforce afterward.
Why does optionsIsAutoAccept not work with Choice routing?
optionsIsAutoAccept applies to buttons and automated invitations using MostAvailable or LeastActive. It is not an effective auto-accept setting for Choice.
Does activating a chat button mean agents are available?
No. isActive controls whether the button or invitation is active. Skill references define routing requirements, while the live availability of agents with those skills is separate.
Do I need to update my website after deploying a chat button change?
Yes. After updating a button through the Metadata API, update every web page that uses the same chat button code. The metadata update alone is not the complete website maintenance operation.
Will --upgrade-type Delete remove a LiveChatButton from an unlocked package?
It did not resolve the March 2024 report involving LiveChatButton and Skill included using --skip-validation. That report also described retained package associations and a Metadata API deletion error. It does not establish behavior for every package or deletion mechanism.