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

# Generate Patient Summaries For Scheduled Appointments

> Trigger bulk asynchronous generation of Patient Summaries for all scheduled appointments on a provider's schedule

Use this endpoint to generate Patient Summaries for **all appointments** scheduled for a provider on a specified date. This pre-generates summaries for all appointments before the provider starts seeing patients.

The request starts an asynchronous summary generation job for **every scheduled appointment** and returns `202 Accepted`.

To generate a Patient Summary for a single appointment, use the [Generate Patient Summary for an Encounter](/patient-summary-api-reference/summary-generation/encounter-summary) endpoint.

<Note>
  Before calling this endpoint:

  * Ingest FHIR data for all scheduled patients using the [CKG Data Ingestion APIs](/patient-summary-api-reference/ckg-data-ingestion).
  * Ensure the provider's schedule has been ingested into the Clinical Knowledge Graph (CKG).
</Note>

## Recommended workflow:

<Steps>
  <Step title="Ingest the provider's schedule">
    Upload the provider's schedule using the CKG Data Ingestion APIs. Partners typically perform this once per day. Suki stores the schedule in Google Firestore.
  </Step>

  <Step title="Trigger Patient Summary Generation">
    Call this endpoint with the `fhir_practitioner_id` and `date`. Suki retrieves all matching appointments from Firestore and starts generating Patient Summaries for each appointment.
  </Step>

  <Step title="Wait for generation to complete">
    Patient summaries are generated asynchronously. Generation takes approximately **20 seconds per appointment** after the request is accepted.
  </Step>
</Steps>

## Request body

| Field                  | Type   | Required | Description                                                          |
| ---------------------- | ------ | -------- | -------------------------------------------------------------------- |
| `fhir_practitioner_id` | string | Yes      | FHIR Practitioner resource identifier for whom to generate summaries |

Once the request is accepted, use the following endpoints to generate, check or retrieve the summaries.

<div className="doc-guide-btn-row">
  <a href="/patient-summary-api-reference/summary-generation/encounter-summary" className="doc-guide-btn">
    Generate Single Encounter
  </a>

  <a href="/patient-summary-api-reference/summary-jobs/encounter-status" className="doc-guide-btn">
    Check Generation Status
  </a>

  <a href="/patient-summary-api-reference/summaries/encounter-practitioner" className="doc-guide-btn">
    Retrieve Patient Summary
  </a>
</div>


## OpenAPI

````yaml POST /api/v1/patient-summary/generate/provider-schedule
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/patient-summary/generate/provider-schedule:
    post:
      tags:
        - /api/v1/patient-summary
      summary: Generate patient summaries for scheduled appointments
      description: >-
        Trigger bulk asynchronous generation of patient summaries for all
        scheduled appointments on a provider's schedule for a given date. This
        endpoint is optimized for pre-visit workflows where summaries need to be
        generated in advance for an entire day's worth of appointments. Returns
        202 Accepted when the batch job is scheduled. Each appointment will have
        its own generation job that can be polled individually via the status
        endpoints. Use this to prepare summaries overnight or at the start of
        the day before the provider's appointments begin.
      parameters:
        - $ref: '#/components/parameters/ProviderIdHeader'
      requestBody:
        required: true
        x-codegen-request-body-name: body
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/controllers.TriggerPatientSummaryGenerationRequest
            example:
              fhir_practitioner_id: Practitioner/practitioner-1
      responses:
        '202':
          description: Accepted. Generation scheduled.
        '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'
        '403':
          description: Forbidden. The authenticated user cannot access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controllers.ForbiddenError'
        '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/patient-summary/generate/provider-schedule \
              --header 'Content-Type: application/json' \
              --header 'sdp_suki_token: <sdp_suki_token>' \
              --header 'sdp_provider_id: <sdp_provider_id>' \
              --data '{"fhir_practitioner_id":"Practitioner/practitioner-1"}'
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.TriggerPatientSummaryGenerationRequest:
      type: object
      description: >-
        Request to trigger bulk asynchronous generation of patient summaries for
        all scheduled appointments on a provider's schedule.
      required:
        - fhir_practitioner_id
      properties:
        fhir_practitioner_id:
          type: string
          description: >-
            FHIR Practitioner resource identifier for whom to generate
            summaries.
          example: Practitioner/practitioner-1
      example:
        fhir_practitioner_id: Practitioner/practitioner-1
    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.InternalServerError:
      description: Internal Server Error Response
      type: object
      properties:
        code:
          type: integer
          example: 500
        message:
          type: string
          example: internal server error
  securitySchemes:
    SukiTokenAuth:
      type: apiKey
      in: header
      name: sdp_suki_token
      description: >-
        Suki access token (`suki_token`) from Login or Register. Expires after
        one hour.

````