EmbeddedServiceLiveAgent defines the embedded Chat configuration added to a web page. It connects an EmbeddedServiceConfig to the unique combination of a Chat button and Chat deployment selected during setup, and controls pre-chat forms, offline support, queue-position display, and chat-window presentation.
It is distinct from the underlying LiveChatDeployment. The deployment, button, and embedded service configuration are required references; this type combines them into the embedded chat setup.
Key Elements
| Element | What the Element Controls |
|---|---|
embeddedServiceConfig |
Required. Names the associated EmbeddedServiceConfig. |
liveChatButton |
Required. References the LiveChatButton created in Chat setup. |
liveChatDeployment |
Required. References the underlying LiveChatDeployment created in Chat setup. |
enabled |
Required boolean. Controls whether this embedded chat deployment is enabled. |
scenario |
Required. Determines which objects are related to the chat. Allowed values are Sales, Service, and Basic. |
fontSize |
Required. Sets the text size in the embedded chat window. Allowed values are Small, Medium, and Large. |
prechatEnabled |
Required. Controls whether the pre-chat form is enabled. Its documented data type is inconsistent; see Documentation Inconsistencies. |
prechatJson |
Stores all fields of the selected pre-chat form from Chat setup as a JSON object, a structured text format, serialized into a string. |
customPrechatComponent |
Identifies the custom Lightning component used for the pre-chat page. |
embeddedServiceQuickActions |
Contains repeated EmbeddedServiceQuickAction structures associating quick actions with the embedded setup. These actions supply form fields shown to visitors. |
isOfflineCaseEnabled |
Controls whether offline support is enabled. It is separate from the quick-action association that identifies the offline case form. |
isQueuePositionEnabled |
Controls whether waiting visitors see their place in line. |
Behavior and Constraints
Creating this configuration requires a Chat Deployment, a Chat Button, and an EmbeddedServiceConfig. Assign them through liveChatDeployment, liveChatButton, and embeddedServiceConfig, respectively. Setting enabled to true does not substitute for these required relationships.
scenario is a business-data setting, not just a presentation choice: it determines which objects are related to the chat. By contrast, fontSize controls text presentation, and isQueuePositionEnabled controls the visitor's queue-position display.
Each entry in embeddedServiceQuickActions contains these nested settings:
-
quickActionDefinitionreferences the associatedQuickAction. -
embeddedServiceLiveAgentreferences the associatedEmbeddedServiceLiveAgent. This reference belongs inside the quick-action entry, not at the top level of the component. -
quickActionTypedistinguishesPrechatfromOfflineCase. -
orderspecifies where the action appears in the pre-chat form. It describes display order, not execution order.
For offline support, inspect both the OfflineCase quick-action association and isOfflineCaseEnabled. The association identifies the offline support action; the flag enables offline support. They have separate roles and should not be interpreted as interchangeable settings.
Deployment and Retrieval
Components are stored as developer_name.EmbeddedServiceLiveAgent files in the EmbeddedServiceLiveAgent folder. The type extends Metadata and inherits fullName as its metadata identity. The required masterLabel is the embedded chat deployment's name label, not its metadata identity.
EmbeddedServiceLiveAgent does not support the * wildcard in package.xml. Retrieval and deployment manifests must identify individual members rather than relying on wildcard selection.
Deploying image fields can replace branding maintained in Setup. Metadata changes to avatarImg, smallCompanyLogoImg, prechatBackgroundImg, offlineCaseBackgroundImg, and waitingStateBackgroundImg override the corresponding values entered in Setup. Salesforce recommends setting image URLs in Setup.
Relationships
The required links connect the embedded configuration to its Chat deployment, button, and embedded service configuration. Optional custom pre-chat and quick-action links connect the visitor-facing forms to their implementations. Quick-action references are nested within embeddedServiceQuickActions.
References
-
EmbeddedServiceConfig:embeddedServiceConfig. -
EmbeddedServiceLiveAgent:embeddedServiceLiveAgent, nested withinembeddedServiceQuickActions. -
LightningBundle:customPrechatComponent. -
LiveChatButton:liveChatButton. -
LiveChatDeployment:liveChatDeployment. -
QuickAction:quickActionDefinition, nested withinembeddedServiceQuickActions.
Referenced By
-
EmbeddedServiceLiveAgent:embeddedServiceLiveAgent, nested within its quick-action entries.
Documentation Inconsistencies
prechatEnabled has conflicting type descriptions: the exposed element schema defines it as a boolean, while the Metadata API field table lists it as a string. Both describe a required setting that enables or disables the pre-chat form, and the documented XML example uses true. The discrepancy concerns the field's declared type, not its purpose.
Reported Issues
-
Direct Apex queries were reported unavailable for this type. A 2021 community inventory of Tooling API objects listed
EmbeddedServiceLiveAgentamong the objects not available in the ApexSchemanamespace and therefore not directly queryable in Apex. This was a report about Apex access, not Metadata API retrieval. See the Apex queryability discussion.
Common Questions
Why doesn't a wildcard retrieve EmbeddedServiceLiveAgent?
This type does not support * in package.xml. List each component member explicitly in the retrieval or deployment manifest.
What dependencies does EmbeddedServiceLiveAgent require?
It requires a LiveChatDeployment, a LiveChatButton, and an EmbeddedServiceConfig, referenced through their corresponding elements. The enabled flag does not replace those dependencies.
Is an OfflineCase quick action enough to enable offline support?
No. The OfflineCase association identifies the offline support action, while isOfflineCaseEnabled controls whether offline support is enabled. Inspect both settings.
Why did deploying EmbeddedServiceLiveAgent change images entered in Setup?
Changes to the metadata image fields override the corresponding Setup values, including the avatar, company logo, pre-chat, offline-case, and waiting-state images. Salesforce recommends setting image URLs in Setup.
Is prechatEnabled a boolean or a string?
The type descriptions conflict: the exposed element schema defines a boolean, but the Metadata API field table lists a string. Its documented purpose is to enable or disable the pre-chat form, and the XML example uses true.