Skip to main content
This guide walks you through the steps to use the Form filling APIs to authenticate, create a session, provide context, stream audio through the shared Partner WebSocket (GET /ws/stream), end the session, and retrieve structured form output. The WebSocket endpoint and message format are the same as ambient audio streaming. Use the Form filling session ID when establishing the WebSocket connection. What you will do
  1. Authenticate to get an sdp_suki_token (and register the user if needed).
  2. Create a Form filling session and optionally seed context for template metadata.
  3. Stream audio over /ws/stream using your Form filling ambient_session_id, then end the session when the visit is done.
  4. Retrieve structured form output by polling status and structured-data, or rely on a webhook when processing finishes.
Prefer one paste-ready file? Use the Complete staging script in the preferred language below, then follow the numbered steps for the same flow with full explanations.
Using an AI coding tool?Copy the prompt below to point your agent at the Form filling skill and Documentation MCP. For every task skill, refer to AI coding tools.

Fetch the Form filling skill and connect the documentation MCP.

Open in Cursor

Access and credentials

You need partner credentials to use the Suki Form filling API. Contact our Partnership team to get your credentials. They will guide you through the Onboarding process and provide what you need to get started.

Prerequisites

To use the Suki Form filling APIs, you must have the following:
  • An OAuth-compliant authentication system.
  • JWT tokens with consistent user identifiers.
  • A publicly accessible endpoint (or Okta authorization server) for token validation.

Environments to use for development and testing

This guide uses https://sdp.suki-stage.com and wss://sdp.suki-stage.com for API and WebSocket examples (staging).
Important:
  • The production environment is https://sdp.suki.ai and wss://sdp.suki.ai.
  • The staging environment is https://sdp.suki-stage.com and wss://sdp.suki-stage.com.
  • Your partnership team will confirm which environment, base URL, and credentials apply for your integration.

Complete staging script

Replace credential placeholders. For optional context, set FORM_TEMPLATE_ID to a real template UUID from Suki Medical form templates. Put a 16 kHz mono LINEAR16 WAV (or raw PCM) at audio.wav. The numbered steps after this section explain each call in detail.
  • Python: pip install requests websocket-client then python form_filling_staging.py.
  • TypeScript (Node): npm install ws then npx tsx form_filling_staging.ts (Node 18+).

Create your first Form filling session

1

Authenticate to Get a Suki Token

To begin, you must authenticate to get your access token. Send a POST request to the Login API endpoint with the following parameters in the request body:
  • partner_id: Your unique , which we provide to you securely offline.
  • partner_token: The user’s OAuth 2.0 ID token () from your identity provider.
  • provider_id (Optional): Unique identifier for the . Required for Bearer type partners only.
On a successful request, the API returns a (suki_token) that you must include as the sdp_suki_token header for all subsequent API calls.
Handling an unregistered user:
  • If the user is not yet registered in our system, the /login request will fail.
  • In this case, you must first call the Register API endpoint to create the user, then call /login again.
  • You only need to call the register endpoint once for each new user.
Save the suki_token from the response. This token is valid for 1 hour. When it is about to expire, you can get a new one by making the same POST request to /login with a valid partner_token.
2

Create Form Filling Session

Create a seesion by calling the Create Form filling session API endpoint with the following parameters in the request body:
  • ambient_session_id (Optional): Supply your own Form filling session UUID. If omitted, Suki generates one. Do not pass an Ambient API session ID.
  • correlation_id (Optional): Client-supplied identifier for tracing or correlating requests.
Both the Form filling session ID and the Suki Ambient API session ID are named ambient_session_id. Those identifiers refer to different sessions. Use only the ambient_session_id returned from Form filling /session/create for Form filling REST calls and for /ws/stream.
The request body itself is optional (you can send an empty JSON object). The response always includes the ambient_session_id for this Form filling session. Use that value for context, streaming, end, status, and structured-data calls.
3

Seed Context (Optional)

After creating the session, you can send a POST request to the Seed Context API endpoint to provide form template metadata. Skip this step for the minimum path and add it after your first end-to-end run works.
The request body is optional. If you omit it, skip this step and continue to audio capture. If you include form_filling, you must send valid values: an array of objects, each with a required form_template_id (UUID for the template). Providing context improves the quality of structured form output for the templates you select.
Include the following in the request body when you supply context:
  • form_filling (Optional): An object with values, an array of form_template_id entries that identify which Medical form templates apply to this session.
Refer to the Context API reference for the full request structure. To know which templates are available, use Suki Medical form templates API.
4

Stream Audio

Stream visit audio on the Partner WebSocket GET /ws/stream on the same host as REST (for example wss://sdp.suki-stage.com/ws/stream in staging). Authenticate with your Form filling ambient_session_id and sdp_suki_token.The WebSocket message format matches ambient:
  • START_TIME: Base64 of an RFC 3339 timestamp.
  • AUDIO: Base64 LINEAR16 PCM chunks (16 kHz, mono; strip a typical 44-byte WAV header).
  • End marker AUDIO with "data": "RU9G".
Use the complete staging script for a full streaming client. When capture finishes, close the WebSocket, then call end session.
5

End Session

To complete the session and begin processing, send a POST request to the End Session API endpoint. This signals that you will not send more audio for this session.
6

Poll Status and Retrieve Structured Data

For the minimum path, poll Check Status API until a terminal state such as completed, then retrieve output with Retrieve Structured Data API.A completed form is one generated_values item with MEDICAL_FORM_STATUS_COMPLETED and a populated data object. Templates without output appear under non_generated_values.After that works, you can also use a webhook so your partner callback receives completion events with _links to follow for results.
Terminal statuses include completed, failed, and aborted.
For complete technical specifications, refer to the relevant API Reference pages.

Verify your first Form filling API session

Before you design the full production workflow, confirm that your staging integration can complete this minimum path:
  • Authenticate successfully and use the returned sdp_suki_token in follow-up requests.
  • Create a Form filling session and store the returned ambient_session_id.
  • Stream visit audio on /ws/stream with that Form filling session ID.
  • End the session and confirm that Suki starts processing.
  • Poll session status until a terminal state, then retrieve structured data.
After this path works end to end on staging, add form template context, webhooks, recordings, and feedback.

Available tutorials

Form filling

Build a Form filling Session Client

Create a Form filling session, send template context, stream audio, and retrieve structured form data.

20 minIntermediate

Next steps

After completing your first session, add these capabilities when you need them:

Seed Form Filling Context

Bind a medical form template when you need structured form output for a specific template.

Configure Webhooks

Register your callback URL for async Form filling completion.

Form Filling Error Messages

Map Form filling API error codes for create, stream, and retrieve calls.
Last modified on August 26, 2026