Skip to main content
If you call note or content APIs right after ending an ambient session, you often get empty or incomplete results. Generation is async. Closing the WebSocket and a successful REST end do not mean the note is ready. Retrieve content only when status is completed. Stop polling on skipped, failed, or aborted.

Common causes

  • Calling content APIs before status is completed.
  • Treating WebSocket close as โ€œgeneration finished.โ€
  • Skipping RU9G, socket close, or REST end before you poll.
  • Polling forever after skipped, failed, or aborted.

Fix

1

Finish the Stream Correctly

After the last PCM chunk, send the ambient end marker {"type":"AUDIO","data":"RU9G"}, close the WebSocket, then call POST /api/v1/ambient/session/{ambient_session_id}/end with sdp_suki_token and sdp_provider_id. Socket close alone does not complete the session.
2

Poll GET /status

Call GET /api/v1/ambient/session/{ambient_session_id}/status with sdp_suki_token and sdp_provider_id until status is completed, or stop on skipped, failed, or aborted. See Wait for Ambient before fetch.
3

Stop on Terminal States

Return when status is completed. Stop polling when status is skipped, failed, or aborted. Do not keep calling content APIs expecting a note.
4

Retrieve Content After Completed

Call session content or note content APIs only when status is completed. Prefer note_id with the note content API for the shared clinical note when your flow provides it.
Sessions shorter than 1 minute may not contain enough audio for note generation and can be marked as skipped. Plan your integration to handle that outcome without retrying content retrieval.
Poll status after REST end before you call content APIs. WebSocket close alone does not mean the note is ready.

Next steps

Wait for Ambient before fetch - Poll status until completed before content APIs Fetch note by Note ID - Retrieve the note after status is completed Complete the session after streaming - Close socket, REST end, then retrieve WebSocket disconnects during ambient streaming - Keep-alives, RU9G, and reconnect rules Content generation is taking too long - Slow generation vs failed sessions
Last modified on September 29, 2026