> ## 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.

# Get Form Filling Structured Data

> Retrieve structured medical form data for a Form filling session

Use this endpoint to get the cumulative <Tooltip tip="Organized medical information extracted from clinical conversations, formatted for integration with EHR systems." cta="View in Glossary" href="/Glossary/s">structured data</Tooltip> associated with the specified <Tooltip tip="A single, time-bound instance of an ambient recording for a specific patient encounter." cta="View in Glossary" href="/Glossary/a">Form filling ambient session</Tooltip>.

You receive the structured data in the response of this endpoint. The response contains the following fields:

* **generated\_values**: Form data with template IDs for which Suki was able to generate the structured data
* **non\_generated\_values**: Form\_Template\_IDs for which Suki was not able to generate the structured data.

## Code examples

<Note>
  The code examples below use placeholders and the stage host `sdp.suki-stage.com` only as **examples**.
  For credentials, base URLs, where to run Python or TypeScript, CORS, and **cURL**, refer to [Using code examples in your integration](/api-reference/api-guidelines#using-code-examples-in-your-integration) in the **API Reference Guidelines**.
</Note>

<Tabs>
  <Tab title="Python">
    ```python expandable theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    from typing import Any, TypedDict, cast

    import requests

    BASE_URL = "https://sdp.suki-stage.com"


    class MedicalFormInstanceSummary(TypedDict, total=False):
        form_template_id: str


    class FormFillingStructuredData(TypedDict, total=False):
        generated_values: list[MedicalFormInstanceSummary]
        non_generated_values: list[MedicalFormInstanceSummary]


    class FormFillingStructuredDataResponse(TypedDict):
        structured_data: FormFillingStructuredData


    class ApiHttpError(RuntimeError):
        """Wrong HTTP status; OpenAPI errors usually include JSON with message + code."""

        def __init__(self, status: int, url: str, detail: str) -> None:
            super().__init__(f"HTTP {status} {url}: {detail}")
            self.status = status
            self.url = url


    def _get_expect_json_object(url: str, headers: dict[str, str], expect_status: int) -> dict[str, Any]:
        r = requests.get(url, headers=headers, timeout=60)
        if r.status_code == expect_status:
            data = r.json()
            if isinstance(data, dict):
                return data
            raise ApiHttpError(expect_status, url, "response JSON was not an object")

        detail = ""
        try:
            err = r.json()
            if isinstance(err, dict) and isinstance(err.get("message"), str):
                detail = err["message"]
        except ValueError:
            detail = (r.text or "")[:500]
        raise ApiHttpError(r.status_code, url, detail or "(no body)")


    def get_form_filling_structured_data(suki_token: str, ambient_session_id: str) -> FormFillingStructuredDataResponse:
        """GET /api/v1/form-filling/session/{ambient_session_id}/structured-data (sdp_suki_token header required). HTTP 200."""
        url = f"{BASE_URL}/api/v1/form-filling/session/{ambient_session_id}/structured-data"
        data = _get_expect_json_object(url, {"sdp_suki_token": suki_token, "sdp_provider_id": "<sdp_provider_id>"}, 200)
        sd = data.get("structured_data")
        if not isinstance(sd, dict):
            raise ValueError(f"{url}: 200 response missing structured_data object")
        return cast(FormFillingStructuredDataResponse, {"structured_data": sd})


    if __name__ == "__main__":
        try:
            out = get_form_filling_structured_data("YOUR_SUKI_TOKEN", "YOUR_AMBIENT_SESSION_ID")
            print(out["structured_data"])
        except (ApiHttpError, ValueError) as e:
            print(e)
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript expandable theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    const BASE_URL = "https://sdp.suki-stage.com";

    type MedicalFormInstanceSummary = {
      form_template_id?: string;
    };

    type FormFillingStructuredData = {
      generated_values?: MedicalFormInstanceSummary[];
      non_generated_values?: MedicalFormInstanceSummary[];
    };

    type FormFillingStructuredDataResponse = {
      structured_data: FormFillingStructuredData;
    };

    class ApiHttpError extends Error {
      status: number;
      url: string;
      constructor(status: number, url: string, detail: string) {
        super(`HTTP ${status} ${url}: ${detail}`);
        this.status = status;
        this.url = url;
      }
    }

    async function getExpectJsonObject(url: string, headers: Record<string, string>, expectStatus: number) {
      const res = await fetch(url, { method: "GET", headers });
      const text = await res.text();
      const json = text ? JSON.parse(text) : {};

      if (res.status !== expectStatus) {
        const msg = typeof (json as any)?.message === "string" ? (json as any).message : text?.slice(0, 500) || "(no body)";
        throw new ApiHttpError(res.status, url, msg);
      }
      if (json && typeof json === "object" && !Array.isArray(json)) return json as Record<string, unknown>;
      throw new ApiHttpError(res.status, url, "response JSON was not an object");
    }

    export async function getFormFillingStructuredData(
      sukiToken: string,
      ambientSessionId: string
    ): Promise<FormFillingStructuredDataResponse> {
      const url = `${BASE_URL}/api/v1/form-filling/session/${ambientSessionId}/structured-data`;
      const data = await getExpectJsonObject(url, { sdp_suki_token: sukiToken, sdp_provider_id: "<sdp_provider_id>" }, 200);
      const sd = data.structured_data;
      if (!sd || typeof sd !== "object" || Array.isArray(sd)) {
        throw new Error(`${url}: 200 response missing structured_data object`);
      }
      return { structured_data: sd as FormFillingStructuredData };
    }

    // Example usage
    const out = await getFormFillingStructuredData("YOUR_SUKI_TOKEN", "YOUR_AMBIENT_SESSION_ID");
    console.log(out.structured_data);
    ```
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /api/v1/form-filling/session/{ambient_session_id}/structured-data
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, 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/form-filling/session/{ambient_session_id}/structured-data:
    get:
      tags:
        - /api/v1/form-filling/session
      summary: Get form-filling structured data
      description: >-
        Returns structured medical form output for a completed form-filling
        session.
      parameters:
        - name: ambient_session_id
          in: path
          description: >-
            Form-filling session ID. The path parameter is named
            `ambient_session_id`, but this value identifies the form-filling
            session, not an ambient clinical documentation session. Use the ID
            returned from Create Form Filling Session, or the UUID you supplied
            in that request.
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/ProviderIdHeader'
      responses:
        '200':
          description: Request succeeded.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/controllers.FormFillingStructuredDataResponse
              example:
                structured_data:
                  generated_values:
                    - correlation_id: 20965414-929a-4f71-a3e5-b92bec07d086
                      created_at: '2026-01-01T00:00:00Z'
                      data:
                        additionalProp1: {}
                      form_template_id: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0-template
                      id: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0
                      metadata:
                        additionalProp1: {}
                      patient_id: patient-123
                      status: MEDICAL_FORM_STATUS_COMPLETED
                      title: Adult Vitals
                      type: VITALS_ASSESSMENT
                  non_generated_values:
                    - form_template_id: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0
        '400':
          description: Bad request. The request body or parameters failed validation.
          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'
        '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 GET \
              --url https://sdp.suki.ai/api/v1/form-filling/session/<ambient_session_id>/structured-data \
              --header 'sdp_suki_token: <sdp_suki_token>' \
              --header 'sdp_provider_id: <sdp_provider_id>'
components:
  parameters:
    ProviderIdHeader:
      name: sdp_provider_id
      in: header
      description: >-
        **Optional** - Stable identifier for the active provider. Omit for
        standard partners whose `partner_token` identifies the user.
        **Required** for Bearer partners and Single Auth Token authentication
        where multiple providers share one `partner_token`. Use the same
        `provider_id` you sent on Login or Register.
      required: false
      schema:
        type: string
        example: provider-123
  schemas:
    controllers.FormFillingStructuredDataResponse:
      description: Structured medical form output for a form-filling session.
      type: object
      properties:
        structured_data:
          $ref: '#/components/schemas/controllers.FormFillingStructuredData'
      example:
        structured_data:
          generated_values:
            - correlation_id: 20965414-929a-4f71-a3e5-b92bec07d086
              created_at: '2026-01-01T00:00:00Z'
              data:
                additionalProp1: {}
              form_template_id: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0-template
              id: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0
              metadata:
                additionalProp1: {}
              patient_id: patient-123
              status: MEDICAL_FORM_STATUS_COMPLETED
              title: Adult Vitals
              type: VITALS_ASSESSMENT
          non_generated_values:
            - form_template_id: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0
    controllers.BadRequestError:
      type: object
      properties:
        code:
          type: integer
          example: 400
          description: HTTP status code for the error.
        message:
          type: string
          example: invalid request
          description: Human-readable description of the validation or request error.
      description: Error response when the request fails validation.
    controllers.AuthenticationError:
      type: object
      properties:
        code:
          type: integer
          example: 401
          description: HTTP status code for the error.
        message:
          type: string
          example: invalid token
          description: Human-readable description of the authentication failure.
      description: Error response when authentication fails.
    controllers.InternalServerError:
      type: object
      properties:
        code:
          type: integer
          example: 500
          description: HTTP status code for the error.
        message:
          type: string
          example: internal server error
          description: Human-readable description of the server error.
      description: Error response when the server encounters an unexpected error.
    controllers.FormFillingStructuredData:
      description: >-
        Medical form instances for a form-filling session (full generated values
        and sparse non-generated entries).
      type: object
      properties:
        generated_values:
          type: array
          items:
            $ref: >-
              #/components/schemas/controllers.FormFillingGeneratedMedicalFormInstance
        non_generated_values:
          type: array
          items:
            $ref: >-
              #/components/schemas/controllers.FormFillingNonGeneratedMedicalFormInstance
    controllers.FormFillingGeneratedMedicalFormInstance:
      description: Generated medical form instance returned for a form-filling session.
      type: object
      properties:
        correlation_id:
          type: string
          example: 20965414-929a-4f71-a3e5-b92bec07d086
        created_at:
          type: string
          format: date-time
          example: '2026-01-01T00:00:00Z'
        data:
          type: object
          additionalProperties: true
          example:
            additionalProp1: {}
        form_template_id:
          type: string
          example: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0-template
        id:
          type: string
          example: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0
        metadata:
          type: object
          additionalProperties: true
          example:
            additionalProp1: {}
        patient_id:
          type: string
          example: patient-123
        status:
          type: string
          example: MEDICAL_FORM_STATUS_COMPLETED
        title:
          type: string
          example: Adult Vitals
        type:
          type: string
          example: VITALS_ASSESSMENT
    controllers.FormFillingNonGeneratedMedicalFormInstance:
      description: Medical form template that did not produce generated values.
      type: object
      properties:
        form_template_id:
          type: string
          example: 019d4cdc-9319-7d81-ae2e-fd6de7f1b4f0
  securitySchemes:
    SukiTokenAuth:
      type: apiKey
      in: header
      name: sdp_suki_token
      description: >-
        Suki access token for the authenticated provider. Obtain this by calling
        Login or Register with a valid `partner_token`. Pass the `suki_token`
        value from the JSON response as the `sdp_suki_token` header on REST
        requests and non-browser WebSocket upgrades. Browser WebSocket clients
        pass the token in `Sec-WebSocket-Protocol` instead. Tokens expire after
        one hour; call Login again to refresh.

````