Guides

Import a finished transcript

Run a recorded call's transcript through the same detection as a live one.

Not every conversation reaches you live. A Zoom cloud recording, a notetaker's export or last quarter's calls arrive as a finished transcript. Import one, and Sparkle reads it the way it would have read the call live: same moment kinds, same timing, the same events on the stream and the webhooks.

@sparkle/sdk is in private beta

The TypeScript tabs use @sparkle/sdk, which isn't on npm yet. To try it, ask us for access. Python and Go have no SDK yet: the cURL, Python and Go tabs call the HTTP API directly.

1. Convert the transcript to turns

An import takes the same turns as a live conversation, with times in seconds from the start of the recording. Most formats map onto them in a few lines. A Zoom transcript is a WebVTT file in which each cue is one speaker's line:

acme-renewal.vtt
WEBVTT

1
00:00:00.800 --> 00:00:04.100
Sam Lee: Okay, let's go with the two-year term at the current tier.

2
00:00:05.000 --> 00:00:07.300
Dana Ortiz: Great, that works for us.

3
00:00:21.000 --> 00:00:23.400
Dana Ortiz: And I'll get the SSO fix out by Friday.

Each cue becomes one final turn. The name before the colon is the speaker's name, and a key made from it is the speaker. A cloud recording has no local microphone, so every turn is remote:

vtt-to-turns.ts
interface Turn {
  id: string;
  final: true;
  speaker: string;
  name: string;
  channel: "remote";
  start: number;
  end: number;
  text: string;
}

// "00:01:02.500" or "01:02.500" to seconds.
function seconds(stamp: string): number {
  return stamp.split(":").reduce((total, part) => total * 60 + Number(part), 0);
}

export function vttToTurns(vtt: string): Turn[] {
  const turns: Turn[] = [];
  for (const cue of vtt.split(/\r?\n\r?\n/)) {
    const lines = cue.trim().split(/\r?\n/);
    const at = lines.findIndex((line) => line.includes("-->"));
    if (at === -1) continue;
    const [start, end] = lines[at].split("-->").map((stamp) => seconds(stamp.trim().split(" ")[0]));
    const said = lines.slice(at + 1).join(" ");
    const colon = said.indexOf(": ");
    const name = colon > 0 ? said.slice(0, colon) : "Unknown speaker";
    turns.push({
      id: `cue_${turns.length + 1}`,
      final: true,
      speaker: name.toLowerCase().replace(/[^a-z0-9]+/g, "_"),
      name,
      channel: "remote",
      start,
      end,
      text: colon > 0 ? said.slice(colon + 2) : said,
    });
  }
  return turns;
}

The three cues above become:

[
  {
    "id": "cue_1",
    "final": true,
    "speaker": "sam_lee",
    "name": "Sam Lee",
    "channel": "remote",
    "start": 0.8,
    "end": 4.1,
    "text": "Okay, let's go with the two-year term at the current tier."
  },
  {
    "id": "cue_2",
    "final": true,
    "speaker": "dana_ortiz",
    "name": "Dana Ortiz",
    "channel": "remote",
    "start": 5.0,
    "end": 7.3,
    "text": "Great, that works for us."
  },
  {
    "id": "cue_3",
    "final": true,
    "speaker": "dana_ortiz",
    "name": "Dana Ortiz",
    "channel": "remote",
    "start": 21.0,
    "end": 23.4,
    "text": "And I'll get the SSO fix out by Friday."
  }
]

2. Import it

Send the turns, up to 5,000 in any order, to POST /conversations/import. The other fields are the ones a live conversation takes: title, metadata, moment_types and webhook_url.

curl https://api.sparkle.ai/public/v1/conversations/import \
  -H "X-API-Key: $SPARKLE_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @import.json

import.json holds the turns and the other fields:

import.json
{
  "title": "Acme renewal call (recording)",
  "webhook_url": "https://example.com/hooks/sparkle",
  "turns": [
    {
      "id": "cue_1",
      "final": true,
      "speaker": "sam_lee",
      "name": "Sam Lee",
      "channel": "remote",
      "start": 0.8,
      "end": 4.1,
      "text": "Okay, let's go with the two-year term at the current tier."
    }
  ]
}

Sparkle answers 202 Accepted at once, with the conversation processing:

{
  "conversation": {
    "id": "cnv_2kd9c3f6j0m4q8u2y5bg",
    "tenant_id": "ten_2kd5m0c8w3e7h1p4s9fa",
    "organization_id": "org_2kd5m0d2y6b0k4n8r1gc",
    "environment": "test",
    "status": "processing",
    "title": "Acme renewal call (recording)",
    "metadata": {},
    "moment_types": [],
    "moments_count": 0,
    "progress": { "turns_done": 0, "turns_total": 3 },
    "started_at": "2026-12-03T17:00:00Z",
    "webhook": {
      "id": "whs_2kd9c3g8l2p6t0x4a7dh",
      "url": "https://example.com/hooks/sparkle"
    },
    "created_at": "2026-12-03T17:00:00Z",
    "updated_at": "2026-12-03T17:00:00Z"
  },
  "webhook": {
    "id": "whs_2kd9c3g8l2p6t0x4a7dh",
    "url": "https://example.com/hooks/sparkle",
    "secret": "whsec_4b9e2d7a1c6f0e5b8a3d2c1f0e9b8a7d6c5f4e3d"
  }
}

As with a live conversation, webhook.secret is shown only in this response.

3. Receive the moments

Sparkle reads the transcript on its own clock: the quiet windows and cooldowns of each timing profile are measured in recording time, so you get the moments a live run of the same call would have produced. They arrive as they're let go, on the conversation's stream and as moment.detected webhooks, exactly as they would live.

Follow progress with GET /conversations/{id}:

curl https://api.sparkle.ai/public/v1/conversations/$CONVERSATION_ID \
  -H "X-API-Key: $SPARKLE_API_KEY"

progress.turns_done counts the turns read so far. When the last one is read and its moments are out, the conversation's status becomes ended by itself and conversation.ended is sent, last, with the summary.

While a conversation is processing:

  • Posting turns to it is refused with 409: an import is the whole transcript.
  • POST /conversations/{id}/end does nothing. It ends on its own.
  • Only final turns are read.

On this page