# Smart Embed Event Reference Zoom Contact Center Smart Embed communicates with your web application through browser `postMessage` events. This reference documents all available events, organized by feature category. ## Initialization and Configuration These events handle the initial setup and configuration of Smart Embed when it loads in your web application. ### zcc-init-config-request This event fires when an agent loads a webpage with Smart Embed. ```javascript { type: "zcc-init-config-request", } ``` ### zcc-init-config-response Send this event in response to `zcc-init-config-request` to provide your Smart Embed configuration settings. ```javascript { type: "zcc-init-config-response", data: { phone: { screenPopEvent: "RINGING", }, }, } ``` ### zcc-agent-info-request Send this event to retrieve the authenticated agent's identity from Smart Embed on demand. Use this when your listener was not attached at login, or when you need to refresh the cached identity. The `requestId` is optional and will be echoed on `zcc-agent-info-response`, or on `zcc-error` if login has not completed. Smart Embed responds with `zcc-agent-info-response`. If the agent is not authenticated, Smart Embed responds with `zcc-error` with code `agent-not-authenticated` and message 'Agent identity is available only after login.' ```javascript { type: "zcc-agent-info-request", data: { requestId: REQUEST_ID, // optional }, } ``` ### zcc-agent-info-response This event fires after the agent successfully authenticates in Smart Embed, at the same time as `zcc-init-config-request`. It also fires in response to `zcc-agent-info-request`, so hosts that attach a listener after login can still retrieve the same identity. Smart Embed does not send this event before login completes. `agentId` matches the `agentId` on `zcc-call-connected` and `zcc-outbound-call-started`, so you can correlate identity with call events. The `firstName` and `lastName` fields come from the agent's profile. If those fields are missing, Smart Embed splits the display name. The `email` field may be an empty string if it is not set on the profile. When this event is a response to `zcc-agent-info-request`, `requestId` echoes the value from the request. ```javascript { type: "zcc-agent-info-response", data: { agentId: AGENT_ID, firstName: AGENT_FIRST_NAME, lastName: AGENT_LAST_NAME, email: AGENT_EMAIL, requestId: REQUEST_ID, // present only when responding to zcc-agent-info-request }, } ``` ### zcc-resize This event fires when a user toggles the size buttons in Smart Embed. Use this to resize your web application. ```javascript { type: "zcc-resize", data: { widthInPixels, heightInPixels, }, }; ``` ## Contact Search These events let Smart Embed search for and link contact records from your CRM or web application. ### zcc-contact-search-event This event fires when Smart Embed needs to resolve phone numbers or email addresses against your web application. This can happen when the agent types in the Smart Embed dialpad's `Phone` or `User` field, or when Smart Embed loads with existing engagements that need to be linked to your web application. ```javascript { type: "zcc-contact-search-event", data: { query: "DATA_TO_SEARCH", // could be a phone number, first name, last name, email, etc. }, } ``` ### zcc-contact-search-response Send this event in response to `zcc-contact-search-event` to provide matching contact information. Search for user, contact, lead, or similar objects in your application based on the query field. Smart Embed displays this data to the agent in the Smart Embed UI. ```javascript { type: "zcc-contact-search-response", data: { id: "THIRD_PARTY_ID", // This is displayed visually to the Contact Center agent in the Smart Embed UI name: "NAME", // This is displayed visually to the Contact Center agent in the Smart Embed UI phone: "PHONE_NUMBER", // Phone number for the user, contact, lead, etc email: "YOUR_STRING", // Email address for the user, contact, lead, etc entity: "YOUR_STRING", // The type of entity used by your application, for example contact/lead/user/etc. Smart Embed uses this to display to the Contact Center agent, but does not use this for any other purpose. }, } ``` ### zcc-incomingPhone-request This event fires when an agent gets an incoming call. It supports the voice channel and the SMS channel. ```javascript { type: "zcc-incomingPhone-request", data: { incomingPhoneNumber: YOUR_CALLER_PHONE_NUMBER, engagementId: YOUR_CALL_ENGAGEMENT_ID, channel: "voice", // Possible values: 'voice', 'sms' }, } ``` ### zcc-incomingPhone-response Send this event in response to `zcc-incomingPhone-request` to provide matching contact information. Search for matching contact records in your application. If there are multiple matches, Smart Embed displays them to the agent to select the appropriate match. If there is no match, respond with an empty array. This data is also included in the `zcc-phone-call-log` event for CRM logging. ```javascript { type: "zcc-incomingPhone-response", data: [ { id: YOUR_ID, name: YOUR_NAME, phone: YOUR_PHONE_NUMBER, email: YOUR_EMAIL_ID, entity: YOUR_ENTITY, // the type of entity used by your application, such as contact, lead, user, etc. }, ], } ``` ### zcc-incomingEmail-request This event fires when an agent gets an incoming chat or video message. It supports the video and chat channels. ```javascript { type: "zcc-incomingEmail-request", data: { email: CONSUMERS_EMAIL, engagementId: ENGAGEMENT_ID, channel: "chat", // Possible values: 'chat', 'video' }, } ``` ### zcc-incomingEmail-response Send this event in response to `zcc-incomingEmail-request` to provide matching contact information. Search for matching contact records in your application. If there are multiple matches, Smart Embed displays them to the agent to select the appropriate match. If there is no match, respond with an empty array. ```javascript { type: "zcc-incomingEmail-response", data: [ { id: ID, name: NAME, phone: PHONE_NUMBER, email: EMAIL_ID, entity: ENTITY, }, ], } ``` ### zcc-screen-pop This event fires when an agent selects a contact from multiple matches. When an incoming call includes multiple contact, lead, or user objects in the `zcc-incomingPhone-response` array, Smart Embed presents them to the agent. When the agent identifies and selects the appropriate object, this event fires so your application can screen pop to the correct record. Use the `id` to search for the matching record and perform a screen pop. ```javascript { type: "zcc-screen-pop", data: { id: ID_NUMBER, }, } ``` ## Voice Call Lifecycle These events track the lifecycle of voice calls from ringing to completion, including call logging and recording. ### zcc-call-ringing This event fires when an agent receives a call. ```javascript { type: "zcc-call-ringing", data: { channel: , createTs: , engagementId: YOUR_CALL_ENGAGEMENT_ID, from: YOUR_CALLER_PHONE_NUMBER, queueName: YOUR_QUEUE_NAME, to: YOUR_CALLEE_PHONE_NUMBER, isConference: , isTransfer: , }, } ``` ### zcc-call-connected This event fires when a call is accepted. ```javascript { type: "zcc-call-connected", data: { acceptTs: ACCEPT_TS_NUMBER, direction: , engagementId: ENGAGEMENT_ID, from: CALLER_PHONE_NUMBER, queueId: THE_QUEUE_ID, queueName: THE_QUEUE_NAME, to: CALLEES_PHONE_NUMBER, agentId: AGENT_ID, }, } ``` ### zcc-call-ended This event fires when a call ends. ```javascript { type: "zcc-call-ended", data: { completeTs: COMPLETE_TS_NUMBER, engagementId: ENGAGEMENT_ID, direction: , }, } ``` ### zcc-outbound-call-started This event fires when an agent starts an outbound voice call to a consumer. ```javascript { type: "zcc-outbound-call-started", data: { "engagementId": ENGAGEMENT_ID, "from": CALLER_PHONE_NUMBER, "to": CALLEES_PHONE_NUMBER, "queueName": QUEUE_NAME, "startTs": OB_START_TIMESTAMP }, }; ``` ### zcc-inbound-not-connected This event fires when an inbound call is missed, rejected, or declined by an agent. ```javascript { type: "zcc-inbound-not-connected", data: { engagementId: ENGAGEMENT_ID, reasonCode: REASON_CODE, message: REASON_MESSAGE, }, }; ``` ### zcc-outbound-not-connected This event fires when an outbound call cannot be placed due to an unserviced phone number. This event does not fire when a call is sent to voicemail. ```javascript { type: "zcc-outbound-not-connected", data: { engagementId: ENGAGEMENT_ID, reasonCode: REASON_CODE, message: REASON_MESSAGE, }, }; ``` ### zcc-call-recording This event fires when an agent completes an engagement. Store this URL in your application for agents to play back recordings. Accessing these URLs requires the user to be signed into Smart Embed and to have access permissions to playback the recording from the Contact Center admin portal. ```javascript { type: "zcc-call-recording", data: { engagementId: ENGAGEMENT_ID, recordingUrl: RECORDING_URL, }, } ``` ### zcc-phone-call-log This event fires when an agent completes an engagement. Use this event to create logs for all engagement types within your application. ```javascript { type: "zcc-phone-call-log", data: { objectRecord: { callType: , from: , to: , callDuration: , callStartTime: , callEndTime: , callQueue: , agentExtension: , agentName: , wrapUpTimeDuration: