GuidesConnections

Webhook connection

One URL any tool can post transcripts to, without code. Sparkle recognises the format.

A webhook connection is one permanent URL that any tool able to send a webhook can post transcripts to: a note-taker's "meeting finished" hook, an AssemblyAI or Rev callback relayed by your server, or a Zapier or Make step. Sparkle reads the body in whatever format it recognises and turns it into a conversation. You write no code against the turns API.

A connection has one of two modes, chosen when you create it:

ModeEach request isIt becomes
transcriptA whole transcript of a finished callA conversation of its own, read through the gate as an import
turnsA batch of turns from a call that is still going onTurns appended to that call's live conversation

Set it up

Create the connection

You can also create it in the dashboard under Sources → Webhook (any tool).

curl -X POST https://api.sparkle.ai/public/v1/connections \
  -H "X-API-Key: $SPARKLE_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"vendor": "webhook", "name": "Note-taker", "environment": "live", "mode": "transcript", "signed": true}'
FieldWhat it does
vendorRequired. webhook.
nameRequired. A label, up to 100 characters.
environmentRequired. live or test: the environment of every conversation it creates. Live ones are billed; test ones count against your test minutes.
modeRequired. transcript or turns, as above. PATCH /connections/{id} with mode changes it.
signedSparkle generates a signing secret, and refuses requests not signed with it. Leave it out when the tool can't sign; the URL alone then admits a request.
moment_typesThe moment kinds its conversations detect. Absent or empty detects every kind.

Sparkle answers 201 Created with the connection, its receiver_url and, when signed, its signing_secret:

{
  "id": "con_2kd9g6j0m4q8u2y6b9cf",
  "vendor": "webhook",
  "mode": "transcript",
  "has_credentials": true,
  "receiver_url": "https://api.sparkle.ai/public/v1/receivers/webhook/<token>",
  "signing_secret": "whsec_…",
  "…": "…"
}

This is the only time you see either. POST /connections/{id}/rotate-url gives the connection a new URL, and the old one stops at once; the secret stays as it was.

Point the tool at the URL

Have the tool POST the transcript to receiver_url. It sends no API key.

curl -X POST "$RECEIVER_URL" \
  -H "Content-Type: text/vtt" \
  -H "Sparkle-Call-Id: meeting-4821" \
  --data-binary @meeting.vtt

Subscribe to the events

A connection's conversations have no webhook_url of their own: their events go to the organization's webhook subscriptions in the connection's environment.

Send a test

POST /connections/{id}/test sends a sample through the connection's own path, signed when the connection is: one utterance asking for work, as a whole transcript, or as a batch and then the call's end. It creates a test conversation, whatever the connection's environment, and answers:

{ "conversation_id": "cnv_2kd9f5k9m3q7u1y5b8de", "error_code": null }

Accepted formats

Sparkle tells the format from the Content-Type and from the body itself, so a tool that sends text/plain for everything still works.

One Speaker: line per utterance, optionally led by an [m:ss] or [h:mm:ss] stamp. A line without a speaker continues the one before it.

Ana Lima: Could you send the notes to the team?
[0:07] Bo Chen: Sure, after this call.

The call ID

A request names its call with the Sparkle-Call-Id header, or else a top-level call_id, external_id or id field of a JSON object. The header wins.

  • transcript mode: optional. A call ID imports once: sending the same call again answers 204 and imports nothing. Without one, every request is a conversation of its own. An optional top-level title names the conversation; otherwise it is Webhook call and the start of the call ID.
  • turns mode: required. Every batch with the same call ID feeds the same conversation, which the first batch creates. A top-level "ended": true ends the call after the batch's own turns; a body of only {"call_id": "…", "ended": true} ends it too. A call nobody ends is ended after 60 minutes without a turn. Send each utterance's times when the tool has them: untimed lines count from zero in each batch, and an untimed line a speaker repeats word for word in a later batch is taken as the same turn, sent again.

Signing

A signed connection refuses a request without a valid Sparkle-Source-Signature header. It is the scheme of the webhooks Sparkle sends:

Sparkle-Source-Signature: t=1764763200,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd

t is the Unix time you sign at, and v1 the hex HMAC-SHA256 of <t>.<raw body>, keyed with the whole secret, whsec_ included. Sign the exact bytes you send. A signature more than 5 minutes from Sparkle's clock is refused.

import { createHmac } from "node:crypto";

const t = Math.floor(Date.now() / 1000);
const v1 = createHmac("sha256", process.env.SPARKLE_SIGNING_SECRET!)
  .update(`${t}.${body}`)
  .digest("hex");
await fetch(process.env.SPARKLE_RECEIVER_URL!, {
  method: "POST",
  headers: { "Content-Type": "application/json", "Sparkle-Source-Signature": `t=${t},v1=${v1}` },
  body,
});

PATCH /connections/{id} with {"credentials": {}} removes the secret, after which the URL alone admits a request. An unsigned connection's URL is its only credential: keep it like an API key.

Payloads and re-run

The connection keeps each request it read, up to the latest 50 of the last 24 hours: GET /connections/{id}/payloads lists them, newest first, with the format each was read as, its call ID, its turn count, its conversation, its error code and the first 2 KB of its body. A request whose signature failed is never kept. Deleting the connection, or the conversation a payload fed, deletes the payload.

POST /connections/{id}/payloads/{payload_id}/rerun runs a kept payload through the connection again, as if it had just arrived, and answers like a test. Use it after fixing what refused it, such as your plan's limit. A whole transcript whose call already has a conversation imports nothing again.

When transcripts don't arrive

GET /connections/{id} returns last_event_at and last_error_code, the reason the latest request was not taken. It is null again once a request goes through.

last_error_codeMeans
unrecognized_formatThe body is in none of the formats above. The 422's detail says what was missing.
invalid_payloadThe body was read, but its turns break the turn contract, a turns batch named no call, or its call has ended.
invalid_signatureA signed connection got a request without a valid signature.
plan_limitYour plan refused the call: its minutes are used up, or it runs as many live conversations as it allows.
suspendedYour company is suspended.
failedAnything else that kept the turns out. The payload is kept: re-run it.

Responses and limits

StatusMeaning
204Accepted. A call your plan refused, or a suspended company's, is a 204 too, and shows in last_error_code. So is a disabled connection's, which records nothing.
401The URL names no webhook connection, or a signed connection's signature is missing, stale or wrong.
413The body is larger than 5 MB.
422Unprocessable: unprocessable.transcript_format for a body in no known format, unprocessable.transcript_invalid for one whose turns can't be taken.
429More than 120 requests in a minute to one connection URL.

A whole transcript holds up to 5,000 turns; a turns batch up to 500.

On this page