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

# Get Patients In Window

> Patients with appointments whose `start` falls within
[now - minutes_before, now + minutes_after], grouped one row per patient.
Each patient's appointment(s) carry their own provider/location/service.

Optional filters:
  - `provider_id`: only events where this provider is an attendee.
  - `location_id`: only events at this location. When set, location is a
    strict filter.

Used by:
  - Scribe note creation: "patients currently in an appointment with me"
    (pass `provider_id`).
  - Billing check-out: "ready-to-check-out queue at this front desk"
    (pass `location_id`).



## OpenAPI

````yaml get /appointments/in-window
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /appointments/in-window:
    get:
      tags:
        - Calendar and Appointments
      summary: Get Patients In Window
      description: >-
        Patients with appointments whose `start` falls within

        [now - minutes_before, now + minutes_after], grouped one row per
        patient.

        Each patient's appointment(s) carry their own provider/location/service.


        Optional filters:
          - `provider_id`: only events where this provider is an attendee.
          - `location_id`: only events at this location. When set, location is a
            strict filter.

        Used by:
          - Scribe note creation: "patients currently in an appointment with me"
            (pass `provider_id`).
          - Billing check-out: "ready-to-check-out queue at this front desk"
            (pass `location_id`).
      operationId: get_patients_in_window_appointments_in_window_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: provider_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Provider Id
        - name: location_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Location Id
        - name: minutes_before
          in: query
          required: false
          schema:
            type: integer
            default: 30
            title: Minutes Before
        - name: minutes_after
          in: query
          required: false
          schema:
            type: integer
            default: 60
            title: Minutes After
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PatientInWindow'
                title: Response Get Patients In Window Appointments In Window Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PatientInWindow:
      properties:
        patient:
          $ref: '#/components/schemas/PatientTiny'
        appointments:
          items:
            $ref: '#/components/schemas/AppointmentInWindow'
          type: array
          title: Appointments
        members:
          items:
            $ref: '#/components/schemas/MemberSummary'
          type: array
          title: Members
          default: []
      type: object
      required:
        - patient
        - appointments
      title: PatientInWindow
      description: >-
        A patient with their in-window appointment(s). Used for the scribe

        "who's around now" picker and the billing check-out queue — both
        surfaces

        show one row per patient even when the patient has multiple events.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PatientTiny:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the user.
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
          description: The user's first name.
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
          description: The user's last name.
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
          description: The user's phone number.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: The user's email address.
        type:
          $ref: '#/components/schemas/UserType'
          description: The type of user.
          default: PATIENT
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: The location of the user.
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
          description: The date of birth of the patient.
        onSchedulingBlacklist:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Onschedulingblacklist
          description: Whether the patient is on the scheduling blacklist.
      type: object
      required:
        - id
      title: PatientTiny
    AppointmentInWindow:
      properties:
        eventId:
          type: string
          title: Eventid
        appointmentStart:
          type: string
          format: date-time
          title: Appointmentstart
        appointmentEnd:
          type: string
          format: date-time
          title: Appointmentend
        appointmentStatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointmentstatus
        appointmentTitle:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointmenttitle
        appointmentType:
          anyOf:
            - type: string
            - type: 'null'
          title: Appointmenttype
        noteTemplateId:
          anyOf:
            - type: string
            - type: 'null'
          title: Notetemplateid
        provider:
          anyOf:
            - $ref: '#/components/schemas/ProviderTiny'
            - type: 'null'
        location:
          anyOf:
            - $ref: '#/components/schemas/LocationSummary'
            - type: 'null'
      type: object
      required:
        - eventId
        - appointmentStart
        - appointmentEnd
      title: AppointmentInWindow
      description: |-
        A single appointment occurring in the queried time window — provider and
        location are nested when attached to the event.
    MemberSummary:
      properties:
        membershipName:
          type: string
          title: Membershipname
        status:
          type: string
          title: Status
        textColor:
          anyOf:
            - type: string
            - type: 'null'
          title: Textcolor
      type: object
      required:
        - membershipName
        - status
      title: MemberSummary
      description: |-
        Membership badge data for the check-out queue — name + status (only
        statuses staff need to act on are surfaced).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserType:
      type: string
      enum:
        - PROVIDER
        - PATIENT
        - ASSISTANT
      title: UserType
    ProviderTiny:
      properties:
        id:
          type: string
          title: Id
        firstName:
          type: string
          title: Firstname
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
      type: object
      required:
        - id
        - firstName
      title: ProviderTiny
    LocationSummary:
      properties:
        id:
          type: string
          title: Id
        isVirtual:
          type: boolean
          title: Isvirtual
        name:
          type: string
          title: Name
        addressLineOne:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslineone
        addressLineTwo:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslinetwo
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
        spakinectLocationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Spakinectlocationid
        dosespotClinicId:
          anyOf:
            - type: string
            - type: 'null'
          title: Dosespotclinicid
        dosespotClinicKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Dosespotclinickey
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
        taxIdentificationNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Taxidentificationnumber
      type: object
      required:
        - id
        - isVirtual
        - name
      title: LocationSummary

````