Skip to main content
REST One HTTPS request for the whole transcript. Extraction and the summary run in the background after it returns. Works in any Python or Node 20+ process, including serverless functions. Push a whole conversation transcript in a single call at the end of a session. Synap records the transcript, enqueues background extraction, and fires a summary compaction, then returns immediately; nothing here sits on a hot path. This is the conversation-end half of the async integration pattern; the conversation-start half is sdk.fetch(context_mode="conversation-summary"). Poll completion with sdk.memories.status(ingestion_id) or sdk.memories.wait_for_completion(ingestion_id).

Parameters

str
required
The client’s own call/conversation id. Any string is accepted: it is not validated as a UUID (unlike record_message). The server coerces it and echoes the original back as external_conversation_id. Reuse a stable id per call (e.g. your telephony provider’s call id, or "{phone}:{call_start_iso}").
str
required
Caller identity, e.g. an E.164 phone number for a voice call.
str | List[TranscriptTurn]
required
The conversation content. A plain string is split by the server on the turn grammar; a List[TranscriptTurn] is preferred because it preserves per-turn timestamps and speaker labels. At most 2,000 turns.
str
Required on B2B (strict-isolation) instances. Not accepted on B2C (equals_customer): the user_id is the whole identity there, and a call carrying a customer_id is rejected with HTTP 400.
str
Free-form label, ≤ 64 chars (e.g. "voice", "text", "video").
Dict[str, Any]
Your own per-call analysis JSON (≤ 64 KB). Stored verbatim (returned by conversation-summary fetches and shown in the dashboard) and fed to extraction as high-confidence hints.
Dict[str, Any]
Open-ended metadata (≤ 64 KB).
datetime
Conversation start time.
datetime
Conversation end time.
Dict[str, str]
The level of your scope ladder this conversation belongs to, for example {"customer": "acme", "team": "payments", "user": "dana"}. Usually needed once per user: once a user has been placed at a level, customer_id and user_id alone reach their whole chain. The path is stored on the conversation (the first one sent is kept), so later conversation fetches use it without being told. Every level above the one you name must be named. A path is refused (400) if it has a gap, or if nested scoping is off or the ladder has not been accepted. Python 0.4.10 and later. JavaScript and TypeScript 0.5.1 and later, as scope_path (or scopePath).

Returns

A TranscriptIngestResponse.
str
The server-coerced (UUID-form) conversation id.
str
The original id you supplied, echoed verbatim.
UUID
Handle for sdk.memories.status() / wait_for_completion(). Always set on success, never null, even on the duplicate branch.
str
"queued" (extraction enqueued) or "duplicate" (the same turns were already pushed under this id).
int
Number of turns stored by this call. It is 0 when the conversation already had turns stored, even though the transcript is still queued for extraction.
str
"in_progress" (compaction enqueued), "already_compacted" (the conversation already has a summary), or "skipped" (no new turns to summarize).
datetime
When the push was accepted.
List[str]
What the server could not do with this push, empty when there is nothing to report: no event time was supplied (send ended_at or per-turn timestamps so recency ranking can order these memories), or the conversation already had turns and they were kept. Python 0.5.17 and JavaScript 0.5.16 and later; before that, read it from .raw.
Every response also exposes .raw: the untyped response dict, for forward compatibility with fields a newer server may add.

Sending the same conversation_id again

The server compares the transcript you send with what it stored for that conversation_id: A transcript is never replaced, so give every call its own conversation_id. If you push a second, different transcript under an id you used before, Synap extracts it again from the new text, and its analysis, type and times replace the first call’s on the conversation. See Conversations and transcripts for when to do that on purpose.

Example

Raises

  • InvalidInputError: an empty transcript, more than 2,000 turns, conversation_type over 64 characters, analysis or metadata over 64 KB, a B2B push without customer_id, or a refused scope_path (HTTP 400/422).
  • InvalidInputError, before any request: an empty conversation_id or user_id, or no transcript (Python 0.5.17 and later).
  • CustomerIdNotAcceptedError, a subclass of InvalidInputError, before any request: a customer_id on a B2C instance (Python 0.5.12 and JavaScript 0.5.16 and later).
  • RateLimitError: too many requests (HTTP 429).
  • InsufficientCreditsError: as applicable.
  • AuthenticationError with the message “SDK not initialized”: when called before await sdk.initialize() (Python). JavaScript resolves the client’s identity on the first call instead.
  • AuthenticationError: when the API key is invalid or revoked. A missing key fails earlier, when the client is created (JavaScript) or initialized (Python).
  • NetworkTimeoutError: the SDK could not reach Synap (a timeout, or a refused or dropped connection) after its retries.

See also