API reference

API changelog

Changes to Sparkle's public API, its webhook events and the audio socket, newest first.

Changes to the API at https://api.sparkle.ai/public/v1, the events it sends and the audio socket, newest first. Product news is on the Sparkle changelog.

Versioning and deprecation

Every endpoint sits under /public/v1. Changes that add to the API ship within v1 without notice: new endpoints, new optional request fields, new response fields, new event types and new values in an existing field. Write clients that ignore fields, event types and values they don't know, as the docs ask for a conversation.ended reason and the audio socket's messages. A subscription to * receives event types added later without a change on your side.

A change that breaks a documented behavior of the public API is announced in this changelog and by email to each company's owners, at least 90 days before it takes effect, except where security or the law requires otherwise. The entry says what changes, when, and what to do instead.

2026-12-03

The public API as it stands: conversations and their turns, moments and custom moments, webhooks, audio, connections, the plan and the MCP server.

Across the API

  • Authentication with an API key in the X-API-Key header: spk_test_… for the test environment, never billed, and spk_live_… for live. A personal access token (pat_…) works in the same header. A key acts in one organization. See Security and data.
  • Get the authenticated principal — GET /me
  • Every POST, PUT and PATCH requires an Idempotency-Key header, so a retried request is not processed twice.
  • Most lists are cursor-paginated: pass page_info.end_cursor as cursor, and up to 100 items as limit. A paginated list also carries a Link header.
  • Errors are RFC 9457 problem details with a stable code, which the X-Error-Code header repeats. See Errors.

Resources

Conversations

A conversation takes the environment of the key that creates it. Pass webhook_url to give it its own webhook, and receivers to get a receiver path per vendor. See Conversations and sources.

Turns

  • Add turns — POST /conversations/{id}/turns. A turn sent again under the same id replaces it, and only final turns reach detection, so repeating a batch is safe. See The turn contract.
  • List turns — GET /conversations/{id}/turns, partial ones included, in start order

Moments

The ten built-in kinds are described under Moments, and when each is let go under Timing profiles.

  • List moments — GET /conversations/{id}/moments, in the order they were let go
  • Follow moments in real time — GET /conversations/{id}/stream. Server-sent events: moment.detected, then conversation.ended after the last moment. Send an event's id back as Last-Event-ID to resume after it.

Import

  • Import a finished transcript — POST /conversations/import. Runs a whole transcript through the same detection as a live call, on the transcript's own clock. The conversation is processing until it ends by itself, or with reason: failed if the import can't be recovered. See Import a finished transcript.

Ending a conversation

  • End a conversation — POST /conversations/{id}/end. Lets every pending moment go, then sends conversation.ended.
  • A live conversation also ends by itself once no turn has arrived for 60 minutes and no audio socket is open.
  • conversation.ended carries reason, one of requested, idle, completed or failed. failed is new: an import that can't be recovered ends with it. Treat a value you don't know as requested. See Lifecycle.

Deliveries

Custom moments

A moment kind you define in plain English, tested on a transcript, then run beside the live version before it replaces it. See Custom moments.

  • List custom moments — GET /moments
  • Define a custom moment — POST /moments. It starts as a draft at version 1.
  • Get a custom moment — GET /moments/{id}
  • Update a custom moment — PUT /moments/{id}. Once it has a live_version, a change to its definition writes the next version as a draft, and the live version keeps running.
  • Delete a custom moment — DELETE /moments/{id}. Moments it detected keep its name as their kind.
  • List templates — GET /moments/templates
  • Enable a template — POST /moments/templates/{key}/enable, live at once
  • Evaluate an unsaved custom moment — POST /moments/evaluate
  • Evaluate a custom moment — POST /moments/{id}/evaluate, its current or an earlier version. Both evaluations run over up to 1,000 turns and return where it fired, the threshold a turn needed and up to 3 near_misses: the turns that scored highest without firing, each with its score and a reason, below_threshold or settled_away. With expected labels, they also return hits, misses, false fires and precision.
  • List versions — GET /moments/{id}/versions. While a version runs in shadow, compares it with the live version on the same conversations.
  • Run a version in shadow — POST /moments/{id}/versions/{n}/shadow. Its moments are stored for the comparison and never sent to streams or webhooks.
  • Stop a shadow — DELETE /moments/{id}/versions/{n}/shadow. The version returns to draft.
  • Promote a version — POST /moments/{id}/versions/{n}/promote. The live version is archived and a shadow of this one ends.
  • List a custom moment's fires — GET /moments/{id}/fires, across the organization's conversations. Shadow fires only with include_shadow=true.

Webhooks

Each subscription belongs to the test or live environment and receives only that environment's events; an API key creates subscriptions in its own environment. events: ["*"] receives every event, those added later included. See Webhooks.

Webhook events

Every event has the same envelope, with livemode set to true for a live conversation's events and for a ping to a live subscription.

Audio

Connections

A connection turns every call a vendor sends into a conversation of its own, in the connection's environment. Vendors: recall, deepgram, webhook and zoom. See Recall.ai, Deepgram, Webhook and Zoom; a Zoom connection is made in the dashboard by signing in with Zoom.

For a single conversation, the receivers of POST /conversations give it its own Recall.ai or Deepgram receiver path.

Plan

MCP server

  • POST https://api.sparkle.ai/mcp, beside the public API rather than under /public/v1: an MCP server, over stateless Streamable HTTP, for agents such as Claude Code, Claude Desktop and Cursor. Its tools run conversations, read their moments and write custom moments through the same operations as the API. Clients connect by signing in with OAuth (PKCE, Client ID Metadata Documents or Dynamic Client Registration), choosing the organization and environment on Sparkle's consent screen, or with an API key as a bearer token or in X-API-Key. It acts in that organization and environment; a personal access token is refused.

On this page