Quick summary
After you create a Form filling session, call
setFormFillingContext with Suki templates and/or partner schemas (schema as a JSON object string on iOS). Record with the same start, pause, and resume controls as Ambient. End with endFormFillingSession() or end(), then call getFormFillingStructuredData(for: recordingId). Optionally submit submitFormFillingFeedback with generatedValues[].id.You need an active Form filling session and a stored
recordingId from create. Refer to Create Form filling session first.- Set form context with
setFormFillingContextusing Suki templates, partner schemas, or both. - Record with
start,pause, andresume, then end withendFormFillingSession()orend(). - Retrieve filled and unfilled forms with
getFormFillingStructuredData(for:). - Submit optional Form filling feedback with
submitFormFillingFeedback. - Handle Form filling events, offline behavior, and context or retrieve errors.
Set Form filling context
After you create a Form filling session, callsetFormFillingContext(with:onCompletion:) to tell Suki which forms to fill. You can call it anytime after create and before end, including after start. You can call it again to update the forms.
- Calling it on an Ambient session returns
noSessionExist. - Calling
setSessionContexton a Form filling session returnsnoSessionExist. valuesmust be non-empty. An invalid shape returnsinvalidContext.
Context parameters
dictionary
required
Top-level Form filling context object. String key:
"form_filling".Static and dynamic entries
Each item invalues must use exactly one mode: a static Suki template or a dynamic partner schema. Never both fields on the same entry, and never neither. One call may mix static and dynamic entries in the same values array.
Example entries
- Static Template
- Dynamic Schema
Swift
Record and end
Form filling uses the same recording controls as Ambient. Callstart, pause, and resume the same way you do for an ambient session. Refer to Recording controls for the full workflow. When the visit is done, end the Form filling session so Suki can generate the form field values.
endFormFillingSession(): Prefer this for Form filling. It checks that the active session is Form filling, then callsend(). Calling it during an Ambient session returnsnoSessionExist.end(): Also ends an active Form filling session.cancel(): Discards the audio and produces no form output.
Retrieve structured data
After you end the session, callgetFormFillingStructuredData(for:) with the recordingId you stored from create. Use the result to drive your form review UI.
There is no Form filling status() API. After end, poll this method or use a Partner webhook.
Do not use Ambient content, transcript, getStructuredData, or listEncounterNotes for this workflow.
Structured data response
A successfulgetFormFillingStructuredData(for:) call returns structuredData with two lists: forms that have filled values, and forms that do not yet.
array
Forms that have filled field values. Show these as completed in your form review UI.
array
Forms that have no filled output yet. These often include only
formTemplateId. Show them as not filled.string
Suki instance id for this form result. Use this value as
formId when you submit Form filling feedback.string
Match this to a static Suki template you sent in context.
string
Match this to the Context
id you sent on a dynamic entry.string
Form type when present.
string
Display title when present. Optional display matching.
string
Instance status when present.
dictionary
Filled field values as
[String: Any].string
Patient id when present.
string
Correlation id for the session when present.
string
Creation timestamp when present.
Map results to the forms you sent
When structured data returns, each item is one form result. Use these fields to connect that result back to the form you put insetFormFillingContext. Do not rely on array order. The list order can differ from the order you sent.
Submit Form filling feedback
After a clinician reviews the filled forms, callsubmitFormFillingFeedback to send a rating and optional comments. Pass the Suki instance id from generatedValues[].id as formId, and use the same recordingId from create. Rating rules match Ambient QuantitativeFeedback. This call requires network. Use submitFormFillingFeedback for forms. Do not use Ambient submitFeedback.
string
required
Suki instance id from
generatedValues[].id.QuantitativeFeedback
required
Rating object with
minRating, maxRating, and rating. Same rules as Ambient QuantitativeFeedback.string
Optional free-text comments.
Session events
Use the sameSukiAmbientSessionDelegate for Form filling recording events: .started, .paused, .resumed, .ended, .cancelled, and .convertedToOfflineSession.
Refer to Session events and delegates.
Do not use
.suggestionsGenerated or .suggestionsGenerationFailed for form-ready UI. Those are Ambient note events. Use structured data or a webhook instead.Offline
Form filling uses the same offline path as Ambient. After a short reconnect buffer, the SDK emits.convertedToOfflineSession, keeps recording with encrypted local audio, and uploads automatically when the network returns. Refer to Offline mode for the full workflow.
Encounter queueing also matches Ambient. The encounter key is the Form filling correlationId (the same key as the Ambient session group). If an unfinished offline session already exists for that key, the next create on the same key also goes offline. Uploads for that encounter run oldest first, so a queued Form filling session is sent before a later Ambient session on the same appointment.
Errors to handle
Handle these errors when you set context, end the session, or retrieve results.
Create-time errors such as
sessionInProgress and remoteSessionConflict(blockingSessionId:) are covered in Create Form filling session. For more error detail, refer to Error messages.
Complete code example
The following example shows a happy path where you create a Form filling session, set a Suki template, start recording, end the session, and retrieve structured data. StorerecordingId from create so you can pass it into retrieve after the visit.
setFormFillingContext after start(), any time before end.
Next steps
Refer to Form filling templates for Suki catalogueform_template_id values.
Refer to Dynamic Form filling for XOR rules and partner schemas.
Refer to Create Form filling session if you still need create and recordingId.
Refer to Recording controls for start, pause, and resume.
Refer to Error messages for SukiAmbientCoreError cases.