> ## 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 Transcript Input

> Submit finished transcript text for an Ambient or Form filling session created with input_type transcript

Use this endpoint to submit a completed transcript of a patient encounter when your application wants Suki to generate a clinical note or Form filling output from the transcript. Create the session with `input_type` set to `transcript`, then submit the transcript using either `raw_text` or `segments`.

Suki uses the submitted text as the source for generating the clinical note or Form filling output. Your application does not need to stream or upload the encounter audio to Suki. It can obtain the transcript through its own recording and transcription workflow and submit the completed text.

> [!NOTE]
>
> Submit the transcript **once per session**. A successful submission starts processing automatically. Do not call end session for `transcript` sessions.

## Choose the correct session ID

This endpoint supports both Ambient and Form filling:

* **Ambient:** Pass the `ambient_session_id` of the Ambient session.
* **Form filling:** Pass the `ambient_session_id` of the Form filling session.

Create the session with `input_type: "transcript"` before submitting the transcript. Calling this endpoint when the session `input_type` is not `transcript` returns **`ING_SDK_005`**.

> [!WARNING]
>
> Do not use an ID created during an Ambient session for a Form filling session, or vice versa.

> [!NOTE]
>
> * You can submit the transcript only once per session. After a successful submission, the job advances from **created** to **ready**. A second submission returns an error.
>
> * Because this workflow uses transcript text instead of source audio, [Get recording](https://developer.suki.ai/api-reference/ambient-content/recording.md) returns **HTTP 404**. No source audio is available for the session.

> [!TIP]
>
> * For the complete product workflow, refer to [Submit a finished transcript](https://developer.suki.ai/documentation/how-to/ambient-clinical-notes/submit-finished-transcript).
>
> * To understand how `transcript` compares with `stream` and `audio_file`, refer to [Session input types](https://developer.suki.ai/documentation/concepts/ambient-clinical-notes/session-input-types.md).

## Request body

Provide either `raw_text` or `segments` in the request body. One of the two is required.

| Field | Type | Description |
| :- | :- | :- |
| `raw_text` | string | The complete transcript text. Required when `segments` is omitted. |
| `segments` | array | An array of transcript segments. Required when `raw_text` is omitted. Each segment must include `text`. |
| `segments[].text` | string | The text of the segment. Required for each segment. |
| `segments[].words` | array | Optional word-level timing information and speaker labels. |
| `segments[].words[].word` | string | The text of an individual word or token. |
| `segments[].words[].start_time` | string | The word's start time in ISO 8601 format. |
| `segments[].words[].end_time` | string | The word's end time in ISO 8601 format. |
| `segments[].words[].speaker.id` | string | Optional speaker identity when diarization is available. |

### Word timing requirements

If you include word-level timings, follow these requirements:

* Each word's `end_time` must be greater than or equal to its `start_time`.
* Word timings must not overlap across segments.

### Retrieve the generated content

After submitting the transcript successfully, poll status for the same product you created, or wait for your configured webhook. Use [Get ambient session status](https://developer.suki.ai/api-reference/ambient-content/status.md) for Ambient, or [Form filling session status](https://developer.suki.ai/form-filling-api-reference/form-filling-sessions/status.md) for Form filling.

Once processing completes, retrieve the generated content using the same GET endpoints you use for streamed sessions on that product.

## Errors for this endpoint

The following errors are specific to the transcript input flow:

| Error id | HTTP status | Cause |
| :- | :- | :- |
| `ING_SDK_004` | 400 | The request payload is invalid. Provide `raw_text` or a well-formed `segments` array. |
| `ING_SDK_005` | 412 | The session `input_type` is not `transcript`. |
| `ING_SDK_006` | 412 | A transcript has already been submitted for the session. |
| `transcript modality is not enabled` | 403 | The `transcript` input path is disabled for the environment. |

For shared authentication and session errors, refer to [Error messages](https://developer.suki.ai/api-reference/error-messages.md).

To use the correct `ambient_session_id` for Ambient and Form filling transcript input and audio file uploads, refer to How should developers handle ambient\_session\_id for [Transcript input and audio file upload?](https://developer.suki.ai/api-reference/faqs/audio-capture-streaming.md#ambient-session-id-for-input-types).

## Code examples

**Language tabs (agents):** Equivalent code samples are available in: Python, TypeScript. Humans see one language at a time. Use the variant that matches the user's stack; behavior is the same across tabs.

> [tab] Python
>
> ```python expandable theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> import requests
>
> # Session must be created with input_type "transcript" and still be created.
> # Use the Ambient or Form filling ambient_session_id for that product. Do not call end.
> # Provide raw_text or segments (one required). Submit once per session.
> BASE_URL = "https://sdp.suki.ai"
> ambient_session_id = "123dfg-456dfg-789dfg-012dfg"
>
> headers = {
>     "sdp_suki_token": "<sdp_suki_token>",
>     "sdp_provider_id": "<sdp_provider_id>",  # Required for single_auth partners
>     "Content-Type": "application/json",
> }
>
> payload = {
>     "raw_text": "Good afternoon, doctor. The patient has fever and cough.",
> }
>
> response = requests.post(
>     f"{BASE_URL}/api/v1/ambient/session/{ambient_session_id}/transcript-input",
>     headers=headers,
>     json=payload,
>     timeout=60,
> )
> response.raise_for_status()
> print(
>     "Transcript submitted. Poll Ambient or Form filling status for this session, "
>     "or wait for the webhook. Do not call end. Recording returns 404."
> )
> ```

> [tab] TypeScript
>
> ```typescript expandable theme={"theme":{"light":"one-light","dark":"material-theme-darker"}}
> // Session must be created with input_type "transcript" and still be created.
> // Use the Ambient or Form filling ambient_session_id for that product. Do not call end.
> // Provide raw_text or segments (one required). Submit once per session.
> const BASE_URL = "https://sdp.suki.ai";
> const ambientSessionId = "123dfg-456dfg-789dfg-012dfg";
>
> const response = await fetch(
>   `${BASE_URL}/api/v1/ambient/session/${ambientSessionId}/transcript-input`,
>   {
>     method: "POST",
>     headers: {
>       sdp_suki_token: "<sdp_suki_token>",
>       sdp_provider_id: "<sdp_provider_id>", // Required for single_auth partners
>       "Content-Type": "application/json",
>     },
>     body: JSON.stringify({
>       raw_text: "Good afternoon, doctor. The patient has fever and cough.",
>     }),
>   },
> );
>
> if (!response.ok) {
>   throw new Error(`Submit failed: ${response.status} ${await response.text()}`);
> }
>
> console.log(
>   "Transcript submitted. Poll Ambient or Form filling status for this session, or wait for the webhook. Do not call end. Recording returns 404."
> );
> ```


## OpenAPI

````yaml POST /api/v1/ambient/session/{ambient_session_id}/transcript-input
openapi: 3.0.1
info:
  title: Suki Developer Platform
  description: >-
    REST and WebSocket APIs for the Suki Developer Platform. Authenticate with
    Login or Register to obtain a Suki access token, then integrate ambient
    clinical documentation, form filling, transcription, content rewrite, and
    reference metadata endpoints.
  contact: {}
  version: '1.0'
servers:
  - url: https://sdp.suki.ai
    description: >-
      Production base URL for Suki Developer Platform REST APIs. WebSocket
      endpoints use the same host with `wss://`.
security:
  - SukiTokenAuth: []
paths:
  /api/v1/ambient/session/{ambient_session_id}/transcript-input:
    post:
      tags:
        - /api/v1/ambient/session
      summary: Submits a finished transcript for a transcript session.
      description: >-
        Submits partner-supplied transcript text for an
        **input_type=transcript** session that is still **created**. ASR is
        skipped. Either `raw_text` or `segments` is required.


        Works for both Ambient and Form filling sessions created with
        `input_type=transcript`. One submit per session. After submit, the job
        advances created → ready and artifacts are fetched via the existing GET
        endpoints (`/content`, `/transcript`, `/structured-data`). `/recording`
        returns 404.


        **ING_SDK_004**: invalid payload (`raw_text` or `segments` required;
        segments must be well-formed). **ING_SDK_005**: session `input_type` is
        not `transcript`. **ING_SDK_006**: transcript already submitted.
      parameters:
        - name: ambient_session_id
          in: path
          description: >-
            Session ID from create. For Ambient, use the Ambient
            `ambient_session_id`. For Form filling, use the Form filling
            `ambient_session_id`. Do not mix the two.
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/ProviderIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/controllers.TranscriptInputRequest'
            example:
              raw_text: Good afternoon, doctor. The patient has fever and cough.
      responses:
        '200':
          description: Request succeeded.
        '400':
          description: >-
            Bad request. Includes ING_SDK_004 when the transcript payload is
            invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.BadRequestError'
        '401':
          description: Unauthorized. The Suki access token is missing, expired, or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.AuthenticationError'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.ForbiddenError'
        '404':
          description: Not found. The session ID does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.NotFoundError'
        '412':
          description: >-
            Failed precondition. Includes ING_SDK_005 (input_type mismatch) and
            ING_SDK_006 (input already submitted).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.BadRequestError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.InternalServerError'
      security:
        - SukiTokenAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request POST \
              --url https://sdp.suki.ai/api/v1/ambient/session/<ambient_session_id>/transcript-input \
              --header 'Content-Type: application/json' \
              --header 'sdp_suki_token: <sdp_suki_token>' \
              --header 'sdp_provider_id: <sdp_provider_id>' \
              --data '{
              "raw_text": "Good afternoon, doctor. The patient has fever and cough."
            }'
components:
  parameters:
    ProviderIdHeader:
      name: sdp_provider_id
      in: header
      description: >-
        **Optional** for standard partners.


        **Required** for:


        - **Bearer authentication.** Use the same `provider_id` returned by the
        Login or Register API.

        - **Single Auth Token authentication.** Include the same `provider_id`
        on every request as `sdp_provider_id`.
      required: false
      schema:
        type: string
        example: provider-123
  schemas:
    controllers.TranscriptInputRequest:
      type: object
      description: >-
        Finished transcript for an `input_type=transcript` session. Provide
        `raw_text` or `segments`. One of the two is required.
      properties:
        raw_text:
          type: string
          description: Full transcript text. Required when `segments` is omitted.
          example: Good afternoon, doctor. The patient has fever and cough.
        segments:
          type: array
          description: >-
            Transcript segments. Required when `raw_text` is omitted. Each
            segment must include `text`.
          items:
            $ref: '#/components/schemas/controllers.TranscriptSegment'
    controllers.BadRequestError:
      description: Bad Request Response
      type: object
      properties:
        code:
          type: integer
          example: 400
        message:
          type: string
          example: invalid request
    controllers.AuthenticationError:
      description: Authentication Failure Response
      type: object
      properties:
        code:
          type: integer
          example: 401
        message:
          type: string
          example: invalid token
    controllers.ForbiddenError:
      type: object
      properties:
        code:
          type: integer
          example: 403
          description: HTTP status code for the error.
        message:
          type: string
          example: forbidden
          description: Human-readable description of the authorization failure.
      description: Error response when the caller lacks permission.
    controllers.NotFoundError:
      description: Not Found Response
      type: object
      properties:
        code:
          type: integer
          example: 404
        message:
          type: string
          example: not found
    controllers.InternalServerError:
      description: Internal Server Error Response
      type: object
      properties:
        code:
          type: integer
          example: 500
        message:
          type: string
          example: internal server error
    controllers.TranscriptSegment:
      type: object
      description: >-
        Transcript segment. When you send segments, each must include `text`.
        Optional `words` may carry timings and speaker labels. When timings are
        supplied, each word must have end >= start, and timings must not overlap
        across segments.
      properties:
        text:
          type: string
          description: Segment text. Required when the segment is present.
          example: Patient reports fever and cough.
        words:
          type: array
          description: Optional word-level timings and speaker labels.
          items:
            $ref: '#/components/schemas/controllers.WordMetadata'
      required:
        - text
    controllers.WordMetadata:
      type: object
      description: Optional per-word timing and speaker label inside a transcript segment.
      properties:
        word:
          type: string
          description: Token text.
        start_time:
          type: string
          description: Start time (ISO 8601).
        end_time:
          type: string
          description: End time (ISO 8601).
        speaker:
          $ref: '#/components/schemas/controllers.SpeakerInfo'
    controllers.SpeakerInfo:
      type: object
      description: >-
        Optional speaker identity on a transcript word when diarization is
        available.
      properties:
        id:
          type: string
          description: Speaker identifier.
          example: speaker_1
  securitySchemes:
    SukiTokenAuth:
      type: apiKey
      in: header
      name: sdp_suki_token
      description: >-
        Suki access token (`suki_token`) from Login or Register. Expires after
        one hour.

````

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