- 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): Associate this Form filling session with an existing Ambient API session when applicable.
- 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
After creating the session, you can send a POST request to the Seed Context API endpoint to provide form template metadata.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
When structured output is ready, Suki can notify your application. The recommended way to know when processing has finished is to use a webhook on the partner callback configured during onboarding. Payloads include
_links you can follow to retrieve results. For verification, payload shapes, and examples, see Form filling asynchronous notifications (webhook) and Notification webhook for partners.Retrieving structured output manually: Alternatively, poll the Form filling REST endpoints:- Check Status API: Check the processing status of a session.
- Retrieve Structured Data API: Retrieve generated_values and non_generated_values for the session. A completed form is one
generated_valuesitem withMEDICAL_FORM_STATUS_COMPLETEDand a populateddataobject. Templates without output appear undernon_generated_values.
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 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.
- Retrieve structured data, or confirm your webhook fires when processing completes.