This guide explains how to embed the CloudTalk Phone interface into your own web application using an
iframe.- Admin
Install the iFrame
Initialization
To embed and initialize CloudTalk Phone:-
Use an
iframewith the following source format:
https://phone.cloudtalk.io?partner=yourappname -
Replace
yourappnamewith your system’s identifier in thepartnerquery parameter.
Requirements
- Minimum dimensions: 700px height × 420px width
- The CloudTalk Phone must be embedded in a Single Page Application (SPA). It should not be reloaded when navigating between views within your app.
Listening to Events
You can register for CloudTalk Phone events usingwindow.onmessage. This allows your system to respond to events such as incoming calls or call hangups (e.g., by showing a contact detail panel or bringing the phone into focus).
The embedded CloudTalk Phone communicates with the parent application using window.postMessage. You can listen using window.onmessage or window.addEventListener("message", ...).
Supported Events
-
ringing– triggered when an incoming call notification appears (call starts ringing in the embedded phone) -
dialing– triggered when a user initiates an outbound call (clicks dial) -
calling– triggered when the call is answered (the other party picks up) -
hangup– triggered when the user clicks the red end-call button (user action) -
ended– triggered when the call session is fully terminated -
contact_info– triggered when contact data related to the call is available or updated
Important Event Behavior
If a user manually ends a call:-
hangupfires first (user action) -
endedfires afterward (session teardown)
ended can also fire without a preceding hangup (for example, when the call is rejected, fails, or ends due to an error).
Recommended usage:
-
Listen to
hangupif you need to react specifically to a user manually ending a call. -
Listen to
endedif you need to detect that the call is fully completed, regardless of how it ended.
Sample Payload
event + properties containing call_uuid, external_number, internal_number, and contact (if available).
Need help or have a question? Just reach out through our Support portal — we’re here for you.