Embedding Call Data
Embed the ready-made public call page in an iframe, or fetch the recording and transcript and render your own player.
Showing instructions for Xebit VoiceCloud.Showing instructions for Xebit VoiceKit, on your own infrastructure. Switch with the selector at the top. Updated 22 October 2026.
With Public call share switched on, each call.completed webhook carries public, no login links to the call's recording, its transcript and a ready-made details page. You can either drop that page into an <iframe> with no code at all, or fetch the recording and transcript and build your own player.
Prerequisites
Switch on Public call share under the Xebit VoiceCloud dashboard → Account Settings → Organisationthe Xebit VoiceKit admin console → Account Settings → Organisation. From then on your webhook payloads include:
| Field | What it is |
|---|---|
call_details_url | Public URL of a ready-made page with Call Details, Insights, Recording & Transcript and Appointments. |
share_token | The token inside call_details_url, given separately for direct API use. |
call_recording | Public URL of the audio file, in place of a 5 minute signed URL. |
call_transcript | Public URL of the transcript JSON, in place of a 5 minute signed URL. |
The full field reference is under Outbound Webhooks.
Option 1: embed the ready-made page
Put call_details_url straight into an <iframe>. There is nothing to fetch or parse.
<iframe
src="https://voice.xebit.ai/public/call/call_987654321?share_token=8f2a1c9d4e7b0a3c6f5d2e1b9a8c7d6e5f4a3b2c"
style="width: 100%; height: 700px; border: 0;"
title="Call details"
></iframe><iframe
src="https://<your-xebit-voicekit-host>/public/call/call_987654321?share_token=8f2a1c9d4e7b0a3c6f5d2e1b9a8c7d6e5f4a3b2c"
style="width: 100%; height: 700px; border: 0;"
title="Call details"
></iframe>On Xebit VoiceCloud the page sends no X-Frame-Options or Content-Security-Policy: frame-ancestors header, and the API behind it answers with Access-Control-Allow-Origin: *, so it renders on any domain. No cookies are involved; access rests entirely on the share_token query parameter.
On Xebit VoiceKit the page is served from your own host, so framing and cross-origin behaviour also depend on any reverse proxy or gateway in front of it. Make sure nothing in that path adds X-Frame-Options or a restrictive frame-ancestors policy for the sites that will embed it. No cookies are involved; access rests entirely on the share_token query parameter.
If your page puts a restrictive sandbox attribute on the <iframe>, allow at least allow-scripts allow-same-origin allow-popups. The "add to Google Calendar" link shown for calls with a matched appointment opens a new tab and needs allow-popups. The page fills the size you give it and does not grow with its content, so set an explicit height.
Option 2: build your own player
Choose this when you want your own interface, such as a custom audio player or a transcript styled to match your app.
Parsing call_transcript
call_transcript is normally a URL (signed, or permanent with Public call share on) to a JSON file: fetch it and parse the response like any JSON API. It only arrives as an inline array for calls that never produced a transcript file. Handle both:
const { call_transcript } = payload.data;
let transcript;
if (typeof call_transcript === "string") {
transcript = await fetch(call_transcript).then(r => r.json()); // decoded JSON
} else if (Array.isArray(call_transcript)) {
transcript = call_transcript; // inline fallback
} else {
transcript = []; // null: no transcript
}
// transcript: [{ speaker: "agent" | "user", text: string, timestamp: number }, ...]import requests
call_transcript = data.get("call_transcript")
if isinstance(call_transcript, str):
transcript = requests.get(call_transcript).json()
elif isinstance(call_transcript, list):
transcript = call_transcript
else:
transcript = []The public call endpoint
/public/call/{call_id}?token={share_token}When you have a share_token you can skip the string-or-array check and call this endpoint, which returns the call, insights, transcript, appointments and recording URL as JSON. Its transcript field is always a plain, decoded array. No API key is needed; the token is the credential.
curl -s "https://api.voice.xebit.ai/public/call/call_987654321?token=$SHARE_TOKEN"import requests
HOST = "https://api.voice.xebit.ai"
call_id = "call_987654321"
share_token = "8f2a1c9d4e7b0a3c6f5d2e1b9a8c7d6e5f4a3b2c"
response = requests.get(f"{HOST}/public/call/{call_id}", params={"token": share_token})
data = response.json()["data"]
print(data["transcript"]) # always a decoded array hereconst HOST = "https://api.voice.xebit.ai";
const callId = "call_987654321";
const shareToken = "8f2a1c9d4e7b0a3c6f5d2e1b9a8c7d6e5f4a3b2c";
const res = await fetch(`${HOST}/public/call/${callId}?token=${shareToken}`);
const { transcript } = (await res.json()).data; // always a decoded array here
console.log(transcript);curl -s "https://<your-xebit-voicekit-host>/public/call/call_987654321?token=$SHARE_TOKEN"import requests
HOST = "https://<your-xebit-voicekit-host>"
call_id = "call_987654321"
share_token = "8f2a1c9d4e7b0a3c6f5d2e1b9a8c7d6e5f4a3b2c"
response = requests.get(f"{HOST}/public/call/{call_id}", params={"token": share_token})
data = response.json()["data"]
print(data["transcript"]) # always a decoded array hereconst HOST = "https://<your-xebit-voicekit-host>";
const callId = "call_987654321";
const shareToken = "8f2a1c9d4e7b0a3c6f5d2e1b9a8c7d6e5f4a3b2c";
const res = await fetch(`${HOST}/public/call/${callId}?token=${shareToken}`);
const { transcript } = (await res.json()).data; // always a decoded array here
console.log(transcript);Non-Latin text works as is. Transcripts are standard JSON. Hindi, Arabic, emoji and other characters may appear as \uXXXX escapes in the raw file, but JSON.parse(), response.json() and Python's .json() decode them as part of normal parsing. Opening a transcript URL directly in a browser tab shows the raw escapes as text; that is unparsed file content, not damaged data. Pipe it through jq or python3 -m json.tool to read it decoded.
Minimal example: recording and transcript
The smallest page that plays the recording and prints the transcript. A good starting point before the styled version below.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Call recording and transcript</title>
</head>
<body>
<audio id="player" controls style="width: 100%"></audio>
<pre id="transcript">Loading transcript...</pre>
<script>
// Put the call_id and share_token from your webhook payload here, or use
// call_recording / call_transcript directly: these routes are what they point to.
const RECORDING_URL = "https://api.voice.xebit.ai/public/call/recording/{call_id}?token={share_token}";
const TRANSCRIPT_URL = "https://api.voice.xebit.ai/public/call/transcript/{call_id}?token={share_token}";
document.getElementById("player").src = RECORDING_URL;
fetch(TRANSCRIPT_URL)
.then(res => res.json()) // follows the redirect and decodes \uXXXX for you
.then(transcript => {
document.getElementById("transcript").textContent = JSON.stringify(transcript, null, 2);
})
.catch(err => {
document.getElementById("transcript").textContent = "Error: " + err;
});
</script>
</body>
</html><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Call recording and transcript</title>
</head>
<body>
<audio id="player" controls style="width: 100%"></audio>
<pre id="transcript">Loading transcript...</pre>
<script>
// Put the call_id and share_token from your webhook payload here, or use
// call_recording / call_transcript directly: these routes are what they point to.
const RECORDING_URL = "https://<your-xebit-voicekit-host>/public/call/recording/{call_id}?token={share_token}";
const TRANSCRIPT_URL = "https://<your-xebit-voicekit-host>/public/call/transcript/{call_id}?token={share_token}";
document.getElementById("player").src = RECORDING_URL;
fetch(TRANSCRIPT_URL)
.then(res => res.json()) // follows the redirect and decodes \uXXXX for you
.then(transcript => {
document.getElementById("transcript").textContent = JSON.stringify(transcript, null, 2);
})
.catch(err => {
document.getElementById("transcript").textContent = "Error: " + err;
});
</script>
</body>
</html>/public/call/recording/{call_id} and /public/call/transcript/{call_id} are the redirect endpoints behind the call_recording and call_transcript fields. Calling them with {call_id} and token={share_token} behaves exactly like using the URLs from the payload.
Do not write your own \uXXXX decoder. response.json() already decodes standard JSON escapes before your code sees the string. If you still see literal \uXXXX after parsing, look for double encoding upstream, such as JSON.stringify() applied to a value that was already a JSON escaped string, or a Content-Type mismatch that makes fetch treat the body as plain text. If res.json() ever throws on a body you expect to be JSON, fall back to res.text() and JSON.parse().
Full example: audio player and transcript turns
A self-contained page with no dependencies or build step. Pass call_recording and call_transcript as query parameters (or template them in on the server) and it renders an audio player and the transcript as agent and customer turns, in light or dark mode.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Call recording and transcript</title>
<style>
:root { --bg: #ffffff; --text: #0f172a; --muted: #64748b;
--agent-bg: #f1f5f9; --agent-text: #0f172a; --user-bg: #0f172a; --user-text: #ffffff; }
@media (prefers-color-scheme: dark) {
:root { --bg: #0f172a; --text: #f1f5f9; --muted: #94a3b8;
--agent-bg: #1e293b; --agent-text: #f1f5f9; --user-bg: #f1f5f9; --user-text: #0f172a; }
}
body { margin: 0; padding: 20px; background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; }
.card { max-width: 640px; margin: 0 auto; }
audio { width: 100%; margin-bottom: 20px; }
.status { color: var(--muted); font-size: 14px; padding: 20px 0; }
.turn { display: flex; margin-bottom: 12px; }
.turn.agent { justify-content: flex-start; }
.turn.user { justify-content: flex-end; }
.bubble { max-width: 75%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.turn.agent .bubble { background: var(--agent-bg); color: var(--agent-text); }
.turn.user .bubble { background: var(--user-bg); color: var(--user-text); }
.meta { display: block; font-size: 11px; opacity: 0.6; margin-top: 4px; }
</style>
</head>
<body>
<div class="card">
<audio id="player" controls></audio>
<div id="transcript"></div>
</div>
<script>
// ?audio=<call_recording>&transcript=<call_transcript>, or hard code both
const params = new URLSearchParams(window.location.search);
const AUDIO_URL = params.get("audio") || "";
const TRANSCRIPT = params.get("transcript") || "";
const player = document.getElementById("player");
const box = document.getElementById("transcript");
if (AUDIO_URL) player.src = AUDIO_URL;
const fmt = s => (s == null || isNaN(s)) ? "" :
`${Math.floor(s / 60)}:${Math.floor(s % 60).toString().padStart(2, "0")}`;
const escapeHtml = str => { const d = document.createElement("div"); d.textContent = str ?? ""; return d.innerHTML; };
function render(turns) {
box.innerHTML = "";
if (!Array.isArray(turns) || turns.length === 0) {
box.innerHTML = '<div class="status">No transcript for this call.</div>';
return;
}
for (const t of turns) {
const role = t.speaker === "agent" ? "agent" : "user";
const row = document.createElement("div");
row.className = `turn ${role}`;
row.innerHTML = `<div class="bubble">${escapeHtml(t.text)}
<span class="meta">${role === "agent" ? "Agent" : "Customer"} · ${fmt(t.timestamp)}</span></div>`;
box.appendChild(row);
}
}
(async () => {
if (!TRANSCRIPT) { box.innerHTML = '<div class="status">No transcript URL given.</div>'; return; }
box.innerHTML = '<div class="status">Loading transcript...</div>';
try {
const turns = TRANSCRIPT.startsWith("http")
? await (await fetch(TRANSCRIPT)).json()
: JSON.parse(TRANSCRIPT);
render(turns);
} catch (err) {
box.innerHTML = `<div class="status">Could not load transcript: ${err.message}</div>`;
}
})();
</script>
</body>
</html>In production, template the two values on the server, or send them with postMessage after the iframe loads, instead of relying on query parameters: long signed storage URLs can run into URL length limits.
Security summary
- Access is entirely token based (
share_token, or thetokenquery parameter). There are no cookies or logins to clash with your own site's session policy. - On Xebit VoiceCloud the page sends no frame blocking headers and the API sends
Access-Control-Allow-Origin: *. - On Xebit VoiceKit, check the headers your own proxy or gateway adds in front of the public routes.
- One token gates all three public links for a call:
call_details_url,call_recordingandcall_transcript. - Switching Public call share off for your organisation immediately invalidates every link issued so far. There is no need to revoke links one by one.