Concepts

Conversations and sources

A conversation is one call or meeting. Sources are how its transcript gets in.

A conversation is one call, meeting or interview. It holds the turns of its transcript and the moments Sparkle found in them, and it has its own clock: turn times are seconds from its started_at.

Who owns what

Your company has one or more organizations, such as one per product or per team. API keys, conversations, webhooks and custom moments belong to one organization, and a key only sees its own organization's data.

A conversation is created in the environment of the key that created it, test or live, and says so in its environment field. Test conversations are never billed.

Create a conversation

@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.

curl https://api.sparkle.ai/public/v1/conversations \
  -H "X-API-Key: $SPARKLE_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Globex onboarding",
    "receivers": ["recall"],
    "moment_types": ["decision", "request.do", "knowledge_gap"],
    "webhook_url": "https://example.com/hooks/sparkle",
    "metadata": { "crm_account": "acct_8812" }
  }'

Every field is optional:

FieldWhat it does
titleA label for the conversation, up to 200 characters.
started_atTime zero of the conversation's clock. Defaults to now; set it when the call began earlier than you create the conversation.
receiversrecall or deepgram: vendors that will post the transcript for you. Each gets a receiver path in the response, shown only once.
moment_typesThe moment kinds to detect, built-in or custom. Empty or absent detects every built-in kind and every live custom moment.
webhook_urlAn HTTPS URL that receives this conversation's events. The response's webhook.secret signs them, shown only once.
metadataYour own JSON, up to 16 KB, returned as sent.

Sources

A source is how a conversation's transcript arrives. Pick the one that matches what you already have:

You haveUse
Your own speech-to-text, or any transcript as it's spokenPost turns to POST /conversations/{id}/turns.
A Recall.ai meeting botThe Recall.ai receiver: Recall posts its transcript to Sparkle.
A Deepgram live streamThe Deepgram receiver: forward Deepgram's results as they come.
A microphone or a meeting tab in a web pageCapture audio in the browser: Sparkle transcribes it.
Raw audio on a server, a phone bridge or a mobile appThe audio streaming protocol.
A finished recording's transcriptImport it with POST /conversations/import.

Every source produces turns under the same turn contract, and every turn records the source it came from. Send each stretch of speech through one source. Sources says when to use each, and covers connections, which create a conversation per call for you.

Lifecycle

statusMeans
liveIt takes turns and detects moments as they arrive.
processingAn imported transcript is being read. progress counts the turns read.
endedIt takes no more turns. Moments still settling go out within seconds, then conversation.ended.

End a live conversation with POST /conversations/{id}/end when the call is over. Sparkle lets go any moment still settling, then sends conversation.ended with a summary of what it found. An imported conversation ends by itself.

A live conversation left open ends by itself too, once no turn has arrived for 60 minutes (counted from when it was created or started, if it never had a turn). An open audio socket keeps it live, even through silence. It ends the same way an end call does, and conversation.ended says why in data.reason:

reasonMeans
requestedYou ended it, with POST /conversations/{id}/end or from the dashboard.
idleNo turn arrived for 60 minutes and no audio socket was open.
completedAn imported transcript was read to its end.
failedAn imported transcript could not be read to its end.

Handle a reason you don't recognize as requested: more may be added.

DELETE /conversations/{id} erases the conversation with its turns, its moments and the webhook deliveries that carry them. Your webhook subscriptions get conversation.deleted.

Read it back

EndpointReturns
GET /conversationsThe organization's conversations, newest first.
GET /conversations/{id}One conversation, with moments_count so far.
GET /conversations/{id}/turnsIts stored turns in start order, partial ones included.
GET /conversations/{id}/momentsIts moments, in the order they were let go.

Lists are cursor-paginated: pass the previous response's page_info.end_cursor as cursor, and up to 100 items per page as limit.

On this page