The YoLead iframe uses window.postMessage to notify the parent application about integration events.
chat.created
After an outbound message is sent successfully, the iframe sends chat.created to its parent window before navigating to the resulting chat.
Use data.chatId to associate the resulting YoLead chat with the record in your CRM or ERP.
Listen for the event
Always validate both messageEvent.origin and messageEvent.source before using event data. Derive the expected origin from the iframeUrl returned by POST /v1/embed/sessions.