> ## Documentation Index
> Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Form Filling Finished Transcript

> Create a Form filling session with input_type transcript, seed a template, submit finished text once, and skip end session

# Submit Form Filling Finished Transcript

Create a Form filling session with `input_type` `transcript`, seed at least one template, submit finished text once, and skip end session. Suki fills the bound forms from the text you provide.

## Problem

Form filling partners often already have finished transcript text from their own ASR or a scribe workflow. They then stream empty audio, call end session, or expect a recording download. Those steps belong to live `stream` sessions, not transcript input.

For Form filling `transcript` sessions, create with that `input_type`, seed at least one template, POST transcript-input with the Form filling session id, and skip end session. Recording returns 404.

## Architecture

![Flowchart: Create transcript, Seed template, POST transcript-input, GET structured-data.](https://mintcdn.com/suki-1e08f176/Srzj30gTyAYo6M-z/documentation/assets/diagrams/cookbooks-submit-finished-transcript-form-filling-1-light.svg?fit=max\&auto=format\&n=Srzj30gTyAYo6M-z\&q=85\&s=449de6c3bb43e00d4f6843e0ddbcd978)

```mermaid actions={false} theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
%%{init: {'theme':'base', 'themeVariables': { 'primaryColor':'#FFFBDE','primaryTextColor':'#1C1C1C','primaryBorderColor':'#FFD147','lineColor':'#6F5410','secondaryColor':'#FFFDF5','tertiaryColor':'#FFEB94','fontSize':'13px'}}}%%
flowchart LR
  A[Create transcript] --> B[Seed template] --> C[POST transcript-input] --> D[GET structured-data]
```

## Prerequisites

> [!TIP]
>
> Completed [Partner onboarding](https://developer.suki.ai/documentation/get-started/partner-onboarding.md) and can obtain `sdp_suki_token` from Login.

> [!TIP]
>
> A real Suki `FORM_TEMPLATE_ID` for your partner account. Do not invent template UUIDs.

> [!TIP]
>
> Finished transcript text as `raw_text` or well-formed `segments`.

## Solution

> [card] Before
>
> [Seed Form Filling with a Suki Template](https://developer.suki.ai/documentation/cookbooks/seed-form-filling-template-context.md)

> [card] This Recipe
>
> Create with `transcript`, seed template context, POST transcript-input once, skip end session.

> [card] Next
>
> Poll Form filling status, then retrieve structured data in [Form filling basic usage](https://developer.suki.ai/documentation/how-to/form-filling/form-filling-basic-usage.md).

Use the Form filling create `ambient_session_id` on the shared transcript-input endpoint. Do not reuse an Ambient clinical-note session id. Seed at least one template before you submit text. Full Form filling staging scripts live in [Submit a finished transcript](https://developer.suki.ai/documentation/how-to/form-filling/submit-finished-transcript.md).

> [tab] TypeScript
>
> ```typescript theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> // submit-finished-transcript-form-filling.ts
> // Flow: create (transcript) → seed context → POST transcript-input → poll status
>
> const BASE_URL = process.env.SUKI_BASE_URL ?? "https://sdp.suki.ai";
> const SDP_SUKI_TOKEN = process.env.SDP_SUKI_TOKEN!; // from Login (suki_token)
> const SDP_PROVIDER_ID = process.env.SDP_PROVIDER_ID!; // required for Bearer / Single Auth
> const FORM_TEMPLATE_ID = process.env.FORM_TEMPLATE_ID!;
> const RAW_TEXT =
>   process.env.RAW_TEXT ??
>   "Good afternoon, doctor. The patient has fever and cough.";
>
> function restHeaders(): Record<string, string> {
>   return {
>     sdp_suki_token: SDP_SUKI_TOKEN,
>     sdp_provider_id: SDP_PROVIDER_ID,
>     "Content-Type": "application/json",
>   };
> }
>
> async function createTranscriptSession(): Promise<string> {
>   const res = await fetch(`${BASE_URL}/api/v1/form-filling/session/create`, {
>     method: "POST",
>     headers: restHeaders(),
>     body: JSON.stringify({ input_type: "transcript" }),
>   });
>   if (res.status !== 201) {
>     throw new Error(`Create Form filling session failed: ${res.status}`);
>   }
>   const { ambient_session_id } = (await res.json()) as {
>     ambient_session_id: string;
>   };
>   return ambient_session_id;
> }
>
> async function seedTemplateContext(
>   ambientSessionId: string,
>   formTemplateId: string
> ): Promise<void> {
>   const res = await fetch(
>     `${BASE_URL}/api/v1/form-filling/session/${ambientSessionId}/context`,
>     {
>       method: "POST",
>       headers: restHeaders(),
>       body: JSON.stringify({
>         values: [{ form_template_id: formTemplateId }],
>       }),
>     }
>   );
>   if (!res.ok) {
>     throw new Error(`Seed Form filling context failed: ${res.status}`);
>   }
> }
>
> async function submitTranscriptInput(
>   ambientSessionId: string,
>   rawText: string
> ): Promise<void> {
>   const res = await fetch(
>     `${BASE_URL}/api/v1/ambient/session/${ambientSessionId}/transcript-input`,
>     {
>       method: "POST",
>       headers: restHeaders(),
>       body: JSON.stringify({ raw_text: rawText }),
>     }
>   );
>   if (!res.ok) {
>     throw new Error(`Transcript submit failed: ${res.status}`);
>   }
> }
>
> const ambientSessionId = await createTranscriptSession();
> await seedTemplateContext(ambientSessionId, FORM_TEMPLATE_ID);
> await submitTranscriptInput(ambientSessionId, RAW_TEXT);
> console.log("Transcript submitted. Do not call end session.", ambientSessionId);
> // Next: poll Form filling status, then GET structured-data. Recording returns 404.
> ```

> [tab] Python
>
> ```python theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> # submit_finished_transcript_form_filling.py
> # Flow: create (transcript) → seed context → POST transcript-input → poll status
> # pip install requests
>
> import os
>
> import requests
>
> BASE_URL = os.environ.get("SUKI_BASE_URL", "https://sdp.suki.ai")
> SDP_SUKI_TOKEN = os.environ["SDP_SUKI_TOKEN"]  # from Login (suki_token)
> SDP_PROVIDER_ID = os.environ["SDP_PROVIDER_ID"]  # required for Bearer / Single Auth
> FORM_TEMPLATE_ID = os.environ["FORM_TEMPLATE_ID"]
> RAW_TEXT = os.environ.get(
>     "RAW_TEXT",
>     "Good afternoon, doctor. The patient has fever and cough.",
> )
>
>
> def rest_headers() -> dict[str, str]:
>     return {
>         "sdp_suki_token": SDP_SUKI_TOKEN,
>         "sdp_provider_id": SDP_PROVIDER_ID,
>         "Content-Type": "application/json",
>     }
>
>
> def create_transcript_session() -> str:
>     res = requests.post(
>         f"{BASE_URL}/api/v1/form-filling/session/create",
>         headers=rest_headers(),
>         json={"input_type": "transcript"},
>         timeout=60,
>     )
>     if res.status_code != 201:
>         raise RuntimeError(f"Create Form filling session failed: {res.status_code}")
>     return res.json()["ambient_session_id"]
>
>
> def seed_template_context(ambient_session_id: str, form_template_id: str) -> None:
>     res = requests.post(
>         f"{BASE_URL}/api/v1/form-filling/session/{ambient_session_id}/context",
>         headers=rest_headers(),
>         json={"values": [{"form_template_id": form_template_id}]},
>         timeout=60,
>     )
>     if res.status_code != 200:
>         raise RuntimeError(f"Seed Form filling context failed: {res.status_code}")
>
>
> def submit_transcript_input(ambient_session_id: str, raw_text: str) -> None:
>     res = requests.post(
>         f"{BASE_URL}/api/v1/ambient/session/{ambient_session_id}/transcript-input",
>         headers=rest_headers(),
>         json={"raw_text": raw_text},
>         timeout=60,
>     )
>     res.raise_for_status()
>
>
> ambient_session_id = create_transcript_session()
> seed_template_context(ambient_session_id, FORM_TEMPLATE_ID)
> submit_transcript_input(ambient_session_id, RAW_TEXT)
> print("Transcript submitted. Do not call end session.", ambient_session_id)
> # Next: poll Form filling status, then GET structured-data. Recording returns 404.
> ```

**1. Create the Form filling session with transcript input**

Call Form filling create with `input_type` set to `transcript`. Store `ambient_session_id`. See [Create Form filling session](https://developer.suki.ai/form-filling-api-reference/form-filling-sessions/create.md).

**2. Seed at least one form template**

`POST /api/v1/form-filling/session/{ambient_session_id}/context` with `{ "values": [{ "form_template_id": "..." }] }`. See [Seed Form Filling with a Suki Template](https://developer.suki.ai/documentation/cookbooks/seed-form-filling-template-context.md).

**3. Submit the transcript once**

Use the Form filling session id on the shared Ambient transcript-input endpoint. Provide `raw_text` or `segments`. Do not call end session. See [Submit transcript input](https://developer.suki.ai/api-reference/ambient-sessions/transcript-input.md).

**4. Poll, then retrieve structured data**

Poll Form filling status until `completed`, then call structured-data. Recording returns 404.

## Try it

> [card]
>
> * **Create returns a Form filling transcript session**
>
>   Create with `input_type: "transcript"` returns HTTP 201 and an `ambient_session_id`. Use that id on transcript-input, not an Ambient clinical-note session id.
>
> * **Context must include a template**
>
>   Seed with `values` and a real `form_template_id` before submit. Empty context means structured results stay empty.
>
> * **Submit starts processing**
>
>   A successful transcript-input call starts generation. Do not call Form filling REST end after submit. Recording returns 404.

## Common mistakes

> [!WARNING]
>
> * Reuse an Ambient clinical-note session id on the shared transcript-input endpoint.
> * Seed after submit, or skip template context entirely.
> * Stream empty audio or call end session after creating a `transcript` session.

## Related cookbooks

Form Filling
API

### [Upload Form Filling Pre-Recorded Audio](https://developer.suki.ai/documentation/cookbooks/upload-prerecorded-form-filling-audio.md)

Form filling audio\_file create, seed, PUT WAV.

10 min

Form Filling
API

### [Seed Form Filling with a Suki Template](https://developer.suki.ai/documentation/cookbooks/seed-form-filling-template-context.md)

List templates, then seed form\_template\_id.

10 min

Run This Recipe

[Open Full Tutorial](https://developer.suki.ai/documentation/tutorials/form-filling-websocket-code-example.md)
[View API Reference](https://developer.suki.ai/api-reference/ambient-sessions/transcript-input.md)

Step-by-step tutorial and API reference for this workflow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.