- Authenticate to get an
sdp_suki_token(and register the user if needed). - Create a Form filling session and optionally seed context for template metadata.
- Stream audio over
/ws/streamusing your Form fillingambient_session_id, then end the session when the visit is done. - Retrieve structured form output by polling status and structured-data, or rely on a webhook when processing finishes.
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 useshttps://sdp.suki-stage.com and wss://sdp.suki-stage.com for API and WebSocket examples (staging).
Important:
- The production environment is
https://sdp.suki.aiandwss://sdp.suki.ai. - The staging environment is
https://sdp.suki-stage.comandwss://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, setFORM_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-clientthenpython form_filling_staging.py. - TypeScript (Node):
npm install wsthennpx 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.
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
/loginrequest will fail. - In this case, you must first call the Register API endpoint to create the user, then call
/loginagain. - You only need to call the register endpoint once for each new user.
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:The request body itself is optional (you can send an empty JSON object). The response always includes the
- 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.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.Include the following in the request body when you supply context:
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.- form_filling (Optional): An object with
values, an array ofform_template_identries that identify which Medical form templates apply to this session.
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
AUDIOwith"data": "RU9G".
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_tokenin follow-up requests. - Create a Form filling session and store the returned
ambient_session_id. - Stream visit audio on
/ws/streamwith 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.
Available tutorials
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.