components:
  schemas:
    AddressDTO:
      description: Address information
      properties:
        address1:
          description: Street address line 1
          example: 123 Main Street
          type: string
        address2:
          description: Street address line 2
          example: Suite 100
          type: string
        city:
          description: City
          example: Baltimore
          type: string
        postalCode:
          description: Postal/ZIP code
          example: '21202'
          type: string
        state:
          description: State/Province abbreviation
          example: MD
          type: string
      type: object
    AllergyDTO:
      description: Patient allergy
      properties:
        active:
          description: Whether this record is active
          example: true
          type: boolean
        allergy:
          description: Allergy name
          example: Penicillin
          type: string
        comment:
          description: Additional comments
          example: Patient reports severe reaction in childhood
          type: string
        createdAt:
          description: Creation timestamp
          example: '2020-05-15T10:00:00Z'
          format: date-time
          type: string
        createdBy:
          description: Created by (staff name)
          example: Dr. Jane Smith
          type: string
        endDate:
          description: End date (if resolved)
          example: '2023-01-10'
          format: date
          type: string
        id:
          description: Unique allergy identifier
          example: 12345
          format: int64
          type: integer
        mainReaction:
          description: Primary reaction/symptom
          example: Hives
          type: string
        onsetDate:
          description: Onset date
          example: '2020-05-15'
          format: date
          type: string
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        referenceId:
          description: External reference ID (SNOMED, RxNorm, etc.)
          example: '91936005'
          type: string
        severity:
          description: Severity level
          enum:
            - SEVERE
            - MODERATE
            - MILD
            - UNKNOWN
          example: MODERATE
          type: string
        status:
          description: Allergy status
          enum:
            - ACTIVE
            - RESOLVED
            - UNKNOWN
          example: ACTIVE
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2023-01-10T14:30:00Z'
          format: date-time
          type: string
        updatedBy:
          description: Last updated by (staff name)
          example: Dr. Jane Smith
          type: string
      type: object
    AllergyListResponse:
      description: List of allergies
      properties:
        allergies:
          description: List of allergies
          items:
            $ref: '#/components/schemas/AllergyDTO'
          type: array
      type: object
    AppointmentDTO:
      description: Appointment details
      properties:
        appointmentTypeId:
          description: Appointment type ID
          example: 333
          format: int64
          type: integer
        createdAt:
          description: Creation timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
        durationMinutes:
          description: Duration in minutes
          example: 30
          format: int32
          type: integer
        endTime:
          description: Appointment end time (ISO 8601)
          example: '2025-01-15T09:30:00-05:00'
          format: date-time
          type: string
        id:
          description: Unique appointment identifier
          example: 12345
          format: int64
          type: integer
        locationId:
          description: Location ID
          example: 111
          format: int64
          type: integer
        note:
          description: Appointment notes
          example: Annual checkup
          type: string
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        practitionerId:
          description: Practitioner ID (staff member with a practitioner role)
          example: 222
          format: int64
          type: integer
        startTime:
          description: Appointment start time (ISO 8601)
          example: '2025-01-15T09:00:00-05:00'
          format: date-time
          type: string
        status:
          description: Appointment status
          enum:
            - SCHEDULED
            - CONFIRMED
            - CHECKED_IN
            - IN_TREATMENT
            - CHECKED_OUT
            - CANCELLED
            - NO_SHOW
          example: SCHEDULED
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
      type: object
    AppointmentListResponse:
      description: Paginated list of appointments
      properties:
        appointments:
          description: List of appointments in this page
          items:
            $ref: '#/components/schemas/AppointmentDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
      type: object
    AppointmentTypeDTO:
      description: Appointment Type configuration details
      properties:
        active:
          description: Indicates if the type is active
          example: true
          type: boolean
        color:
          description: Display color code (hex)
          example: '#2B46FF'
          type: string
        createdAt:
          description: Creation timestamp
          example: '2025-01-15T10:00:00Z'
          format: date-time
          type: string
        description:
          description: Description/Instructions for the appointment
          example: Please arrive 15 minutes early to fill out paperwork.
          type: string
        duration:
          description: Duration in minutes
          example: 30
          format: int32
          type: integer
        id:
          description: Unique identifier
          example: 1001
          format: int64
          type: integer
        name:
          description: Name of the appointment type
          example: New Patient Consultation
          type: string
        telehealth:
          description: Telehealth configuration (0=none, 1=with forms, 2=no forms)
          example: 1
          format: int32
          type: integer
      type: object
    AppointmentTypeListResponse:
      description: Paginated list of appointment types
      properties:
        appointmentTypes:
          description: List of appointment types in this page
          items:
            $ref: '#/components/schemas/AppointmentTypeDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          example: eyJpZCI6MTAwMSwibmFtZSI6IkNvbnN1bHQifQ
          type: string
      type: object
    AttachPatientToSelfSchedulingAttemptRequest:
      description: Request to attach a patient to a self-scheduling attempt
      properties:
        dateOfBirth:
          description: Date of birth in yyyy-MM-dd format
          example: '1985-10-26'
          minLength: 1
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        email:
          description: Patient email address
          example: jane.doe@example.com
          format: email
          type: string
        firstName:
          description: Patient first name
          example: Jane
          minLength: 1
          type: string
        lastName:
          description: Patient last name
          example: Doe
          minLength: 1
          type: string
        phone:
          description: Patient phone number (10 digits)
          example: '5551234567'
          pattern: ^\d{10}$
          type: string
      required:
        - dateOfBirth
        - firstName
        - lastName
      type: object
    CategoryDTO:
      description: Patient category details
      properties:
        active:
          description: Whether this category is active
          example: true
          type: boolean
        color:
          description: Display color (hex code)
          example: '#4CAF50'
          type: string
        createdAt:
          description: Creation timestamp
          example: '2024-01-01T10:00:00Z'
          format: date-time
          type: string
        description:
          description: Category description
          example: Patients with appointments in the last 12 months
          type: string
        id:
          description: Unique category identifier
          example: 12345
          format: int64
          type: integer
        isDefault:
          description: Whether this is the default category for new patients
          example: true
          type: boolean
        name:
          description: Category name
          example: Active Patient
          type: string
        patientCount:
          description: Number of patients in this category
          example: 150
          format: int32
          type: integer
        sortOrder:
          description: Sort order for display
          example: 1
          format: int32
          type: integer
        updatedAt:
          description: Last update timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
      type: object
    CategoryListResponse:
      description: Paginated list of categories
      properties:
        categories:
          description: List of categories
          items:
            $ref: '#/components/schemas/CategoryDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
      type: object
    CategoryTransitionDTO:
      description: Category transition details
      properties:
        changedBy:
          description: Staff member who made the change (if manual)
          example: Jane Smith
          type: string
        fromCategoryId:
          description: Previous category ID (null if first assignment)
          example: 111
          format: int64
          type: integer
        fromCategoryName:
          description: Previous category name
          example: New Patient
          type: string
        id:
          description: Unique transition identifier
          example: 12345
          format: int64
          type: integer
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        reason:
          description: Reason for the transition
          example: Patient completed onboarding
          type: string
        toCategoryId:
          description: New category ID
          example: 222
          format: int64
          type: integer
        toCategoryName:
          description: New category name
          example: Active Patient
          type: string
        transitionedAt:
          description: When the transition occurred
          example: '2025-01-15T14:30:00Z'
          format: date-time
          type: string
        trigger:
          description: How the transition was triggered
          enum:
            - MANUAL
            - AUTOMATED
            - SYSTEM
            - API
          example: MANUAL
          type: string
      type: object
    CategoryTransitionListResponse:
      description: Paginated list of category transitions
      properties:
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
        transitions:
          description: List of category transitions
          items:
            $ref: '#/components/schemas/CategoryTransitionDTO'
          type: array
      type: object
    ConversionCreateResponseDTO:
      description: Initial response when creating a conversion
      properties:
        createdDate:
          description: Creation timestamp
          example: '2024-01-15T10:30:00Z'
          format: date-time
          type: string
        id:
          description: Conversion ID
          example: 123
          format: int64
          type: integer
        trackingUuid:
          description: Public tracking UUID
          example: abc-123-def
          type: string
      type: object
    ConversionFullResponseDTO:
      description: Full details of a remote care conversion
      properties:
        address:
          description: Street address line 1
          example: 123 Main St
          type: string
        address2:
          description: Street address line 2
          example: Apt 4B
          type: string
        city:
          description: City
          example: San Francisco
          type: string
        createdDate:
          description: Creation timestamp
          example: '2024-01-15T10:30:00Z'
          format: date-time
          type: string
        dateOfBirth:
          description: Patient DOB
          example: '1990-01-15'
          format: date
          type: string
        email:
          description: Patient email
          example: john@example.com
          type: string
        firstName:
          description: Patient first name
          example: John
          type: string
        id:
          description: Conversion ID
          example: 123
          format: int64
          type: integer
        lastName:
          description: Patient last name
          example: Doe
          type: string
        phone:
          description: Patient phone
          example: '5551234567'
          type: string
        remoteCareServiceIds:
          description: Array of selected RemoteCareService IDs
          items:
            description: Array of selected RemoteCareService IDs
            format: int64
            type: integer
          type: array
        selfSchedulingAttemptId:
          description: Link to self-scheduling attempt
          example: 456
          format: int64
          type: integer
        state:
          description: State code
          example: CA
          type: string
        status:
          description: Current status
          example: SUBMITTED
          type: string
        trackingUuid:
          description: Public tracking UUID
          example: abc-123-def
          type: string
        zip:
          description: Postal code
          example: '94102'
          type: string
      type: object
    CreateAppointmentRequest:
      description: Request to create an appointment for a self-scheduling attempt
      properties:
        appointmentTypeId:
          description: Appointment type ID
          example: 10
          format: int64
          type: integer
        locationId:
          description: Location ID
          example: 1
          format: int64
          type: integer
        practitionerId:
          description: Practitioner ID
          example: 7
          format: int64
          type: integer
        schedulerConfigId:
          description: Scheduler config ID (must belong to the self-scheduling setting)
          example: 101
          format: int64
          type: integer
        startDateTime:
          description: Appointment start time in ISO 8601 format with timezone
          example: '2025-01-15T10:00:00-08:00'
          type: string
      required:
        - appointmentTypeId
        - locationId
        - practitionerId
        - schedulerConfigId
        - startDateTime
      type: object
    CreateAppointmentResponse:
      description: Response after creating an appointment
      properties:
        appointmentTypeId:
          description: Appointment type ID
          example: 10
          format: int64
          type: integer
        endDateTime:
          description: Appointment end time in ISO 8601 format with timezone
          example: '2025-01-15T10:30:00-08:00'
          type: string
        formCount:
          description: Number of forms to be completed by the patient
          example: 3
          format: int32
          type: integer
        id:
          description: Appointment ID
          example: 999
          format: int64
          type: integer
        locationId:
          description: Location ID
          example: 1
          format: int64
          type: integer
        practitionerId:
          description: Practitioner ID
          example: 7
          format: int64
          type: integer
        startDateTime:
          description: Appointment start time in ISO 8601 format with timezone
          example: '2025-01-15T10:00:00-08:00'
          type: string
        status:
          description: >-
            Appointment status (one of: SCHEDULED, CANCELLED, NO_SHOW,
            CHECKED_IN, IN_TREATMENT, CHECKED_OUT, CONFIRMED, RESCHEDULED,
            VOIDED)
          example: SCHEDULED
          type: string
        telehealth:
          description: Whether this is a telehealth appointment
          example: false
          type: boolean
      type: object
    CreateAttemptRequest:
      description: Request to initiate a self-scheduling attempt
      properties:
        identityProofId:
          description: >-
            Optional ID of a pre-created identity proof. If provided,
            verification method must match the setting.
          example: 456
          format: int64
          type: integer
        selfSchedulingSettingId:
          description: ID of the self-scheduling configuration to use
          example: 123
          format: int64
          type: integer
      required:
        - selfSchedulingSettingId
      type: object
    CreateFormPacketRequest:
      description: Request to create a new form packet
      properties:
        dueDate:
          description: Due date for completion (ISO 8601)
          example: '2025-01-20T17:00:00-05:00'
          type: string
        formTemplateGroupId:
          description: Form template group ID (alternative to formTemplateIds)
          example: 500
          format: int64
          type: integer
        formTemplateIds:
          description: List of form template IDs to include
          example:
            - 101
            - 102
            - 103
          items:
            description: List of form template IDs to include
            format: int64
            type: integer
          type: array
        locationId:
          description: Location ID
          example: 111
          format: int64
          type: integer
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        prefill:
          additionalProperties:
            description: Pre-fill data as attribute name -> value map
            type: string
          description: Pre-fill data as attribute name -> value map
          type: object
        sendNotification:
          description: Send notification to patient
          example: true
          type: boolean
      required:
        - locationId
        - patientId
      type: object
    CreatePatientRequest:
      description: Request to create a new patient
      properties:
        dateOfBirth:
          description: Patient's date of birth in ISO 8601 format (YYYY-MM-DD)
          example: '1990-01-15'
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        email:
          description: Patient's email address
          example: john.doe@example.com
          format: email
          maxLength: 255
          minLength: 0
          type: string
        firstName:
          description: Patient's first name
          example: John
          maxLength: 80
          minLength: 1
          type: string
        gender:
          description: >-
            Patient's gender. Reference
            https://www.hl7.org/fhir/R4/codesystem-gender-identity.html for
            possible values.
          example: Male
          type: string
        lastName:
          description: Patient's last name
          example: Doe
          maxLength: 80
          minLength: 1
          type: string
        mobilePhone:
          description: >-
            Patient's mobile phone number (can include '+' and formatting, will
            be normalized to digits only)
          example: '+14155551234'
          maxLength: 255
          minLength: 0
          pattern: ^\+?[0-9]+$
          type: string
      required:
        - firstName
        - lastName
      type: object
    CreateWebhookEndpointRequest:
      description: Request to create a webhook endpoint
      properties:
        eventTypes:
          description: Event types to subscribe to
          example:
            - appointment.created
            - appointment.updated
            - form.completed
          items:
            description: Event types to subscribe to
            example: '["appointment.created","appointment.updated","form.completed"]'
            type: string
          type: array
        name:
          description: Friendly name for the endpoint
          example: Production Webhook
          type: string
        secretToken:
          description: >-
            Secret token for additional verification (sent in X-Webhook-Token
            header)
          type: string
        url:
          description: Webhook URL (must be HTTPS)
          example: https://api.example.com/webhooks/lobbie
          type: string
      required:
        - eventTypes
        - url
      type: object
    CrmStatusDTO:
      description: CRM status details
      properties:
        active:
          description: Whether this status is active
          example: true
          type: boolean
        color:
          description: Display color (hex code)
          example: '#2196F3'
          type: string
        createdAt:
          description: Creation timestamp
          example: '2024-01-01T10:00:00Z'
          format: date-time
          type: string
        description:
          description: Status description
          example: Lead has just been created
          type: string
        groupId:
          description: Parent status group ID
          example: 111
          format: int64
          type: integer
        id:
          description: Unique CRM status identifier
          example: 12345
          format: int64
          type: integer
        isDefault:
          description: Whether this is the default status in the group
          example: true
          type: boolean
        name:
          description: Status name
          example: New Lead
          type: string
        sortOrder:
          description: Sort order for display within the group
          example: 1
          format: int32
          type: integer
        updatedAt:
          description: Last update timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
      type: object
    CrmStatusGroupDTO:
      description: CRM status group details
      properties:
        active:
          description: Whether this group is active
          example: true
          type: boolean
        createdAt:
          description: Creation timestamp
          example: '2024-01-01T10:00:00Z'
          format: date-time
          type: string
        description:
          description: Group description
          example: Tracks the progression of leads through the sales funnel
          type: string
        id:
          description: Unique CRM status group identifier
          example: 12345
          format: int64
          type: integer
        name:
          description: Group name
          example: Lead Stages
          type: string
        sortOrder:
          description: Sort order for display
          example: 1
          format: int32
          type: integer
        statusCount:
          description: Number of statuses in this group
          example: 5
          format: int32
          type: integer
        updatedAt:
          description: Last update timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
      type: object
    CrmStatusGroupListResponse:
      description: Paginated list of CRM status groups
      properties:
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
        statusGroups:
          description: List of CRM status groups
          items:
            $ref: '#/components/schemas/CrmStatusGroupDTO'
          type: array
      type: object
    CrmStatusListResponse:
      description: Paginated list of CRM statuses
      properties:
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
        statuses:
          description: List of CRM statuses
          items:
            $ref: '#/components/schemas/CrmStatusDTO'
          type: array
      type: object
    EventTypeDTO:
      description: Event type definition
      properties:
        category:
          description: Event category
          example: appointment
          type: string
        description:
          description: Human-readable description
          example: Triggered when a new appointment is scheduled
          type: string
        examplePayload:
          additionalProperties:
            description: Example payload structure
            type: object
          description: Example payload structure
          type: object
        type:
          description: Event type identifier
          example: appointment.created
          type: string
      type: object
    EventTypeListResponse:
      description: List of available event types
      properties:
        eventTypes:
          additionalProperties:
            description: List of event types grouped by category
            items:
              $ref: '#/components/schemas/EventTypeDTO'
            type: array
          description: List of event types grouped by category
          type: object
      type: object
    FormAnswerDTO:
      description: Form field answer
      properties:
        attributeName:
          description: Field attribute name (for mapping)
          example: patient_first_name
          type: string
        fieldType:
          description: Field type
          enum:
            - TEXT
            - TEXTAREA
            - SELECT
            - CHECKBOX
            - RADIO
            - DATE
            - SIGNATURE
            - FILE
          example: TEXT
          type: string
        formElementId:
          description: Form element/field ID
          example: 11111
          format: int64
          type: integer
        label:
          description: Field label
          example: First Name
          type: string
        selectedOptions:
          description: Selected options (for multi-select fields)
          items:
            description: Selected options (for multi-select fields)
            type: string
          type: array
        value:
          description: Answer value
          example: John
          type: string
      type: object
    FormAttributeDTO:
      description: Form attribute mapping
      properties:
        elementType:
          description: Element type
          example: TEXT
          type: string
        formElementId:
          description: Associated form element ID
          example: 11111
          format: int64
          type: integer
        isLobbieAttribute:
          description: Whether this is a Lobbie standard attribute
          example: true
          type: boolean
        label:
          description: Field label
          example: First Name
          type: string
        name:
          description: Attribute name used for mapping
          example: patient_first_name
          type: string
      type: object
    FormAttributeListResponse:
      description: List of form attributes
      properties:
        attributes:
          description: List of mapped attributes
          items:
            $ref: '#/components/schemas/FormAttributeDTO'
          type: array
        formTemplateId:
          description: Form template ID
          example: 12345
          format: int64
          type: integer
        formTemplateName:
          description: Form template name
          example: Patient Intake Form
          type: string
      type: object
    FormDTO:
      description: Individual form within a packet
      properties:
        answers:
          description: Form answers (if requested)
          items:
            $ref: '#/components/schemas/FormAnswerDTO'
          type: array
        completionPercentage:
          description: Completion percentage (0-100)
          example: 75
          format: int32
          type: integer
        formTemplateId:
          description: Form template ID
          example: 999
          format: int64
          type: integer
        formTemplateName:
          description: Form template name
          example: Patient Intake Form
          type: string
        id:
          description: Unique form identifier
          example: 54321
          format: int64
          type: integer
        isComplete:
          description: Whether this form is complete
          example: true
          type: boolean
        mappedAnswers:
          additionalProperties:
            description: Mapped form answers by attribute name (if requested)
            type: object
          description: Mapped form answers by attribute name (if requested)
          type: object
        status:
          description: Form status
          enum:
            - NOT_STARTED
            - IN_PROGRESS
            - COMPLETED
          example: COMPLETED
          type: string
      type: object
    FormElementDTO:
      description: Form element (field) within a template
      properties:
        attributeName:
          description: Mapped attribute name for data mapping
          example: patient_first_name
          type: string
        colClass:
          description: Column width class (1-12)
          example: 6
          format: int32
          type: integer
        helpText:
          description: Help text displayed below the field
          type: string
        id:
          description: Unique element identifier
          example: 11111
          format: int64
          type: integer
        isPatientViewable:
          description: Whether this field is visible to patients
          example: true
          type: boolean
        isRequired:
          description: Whether this field is required
          example: true
          type: boolean
        label:
          description: Field label displayed to users
          example: First Name
          type: string
        options:
          description: Available options for select/radio/checkbox fields
          items:
            $ref: '#/components/schemas/FormSelectOptionDTO'
          type: array
        placeholder:
          description: Placeholder text
          example: Enter your first name
          type: string
        sortOrder:
          description: Display order within the form
          example: 1
          format: int32
          type: integer
        type:
          description: Element type
          enum:
            - TEXT
            - TEXTAREA
            - SELECT
            - MULTI_SELECT
            - CHECKBOX
            - RADIO
            - DATE
            - TIME
            - DATETIME
            - SIGNATURE
            - FILE
            - IMAGE
            - HEADER
            - PARAGRAPH
          example: TEXT
          type: string
      type: object
    FormElementListResponse:
      description: List of form elements
      properties:
        elements:
          description: List of form elements
          items:
            $ref: '#/components/schemas/FormElementDTO'
          type: array
        formTemplateId:
          description: Form template ID
          example: 12345
          format: int64
          type: integer
        formTemplateName:
          description: Form template name
          example: Patient Intake Form
          type: string
      type: object
    FormPacketDTO:
      description: Form packet (group of forms assigned to a patient)
      properties:
        completedAt:
          description: Completion timestamp
          example: '2025-01-18T14:30:00-05:00'
          format: date-time
          type: string
        createdAt:
          description: Creation timestamp
          example: '2025-01-15T10:00:00Z'
          format: date-time
          type: string
        dueDate:
          description: Due date for completion (ISO 8601)
          example: '2025-01-20T17:00:00-05:00'
          format: date-time
          type: string
        forms:
          description: Individual forms in this packet
          items:
            $ref: '#/components/schemas/FormDTO'
          type: array
        id:
          description: Unique form packet identifier
          example: 12345
          format: int64
          type: integer
        isArchived:
          description: Whether the packet is archived
          example: false
          type: boolean
        isComplete:
          description: Whether the packet is complete
          example: false
          type: boolean
        locationId:
          description: Location ID
          example: 111
          format: int64
          type: integer
        locationName:
          description: Location name
          example: Main Street Clinic
          type: string
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        patientName:
          description: Patient name
          example: John Doe
          type: string
        patientUrl:
          description: Patient-facing URL to complete forms
          type: string
        staffUrl:
          description: Staff-facing URL to view/edit forms
          type: string
        status:
          description: Form packet status
          enum:
            - PENDING
            - IN_PROGRESS
            - COMPLETED
            - ARCHIVED
          example: IN_PROGRESS
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2025-01-18T14:30:00Z'
          format: date-time
          type: string
      type: object
    FormPacketListResponse:
      description: Paginated list of form packets
      properties:
        formPackets:
          description: List of form packets in this page
          items:
            $ref: '#/components/schemas/FormPacketDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
      type: object
    FormPdfResponse:
      description: Response with PDF download URL
      properties:
        downloadUrl:
          description: Signed URL to download the PDF (valid for 15 minutes)
          example: https://lobbie-forms.s3.amazonaws.com/...
          type: string
        expiresAt:
          description: URL expiration time (ISO 8601)
          example: '2025-01-15T10:15:00Z'
          format: date-time
          type: string
      type: object
    FormSelectOptionDTO:
      description: Select option for dropdown/radio/checkbox fields
      properties:
        id:
          description: Option ID
          example: 22222
          format: int64
          type: integer
        sortOrder:
          description: Display order
          example: 1
          format: int32
          type: integer
        text:
          description: Option display text
          example: Male
          type: string
      type: object
    FormTemplateDTO:
      description: Form template definition
      properties:
        appointmentTypeIds:
          description: Associated appointment type IDs
          items:
            description: Associated appointment type IDs
            format: int64
            type: integer
          type: array
        createdAt:
          description: Creation timestamp
          example: '2024-06-15T10:00:00Z'
          format: date-time
          type: string
        description:
          description: Template description
          example: Collects basic patient information and medical history
          type: string
        elementCount:
          description: Number of form elements
          example: 15
          format: int32
          type: integer
        elements:
          description: Form elements/fields (if requested)
          items:
            $ref: '#/components/schemas/FormElementDTO'
          type: array
        id:
          description: Unique form template identifier
          example: 12345
          format: int64
          type: integer
        isActive:
          description: Whether this template is active
          example: true
          type: boolean
        isDirectlyLinkable:
          description: Whether this template can be directly linked (public form)
          example: true
          type: boolean
        isFillablePdf:
          description: Whether this template is a fillable PDF
          example: false
          type: boolean
        isStaffOnly:
          description: Whether this template is staff-only (not visible to patients)
          example: false
          type: boolean
        name:
          description: Template name
          example: Patient Intake Form
          type: string
        publicLink:
          description: Public link for directly linkable templates
          example: https://forms.lobbie.com/t/abc123
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
      type: object
    FormTemplateGroupDTO:
      description: Form template group (bundle of templates)
      properties:
        createdAt:
          description: Creation timestamp
          example: '2024-06-15T10:00:00Z'
          format: date-time
          type: string
        id:
          description: Unique group identifier
          example: 500
          format: int64
          type: integer
        isActive:
          description: Whether this group is active
          example: true
          type: boolean
        locationId:
          description: Associated location ID
          format: int64
          type: integer
        name:
          description: Group name
          example: New Patient Intake Packet
          type: string
        practitionerId:
          description: Associated practitioner ID
          format: int64
          type: integer
        templateCount:
          description: Number of templates in this group
          example: 3
          format: int32
          type: integer
        templates:
          description: Templates included in this group
          items:
            $ref: '#/components/schemas/FormTemplateSummaryDTO'
          type: array
      type: object
    FormTemplateGroupListResponse:
      description: Paginated list of form template groups
      properties:
        groups:
          description: List of form template groups in this page
          items:
            $ref: '#/components/schemas/FormTemplateGroupDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
      type: object
    FormTemplateListResponse:
      description: Paginated list of form templates
      properties:
        formTemplates:
          description: List of form templates in this page
          items:
            $ref: '#/components/schemas/FormTemplateDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
      type: object
    FormTemplateSummaryDTO:
      description: Summary of a form template (used in group listings)
      properties:
        elementCount:
          description: Number of form elements
          example: 15
          format: int32
          type: integer
        id:
          description: Template ID
          example: 12345
          format: int64
          type: integer
        isActive:
          description: Whether this template is active
          example: true
          type: boolean
        name:
          description: Template name
          example: Patient Intake Form
          type: string
      type: object
    FormUrlResponse:
      description: Response with form packet URLs
      properties:
        patientUrl:
          description: Patient-facing URL to complete forms
          example: https://forms.lobbie.com/p/abc123
          type: string
        staffUrl:
          description: Staff-facing URL to view/edit forms
          example: https://app.lobbie.com/staff/forms/12345
          type: string
      type: object
    IdentityProofCreateRequest:
      description: Request to create identity proof
      properties:
        verificationMethod:
          description: >-
            Verification method (EMAIL, SMS, or EMAIL_AND_SMS).
            Case-insensitive.
          enum:
            - EMAIL
            - SMS
            - EMAIL_AND_SMS
          example: EMAIL_AND_SMS
          type: string
        verificationMethodEnum:
          enum:
            - EMAIL
            - SMS
            - EMAIL_AND_SMS
            - PAPER
            - 'NULL'
          type: string
      required:
        - verificationMethod
      type: object
    IdentityProofResponse:
      description: Identity proof response
      properties:
        createdAt:
          description: Creation timestamp
          example: '2025-11-19T13:00:00Z'
          format: date-time
          type: string
        id:
          description: Identity proof ID (use this in subsequent requests)
          example: 12345
          format: int64
          type: integer
        isVerified:
          description: Whether all required verification methods have been completed
          example: false
          type: boolean
        token:
          description: Secure token for X-Identity-Token header
          example: abc123...
          type: string
        verificationMethod:
          description: Verification method
          enum:
            - EMAIL
            - SMS
            - EMAIL_AND_SMS
            - PAPER
            - 'NULL'
          example: EMAIL_AND_SMS
          type: string
        verifiedEmail:
          description: Verified email (if verified)
          example: john@example.com
          type: string
        verifiedPhone:
          description: Verified phone (if verified)
          example: '5551234567'
          type: string
      type: object
    IdentityProofStatusResponse:
      description: Identity proof status response
      properties:
        createdAt:
          description: Creation timestamp
          example: '2025-11-19T13:00:00Z'
          format: date-time
          type: string
        id:
          description: Identity proof ID
          example: 12345
          format: int64
          type: integer
        isVerified:
          description: Whether all required verification methods have been completed
          example: false
          type: boolean
        missingVerifications:
          description: >-
            Array of verification methods still pending (e.g., ["EMAIL"],
            ["SMS"], ["EMAIL", "SMS"], or [])
          example:
            - SMS
          items:
            description: >-
              Array of verification methods still pending (e.g., ["EMAIL"],
              ["SMS"], ["EMAIL", "SMS"], or [])
            example: '["SMS"]'
            type: string
          type: array
        verificationMethod:
          description: Verification method
          enum:
            - EMAIL
            - SMS
            - EMAIL_AND_SMS
            - PAPER
            - 'NULL'
          example: EMAIL_AND_SMS
          type: string
        verifiedEmail:
          description: Verified email (if verified)
          example: john@example.com
          type: string
        verifiedPhone:
          description: Verified phone (if verified)
          example: '5551234567'
          type: string
      type: object
    InvoiceDTO:
      description: Invoice details
      properties:
        appointmentId:
          description: Associated appointment ID
          format: int64
          type: integer
        createdAt:
          description: Creation timestamp
          example: '2025-01-15T10:00:00Z'
          format: date-time
          type: string
        currency:
          description: Currency code
          example: USD
          type: string
        dueDate:
          description: Due date
          example: '2025-02-01T00:00:00Z'
          format: date-time
          type: string
        id:
          description: Unique invoice identifier
          example: 12345
          format: int64
          type: integer
        invoiceNumber:
          description: Invoice number (display format)
          example: INV-2025-0001
          type: string
        lineItems:
          description: Invoice line items
          items:
            $ref: '#/components/schemas/InvoiceLineItemDTO'
          type: array
        locationId:
          description: Location ID
          example: 111
          format: int64
          type: integer
        locationName:
          description: Location name
          example: Main Street Clinic
          type: string
        paidAmount:
          description: Amount paid
          example: 166.5
          type: number
        paidAt:
          description: Date payment was received
          format: date-time
          type: string
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        patientName:
          description: Patient name
          example: John Doe
          type: string
        refundedAmount:
          description: Amount refunded
          example: 0
          type: number
        status:
          description: Invoice status
          enum:
            - DRAFT
            - OPEN
            - VIEWED
            - PAID
            - FAILED
            - PAST_DUE
            - REFUNDED
            - VOID
          example: OPEN
          type: string
        subscriptionId:
          description: Associated subscription ID (for recurring invoices)
          format: int64
          type: integer
        subtotal:
          description: Subtotal amount (before tax and surcharge)
          example: 150
          type: number
        surchargeAmount:
          description: Surcharge amount (processing fee)
          example: 4.5
          type: number
        taxAmount:
          description: Tax amount
          example: 12
          type: number
        totalAmount:
          description: Total amount due
          example: 166.5
          type: number
        updatedAt:
          description: Last update timestamp
          example: '2025-01-15T14:30:00Z'
          format: date-time
          type: string
      type: object
    InvoiceLineItemDTO:
      description: Invoice line item
      properties:
        careResourceId:
          description: Reference to care resource/service ID
          format: int64
          type: integer
        description:
          description: Item description
          example: Office Visit - New Patient
          type: string
        id:
          description: Line item ID
          example: 11111
          format: int64
          type: integer
        quantity:
          description: Quantity
          example: 1
          format: int32
          type: integer
        taxAmount:
          description: Tax amount for this line item
          example: 12
          type: number
        total:
          description: Line total (quantity * unit price)
          example: 150
          type: number
        type:
          description: Item type
          enum:
            - SERVICE
            - PRODUCT
            - EQUIPMENT
            - OTHER
          example: SERVICE
          type: string
        unitPrice:
          description: Unit price
          example: 150
          type: number
      type: object
    InvoiceListResponse:
      description: Paginated list of invoices
      properties:
        invoices:
          description: List of invoices
          items:
            $ref: '#/components/schemas/InvoiceDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page
          type: string
      type: object
    InvoicePdfResponse:
      description: Response with invoice PDF URL
      properties:
        downloadUrl:
          description: Signed URL to download the PDF (valid for 15 minutes)
          type: string
        expiresAt:
          description: URL expiration time
          example: '2025-01-15T10:15:00Z'
          format: date-time
          type: string
      type: object
    LabDTO:
      description: Lab order/result
      properties:
        appointmentId:
          description: Associated appointment ID
          format: int64
          type: integer
        collectedOn:
          description: Collection date
          example: '2025-01-15T09:30:00Z'
          format: date-time
          type: string
        completedOn:
          description: Completion date
          example: '2025-01-16T14:00:00Z'
          format: date-time
          type: string
        createdAt:
          description: Creation timestamp
          example: '2025-01-15T10:00:00Z'
          format: date-time
          type: string
        drawnBy:
          description: Drawn by (staff name)
          example: Jane Smith
          type: string
        entryOn:
          description: Entry date
          example: '2025-01-15T10:00:00Z'
          format: date-time
          type: string
        externalResult:
          description: Whether from external source
          example: true
          type: boolean
        id:
          description: Unique lab identifier
          example: 12345
          format: int64
          type: integer
        locationId:
          description: Location ID
          example: 111
          format: int64
          type: integer
        locked:
          description: Whether lab is locked for editing
          example: true
          type: boolean
        manual:
          description: Whether manually entered
          example: false
          type: boolean
        notes:
          description: Notes
          example: Fasting specimen
          type: string
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        patientName:
          description: Patient name
          example: John Doe
          type: string
        status:
          description: Lab status
          enum:
            - PROCESSING
            - COMPLETE
            - ORDER_ERROR
          example: COMPLETE
          type: string
        testPanels:
          description: Test panels in this lab
          items:
            $ref: '#/components/schemas/TestPanelDTO'
          type: array
        thirdPartyLabId:
          description: External lab ID from vendor
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2025-01-16T14:00:00Z'
          format: date-time
          type: string
        vendorId:
          description: Lab vendor configuration ID
          example: 222
          format: int64
          type: integer
        vendorName:
          description: Vendor name
          example: Labcorp
          type: string
        vendorType:
          description: Lab vendor type
          enum:
            - IN_HOUSE
            - LABCORP
            - PRIME
            - BRIO
            - SPOTDX
            - OTHER
          example: LABCORP
          type: string
      type: object
    LabListResponse:
      description: Paginated list of labs
      properties:
        labs:
          description: List of labs
          items:
            $ref: '#/components/schemas/LabDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page
          type: string
      type: object
    LineItemDTO:
      description: Invoice line item details
      properties:
        appointmentId:
          description: Associated appointment ID
          example: 333
          format: int64
          type: integer
        careResourceId:
          description: Associated care resource ID
          example: 222
          format: int64
          type: integer
        code:
          description: Billing code (CPT, HCPCS, etc.)
          example: '99203'
          type: string
        createdAt:
          description: Creation timestamp
          example: '2025-01-15T10:00:00Z'
          format: date-time
          type: string
        description:
          description: Item description
          example: Office Visit - New Patient
          type: string
        id:
          description: Unique line item identifier
          example: 12345
          format: int64
          type: integer
        invoiceId:
          description: Parent invoice ID
          example: 111
          format: int64
          type: integer
        quantity:
          description: Quantity
          example: 1
          format: int32
          type: integer
        sortOrder:
          description: Sort order on invoice
          example: 1
          format: int32
          type: integer
        taxable:
          description: Whether this line item is taxable
          example: false
          type: boolean
        totalCents:
          description: Line total in cents (quantity * unit price)
          example: 15000
          format: int64
          type: integer
        totalDisplay:
          description: Formatted line total
          example: $150.00
          type: string
        type:
          description: Line item type
          enum:
            - SERVICE
            - PRODUCT
            - ADJUSTMENT
            - TAX
          example: SERVICE
          type: string
        unitPriceCents:
          description: Unit price in cents
          example: 15000
          format: int64
          type: integer
        unitPriceDisplay:
          description: Formatted unit price
          example: $150.00
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2025-01-15T10:00:00Z'
          format: date-time
          type: string
      type: object
    LineItemListResponse:
      description: Paginated list of line items
      properties:
        lineItems:
          description: List of line items
          items:
            $ref: '#/components/schemas/LineItemDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
      type: object
    LocationDTO:
      description: Location record with address information
      properties:
        active:
          description: Whether the location is active
          example: true
          type: boolean
        address:
          $ref: '#/components/schemas/AddressDTO'
        createdAt:
          description: Creation timestamp
          example: '2025-01-15T10:00:00Z'
          format: date-time
          type: string
        id:
          description: Unique location identifier
          example: 12345
          format: int64
          type: integer
        name:
          description: Location name
          example: Main Street Clinic
          type: string
        phoneNumber:
          description: Location phone number (digits only)
          example: '5551234567'
          type: string
        storeId:
          description: Partner's external store identifier
          example: STORE123
          type: string
        timeZone:
          description: Location timezone (IANA format)
          example: America/New_York
          type: string
      type: object
    LocationListResponse:
      description: Paginated list of locations with cursor for next page
      properties:
        locations:
          description: List of locations in this page
          items:
            $ref: '#/components/schemas/LocationDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          example: eyJ2Ijp7Im5hbWUiOiJNYWluIFN0cmVldCJ9LCJpZCI6MTIzNDV9
          type: string
      type: object
    MedicationDTO:
      description: Patient medication
      properties:
        active:
          description: Whether this record is active
          example: true
          type: boolean
        createdAt:
          description: Creation timestamp
          example: '2022-03-01T10:00:00Z'
          format: date-time
          type: string
        createdBy:
          description: Created by (staff name)
          example: Dr. Jane Smith
          type: string
        diagnoses:
          description: Related diagnoses
          items:
            $ref: '#/components/schemas/MedicationDiagnosisDTO'
          type: array
        directions:
          description: Dosage/usage instructions
          example: Take 1 tablet by mouth daily
          type: string
        endDate:
          description: End date
          example: '2023-03-01'
          format: date
          type: string
        id:
          description: Unique medication identifier
          example: 12345
          format: int64
          type: integer
        name:
          description: Medication name
          example: Lisinopril 10mg
          type: string
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        referenceId:
          description: Drug code identifier (NDC, RxNorm)
          example: 68180-513-01
          type: string
        startDate:
          description: Start date
          example: '2022-03-01'
          format: date
          type: string
        status:
          description: Medication status
          enum:
            - ACTIVE
            - ON_HOLD
            - DISCONTINUED
            - COMPLETED
            - UNKNOWN
          example: ACTIVE
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2023-01-10T14:30:00Z'
          format: date-time
          type: string
        updatedBy:
          description: Last updated by (staff name)
          example: Dr. Jane Smith
          type: string
      type: object
    MedicationDiagnosisDTO:
      description: Diagnosis linked to a medication
      properties:
        createdAt:
          description: Creation timestamp
          example: '2022-03-01T10:00:00Z'
          format: date-time
          type: string
        createdBy:
          description: Created by (staff name)
          example: Dr. Jane Smith
          type: string
        diagnosisCode:
          description: Diagnosis code (ICD-10)
          example: I10
          type: string
        diagnosisText:
          description: Diagnosis description
          example: Essential (primary) hypertension
          type: string
        id:
          description: Unique diagnosis identifier
          example: 12345
          format: int64
          type: integer
        updatedAt:
          description: Last update timestamp
          example: '2023-01-10T14:30:00Z'
          format: date-time
          type: string
        updatedBy:
          description: Last updated by (staff name)
          example: Dr. Jane Smith
          type: string
      type: object
    MedicationListResponse:
      description: List of medications
      properties:
        medications:
          description: List of medications
          items:
            $ref: '#/components/schemas/MedicationDTO'
          type: array
      type: object
    NotificationDTO:
      description: Notification details with independent email and SMS status tracking
      properties:
        appointmentId:
          description: Related appointment ID if applicable
          example: 111
          format: int64
          type: integer
        createdAt:
          description: Creation timestamp
          example: '2025-01-14T14:30:00Z'
          format: date-time
          type: string
        emailProcessedAt:
          description: When the email was processed
          example: '2025-01-15T09:00:05Z'
          format: date-time
          type: string
        emailStatus:
          description: Email delivery status
          enum:
            - UNPROCESSED
            - PROCESSED_SENT
            - PROCESSED_UNSENT
          example: PROCESSED_SENT
          type: string
        formGroupId:
          description: Related form group ID if applicable
          example: 222
          format: int64
          type: integer
        id:
          description: Unique notification identifier
          example: 12345
          format: int64
          type: integer
        patientId:
          description: Patient ID who received the notification
          example: 67890
          format: int64
          type: integer
        scheduledAt:
          description: When the notification is scheduled to be sent
          example: '2025-01-15T09:00:00Z'
          format: date-time
          type: string
        smsProcessedAt:
          description: When the SMS was processed
          example: '2025-01-15T09:00:05Z'
          format: date-time
          type: string
        smsStatus:
          description: SMS delivery status
          enum:
            - UNPROCESSED
            - PROCESSED_SENT
            - PROCESSED_UNSENT
          example: PROCESSED_SENT
          type: string
        type:
          description: Notification type (actual NotificationType enum name)
          example: APPOINTMENT_CONFIRMATION
          type: string
      type: object
    NotificationGroupDTO:
      description: Notification group details
      properties:
        appointmentId:
          description: Related appointment ID if applicable
          example: 111
          format: int64
          type: integer
        createdAt:
          description: Creation timestamp
          example: '2025-01-14T08:00:00Z'
          format: date-time
          type: string
        formGroupId:
          description: Related form group ID if applicable
          example: 222
          format: int64
          type: integer
        id:
          description: Unique notification group identifier
          example: 12345
          format: int64
          type: integer
        lastEmailSentAt:
          description: When the last email was sent from this group
          example: '2025-01-15T09:00:00Z'
          format: date-time
          type: string
        lastSmsSentAt:
          description: When the last SMS was sent from this group
          example: '2025-01-15T09:00:00Z'
          format: date-time
          type: string
        notificationCount:
          description: Number of notifications in this group
          example: 5
          format: int32
          type: integer
        paymentRequestId:
          description: Related payment request ID if applicable
          example: 333
          format: int64
          type: integer
      type: object
    NotificationGroupListResponse:
      description: Paginated list of notification groups
      properties:
        groups:
          description: List of notification groups
          items:
            $ref: '#/components/schemas/NotificationGroupDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
      type: object
    NotificationListResponse:
      description: Paginated list of notifications
      properties:
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
        notifications:
          description: List of notifications in this page
          items:
            $ref: '#/components/schemas/NotificationDTO'
          type: array
      type: object
    PatientCategoryDTO:
      description: Patient's current category assignment
      properties:
        assignedAt:
          description: When the patient was assigned to this category
          example: '2025-01-01T10:00:00Z'
          format: date-time
          type: string
        assignedBy:
          description: Who assigned the category (staff name or 'System')
          example: Jane Smith
          type: string
        categoryColor:
          description: Category color (hex code)
          example: '#4CAF50'
          type: string
        categoryId:
          description: Current category ID
          example: 111
          format: int64
          type: integer
        categoryName:
          description: Current category name
          example: Active Patient
          type: string
        patientId:
          description: Patient ID
          example: 12345
          format: int64
          type: integer
      type: object
    PatientListResponse:
      description: Paginated list of patients with cursor for next page
      properties:
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          example: eyJ2Ijp7ImZpcnN0TmFtZSI6IkpvaG4ifSwiaWQiOjEyMzQ1fQ
          type: string
        patients:
          description: List of patients in this page
          items:
            $ref: '#/components/schemas/PatientResponse'
          type: array
      type: object
    PatientMatchResponse:
      description: Response with matched patient ID
      properties:
        patientId:
          description: The matched patient ID
          example: 12345
          format: int64
          type: integer
      type: object
    PatientResponse:
      description: Patient record with basic demographic information
      properties:
        dateOfBirth:
          description: Patient's date of birth in ISO 8601 format (YYYY-MM-DD)
          example: '1990-01-15'
          format: date
          type: string
        email:
          description: Patient's email address
          example: john.doe@example.com
          format: email
          type: string
        firstName:
          description: Patient's first name
          example: John
          maxLength: 255
          type: string
        id:
          description: Unique patient identifier
          example: 12345
          format: int64
          type: integer
        lastName:
          description: Patient's last name
          example: Doe
          maxLength: 255
          type: string
        mobilePhone:
          description: Patient's mobile phone number (digits only, no formatting)
          example: '14155551234'
          type: string
      type: object
    PaymentRequestDTO:
      description: Payment request details
      properties:
        amountCents:
          description: Amount requested in cents
          example: 5000
          format: int64
          type: integer
        amountDisplay:
          description: Amount requested formatted
          example: $50.00
          type: string
        amountPaidCents:
          description: Amount paid so far in cents
          example: 0
          format: int64
          type: integer
        amountPaidDisplay:
          description: Amount paid formatted
          example: $0.00
          type: string
        amountRemainingCents:
          description: Amount remaining in cents
          example: 5000
          format: int64
          type: integer
        amountRemainingDisplay:
          description: Amount remaining formatted
          example: $50.00
          type: string
        appointmentId:
          description: Associated appointment ID
          example: 111
          format: int64
          type: integer
        createdAt:
          description: Creation timestamp
          example: '2025-01-15T09:00:00Z'
          format: date-time
          type: string
        description:
          description: Description/memo for the payment
          example: Copay for office visit
          type: string
        expiresAt:
          description: When the request expires
          example: '2025-02-15T23:59:59Z'
          format: date-time
          type: string
        id:
          description: Unique payment request identifier
          example: 12345
          format: int64
          type: integer
        invoiceId:
          description: Associated invoice ID
          example: 222
          format: int64
          type: integer
        paidAt:
          description: When payment was completed
          example: '2025-01-16T14:30:00Z'
          format: date-time
          type: string
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        patientName:
          description: Patient name
          example: John Doe
          type: string
        paymentUrl:
          description: Secure payment link for patient
          example: https://pay.lobbie.com/abc123
          type: string
        status:
          description: Request status
          enum:
            - PENDING
            - PARTIALLY_PAID
            - PAID
            - VOIDED
            - EXPIRED
          example: PENDING
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2025-01-15T09:00:00Z'
          format: date-time
          type: string
        voidReason:
          description: Reason for voiding (if voided)
          example: Patient paid in person
          type: string
      type: object
    PaymentRequestListResponse:
      description: Paginated list of payment requests
      properties:
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
        paymentRequests:
          description: List of payment requests in this page
          items:
            $ref: '#/components/schemas/PaymentRequestDTO'
          type: array
      type: object
    PractitionerOutputDTO:
      description: Practitioner available for self-scheduling
      properties:
        displayName:
          description: Full name of the practitioner (first and last name)
          example: Jane Smith
          type: string
        firstAvailableSlot:
          description: >-
            Earliest available slot start time in milliseconds since epoch. Null
            if no availability.
          example: 1704103200000
          format: int64
          type: integer
        practitionerId:
          description: >-
            Staff ID of the practitioner. This corresponds to a staff member who
            is configured as a practitioner based on role groups.
          example: 42
          format: int64
          type: integer
      type: object
    PrefillRequest:
      description: Request to pre-fill form fields
      properties:
        fields:
          additionalProperties:
            description: Map of attribute names to values
            type: string
          description: Map of attribute names to values
          type: object
      required:
        - fields
      type: object
    PrefillResponse:
      description: Response with pre-fill results
      properties:
        filledCount:
          description: Number of fields successfully pre-filled
          example: 5
          format: int32
          type: integer
        skippedCount:
          description: Number of fields skipped (not found or already answered)
          example: 2
          format: int32
          type: integer
        skippedFields:
          description: List of skipped field names
          items:
            description: List of skipped field names
            type: string
          type: array
      type: object
    PreparedScheduleOutputDTO:
      description: Availability response containing time slots grouped by date
      properties:
        arePractitionersSelectable:
          description: >-
            If true, the patient can choose their practitioner and each slot
            includes a practitionerToConfig map. If false, the system
            auto-assigns the best-ranked practitioner and each slot includes a
            single practitionerId.
          example: true
          type: boolean
        practitioners:
          description: >-
            List of practitioners who have availability in the queried time
            range
          items:
            $ref: '#/components/schemas/PractitionerOutputDTO'
          type: array
        slotsByDate:
          additionalProperties:
            description: >-
              Available time slots grouped by date. Keys are dates in M/d/yyyy
              format (e.g. "1/15/2025"). Values are arrays of available slots
              for that date, sorted by time then practitioner rank. Only dates
              with available slots are included.
            items:
              $ref: '#/components/schemas/ScheduleSlotOutputDTO'
            type: array
          description: >-
            Available time slots grouped by date. Keys are dates in M/d/yyyy
            format (e.g. "1/15/2025"). Values are arrays of available slots for
            that date, sorted by time then practitioner rank. Only dates with
            available slots are included.
          type: object
        timeZone:
          description: >-
            IANA timezone of the practice location (all slot times are in UTC
            epoch millis)
          example: America/New_York
          type: string
      type: object
    ProblemDTO:
      description: Patient problem/diagnosis
      properties:
        active:
          description: Whether this record is active
          example: true
          type: boolean
        comment:
          description: Additional comments
          example: Diet controlled, A1c 6.2%
          type: string
        createdAt:
          description: Creation timestamp
          example: '2021-06-15T10:00:00Z'
          format: date-time
          type: string
        createdBy:
          description: Created by (staff name)
          example: Dr. Jane Smith
          type: string
        diagnosisCode:
          description: Diagnosis code (ICD-10)
          example: E11.9
          type: string
        diagnosisText:
          description: Diagnosis description
          example: Type 2 diabetes mellitus without complications
          type: string
        id:
          description: Unique problem identifier
          example: 12345
          format: int64
          type: integer
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        severity:
          description: Severity level
          enum:
            - SEVERE
            - MODERATE
            - MILD
            - UNKNOWN
          example: MODERATE
          type: string
        status:
          description: Problem status
          enum:
            - ACTIVE
            - RESOLVED
            - UNKNOWN
          example: ACTIVE
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2023-01-10T14:30:00Z'
          format: date-time
          type: string
        updatedBy:
          description: Last updated by (staff name)
          example: Dr. Jane Smith
          type: string
      type: object
    ProblemListResponse:
      description: List of problems
      properties:
        problems:
          description: List of problems
          items:
            $ref: '#/components/schemas/ProblemDTO'
          type: array
      type: object
    RecurringPaymentDTO:
      description: Recurring payment details
      properties:
        amountCents:
          description: Amount per payment in cents
          example: 10000
          format: int64
          type: integer
        amountDisplay:
          description: Formatted amount
          example: $100.00
          type: string
        cardBrand:
          description: Card brand
          example: visa
          type: string
        cardLast4:
          description: Last 4 digits of card on file
          example: '4242'
          type: string
        completedPayments:
          description: Number of payments completed
          example: 3
          format: int32
          type: integer
        createdAt:
          description: Creation timestamp
          example: '2025-01-01T10:00:00Z'
          format: date-time
          type: string
        description:
          description: Description/memo
          example: Monthly payment plan
          type: string
        endDate:
          description: When the recurring payment ends (if limited)
          example: '2025-12-31T23:59:59Z'
          format: date-time
          type: string
        frequency:
          description: Payment frequency
          enum:
            - WEEKLY
            - BIWEEKLY
            - MONTHLY
            - QUARTERLY
            - ANNUALLY
          example: MONTHLY
          type: string
        id:
          description: Unique recurring payment identifier
          example: 12345
          format: int64
          type: integer
        nextPaymentDate:
          description: Date of next payment
          example: '2025-02-01'
          type: string
        patientId:
          description: Patient ID
          example: 67890
          format: int64
          type: integer
        patientName:
          description: Patient name
          example: John Doe
          type: string
        remainingPayments:
          description: Number of payments remaining
          example: 9
          format: int32
          type: integer
        startDate:
          description: When the recurring payment started
          example: '2025-01-01T00:00:00Z'
          format: date-time
          type: string
        status:
          description: Status
          enum:
            - ACTIVE
            - PAUSED
            - CANCELLED
            - COMPLETED
            - FAILED
          example: ACTIVE
          type: string
        totalPayments:
          description: Total number of payments (null = unlimited)
          example: 12
          format: int32
          type: integer
        updatedAt:
          description: Last update timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
      type: object
    RecurringPaymentListResponse:
      description: Paginated list of recurring payments
      properties:
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
        recurringPayments:
          description: List of recurring payments
          items:
            $ref: '#/components/schemas/RecurringPaymentDTO'
          type: array
      type: object
    RemoteCareServiceDTO:
      description: Details of a remote care service
      properties:
        billingCode:
          description: Billing code
          example: '99213'
          type: string
        costInCents:
          description: Service cost in cents
          example: 7500
          format: int32
          type: integer
        id:
          description: RemoteCareService ID
          example: 101
          format: int64
          type: integer
        name:
          description: Service name
          example: Virtual Consultation
          type: string
        requiresLab:
          description: Whether service requires lab work
          example: false
          type: boolean
      type: object
    RemoteCareServiceListResponse:
      description: Paginated list of remote care services
      properties:
        data:
          description: List of services
          items:
            $ref: '#/components/schemas/RemoteCareServiceDTO'
          type: array
        nextCursor:
          description: Cursor for next page
          type: string
      type: object
    RemoteCareSettingDTO:
      description: Remote care configuration for a location
      properties:
        id:
          description: Remote care location ID
          example: 123
          format: int64
          type: integer
        locationId:
          description: Associated location ID
          example: 456
          format: int64
          type: integer
        selfSchedulingSettingAtHomeTestKitId:
          description: ID for at-home test kit self-scheduling settings
          example: 102
          format: int64
          type: integer
        selfSchedulingSettingInOfficeVisitId:
          description: ID for in-office visit self-scheduling settings
          example: 101
          format: int64
          type: integer
        staffId:
          description: Default staff ID
          example: 789
          format: int64
          type: integer
      type: object
    RoleGroupDTO:
      description: Role group details
      properties:
        id:
          description: Unique role group identifier
          example: 1
          format: int64
          type: integer
        name:
          description: Role group name
          example: User
          type: string
      type: object
    RoleGroupListResponse:
      description: List of role groups
      properties:
        roleGroups:
          description: List of role groups
          items:
            $ref: '#/components/schemas/RoleGroupDTO'
          type: array
      type: object
    ScheduleSlotOutputDTO:
      description: >-
        An available time slot for booking. When arePractitionersSelectable is
        false, practitionerId and schedulerConfigId identify the single
        best-ranked practitioner for this slot. When arePractitionersSelectable
        is true, practitionerToConfig lists all available practitioners for the
        slot.
      properties:
        endUnix:
          description: Slot end time in milliseconds since epoch
          example: 1704105000000
          format: int64
          type: integer
        practitionerId:
          description: >-
            Practitioner ID for this slot. Present when practitioners are NOT
            selectable (system auto-assigns the best-ranked practitioner).
          example: 42
          format: int64
          type: integer
        practitionerToConfig:
          additionalProperties:
            description: >-
              Map of practitioner ID to scheduler config ID. Present when
              practitioners ARE selectable, listing every practitioner available
              for this time slot. Example: {"42": 7, "55": 12}
            format: int64
            type: integer
          description: >-
            Map of practitioner ID to scheduler config ID. Present when
            practitioners ARE selectable, listing every practitioner available
            for this time slot. Example: {"42": 7, "55": 12}
          type: object
        schedulerConfigId:
          description: >-
            Scheduler config ID for this slot. Present when practitioners are
            NOT selectable.
          example: 7
          format: int64
          type: integer
        startUnix:
          description: Slot start time in milliseconds since epoch
          example: 1704103200000
          format: int64
          type: integer
      type: object
    SelfSchedulingAttemptResponse:
      description: Self-scheduling attempt response
      properties:
        appointmentId:
          description: >-
            Appointment ID if appointment has been created. Omitted if not yet
            created.
          example: 202
          format: int64
          type: integer
        id:
          description: Attempt ID
          example: 789
          format: int64
          type: integer
        identityProofId:
          description: Associated identity proof ID
          example: 456
          format: int64
          type: integer
        isVerified:
          description: Whether all required verification methods have been completed
          example: true
          type: boolean
        patientId:
          description: >-
            Patient ID if patient has been set (AccountPatient ID). Omitted if
            not yet set.
          example: 101
          format: int64
          type: integer
        selfSchedulingSettingId:
          description: Associated self-scheduling setting ID
          example: 123
          format: int64
          type: integer
      type: object
    SelfSchedulingSettingResponse:
      description: Self-scheduling setting configuration
      properties:
        active:
          description: Whether the scheduler is active
          example: true
          type: boolean
        afterwardBookingLimit:
          description: Afterward booking limit value (minimum time before appointment)
          format: int32
          type: integer
        afterwardBookingLimitActive:
          description: Whether afterward booking limit is active
          example: false
          type: boolean
        afterwardBookingLimitUnit:
          description: Unit for afterward booking limit
          enum:
            - HOURS
            - DAYS
            - WEEKS
            - MONTHS
          example: 'null'
          type: string
        appointmentTypeIds:
          description: List of associated appointment type IDs
          items:
            description: List of associated appointment type IDs
            format: int64
            type: integer
          type: array
        appointmentTypeSelectable:
          description: Whether patients can select the appointment type
          example: true
          type: boolean
        appointmentTypeVisible:
          description: Whether appointment type selection is visible to patients
          example: true
          type: boolean
        fixedAppointmentTypeId:
          description: Fixed appointment type ID if not selectable
          format: int64
          type: integer
        fixedLocationId:
          description: Fixed location ID if location is not selectable
          format: int64
          type: integer
        forwardBookingLimit:
          description: Forward booking limit value
          example: 30
          format: int32
          type: integer
        forwardBookingLimitActive:
          description: Whether forward booking limit is active
          example: true
          type: boolean
        forwardBookingLimitUnit:
          description: Unit for forward booking limit
          enum:
            - HOURS
            - DAYS
            - WEEKS
            - MONTHS
          example: DAYS
          type: string
        id:
          description: Self-scheduling setting ID
          example: 123
          format: int64
          type: integer
        locationIds:
          description: List of associated location IDs
          items:
            description: List of associated location IDs
            format: int64
            type: integer
          type: array
        locationSelectable:
          description: Whether patients can select the location
          example: true
          type: boolean
        locationVisible:
          description: Whether location selection is visible to patients
          example: true
          type: boolean
        name:
          description: Display name for this scheduler
          example: New Patient Appointments
          type: string
        practitionerIds:
          description: List of associated practitioner IDs
          items:
            description: List of associated practitioner IDs
            format: int64
            type: integer
          type: array
        practitionerSelectable:
          description: Whether patients can select their practitioner
          example: true
          type: boolean
        practitionerVisible:
          description: Whether practitioner selection is visible to patients
          example: true
          type: boolean
        publicUuid:
          description: Public UUID for this setting
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
        schedulerConfigIds:
          description: List of scheduler config IDs for booking appointments
          items:
            description: List of scheduler config IDs for booking appointments
            format: int64
            type: integer
          type: array
        verificationMethod:
          description: Method used to verify patient identity
          enum:
            - EMAIL
            - SMS
            - EMAIL_AND_SMS
          example: EMAIL_AND_SMS
          type: string
        welcomeMessageSubtitle:
          description: Welcome message subtitle
          example: Please select a time for your appointment
          type: string
        welcomeMessageTitle:
          description: Welcome message title
          example: Welcome to Our Practice
          type: string
      type: object
    SendVerificationRequest:
      description: Request to send verification code
      properties:
        email:
          description: Email to verify. Provide either email or phone, not both.
          example: john@example.com
          type: string
        phone:
          description: >-
            Phone number to verify (10-digit US number, e.g. 5551234567).
            Country code is optional and defaults to US (+1). Provide either
            email or phone, not both.
          type: string
      type: object
    SendVerificationResponse:
      description: Response from send verification request
      properties:
        sent:
          description: Whether the verification code was sent successfully
          example: true
          type: boolean
      type: object
    StaffDTO:
      description: Staff member details
      properties:
        createdAt:
          description: Creation timestamp
          example: '2024-06-01T10:00:00Z'
          format: date-time
          type: string
        email:
          description: Email address
          example: jane.smith@clinic.com
          type: string
        firstName:
          description: First name
          example: Jane
          type: string
        id:
          description: Unique staff member identifier
          example: 12345
          format: int64
          type: integer
        isPractitioner:
          description: Whether this staff member is a clinical practitioner
          example: true
          type: boolean
        lastLoginAt:
          description: Last login timestamp
          example: '2025-01-15T09:00:00Z'
          format: date-time
          type: string
        lastName:
          description: Last name
          example: Smith
          type: string
        locationIds:
          description: Location IDs the staff member has access to
          items:
            description: Location IDs the staff member has access to
            format: int64
            type: integer
          type: array
        npi:
          description: NPI (National Provider Identifier)
          example: '1234567890'
          type: string
        phone:
          description: Phone number
          example: '+15551234567'
          type: string
        profileImageUrl:
          description: Profile image URL
          type: string
        roleGroupIds:
          description: Assigned role group IDs
          items:
            description: Assigned role group IDs
            format: int64
            type: integer
          type: array
        schedulable:
          description: Whether practitioner can be scheduled for appointments
          example: true
          type: boolean
        status:
          description: Account status
          enum:
            - ACTIVE
            - INACTIVE
            - PENDING
          example: ACTIVE
          type: string
        title:
          description: Job title
          example: Office Manager
          type: string
        updatedAt:
          description: Last update timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
      type: object
    StaffListResponse:
      description: Paginated list of staff members
      properties:
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
        staff:
          description: List of staff members in this page
          items:
            $ref: '#/components/schemas/StaffDTO'
          type: array
      type: object
    TestComponentDTO:
      description: Lab test component (individual result)
      properties:
        abnormalFlag:
          description: Abnormal flag
          enum:
            - BELOW_NORMAL
            - WITHIN_NORMAL
            - ABOVE_NORMAL
          example: WITHIN_NORMAL
          type: string
        externalId:
          description: External ID from vendor
          example: GLU
          type: string
        id:
          description: Unique component identifier
          example: 98765
          format: int64
          type: integer
        name:
          description: Test name
          example: Glucose
          type: string
        referenceHigh:
          description: Reference range high
          example: '100'
          type: string
        referenceLow:
          description: Reference range low
          example: '70'
          type: string
        referenceText:
          description: Reference range text (if non-numeric)
          example: Negative
          type: string
        resultStatus:
          description: Result status
          enum:
            - PRELIMINARY
            - FINAL
            - CORRECTED
            - CANCELLED
          example: FINAL
          type: string
        unit:
          description: Unit of measurement
          example: mg/dL
          type: string
        value:
          description: Result value
          example: '95'
          type: string
      type: object
    TestComponentListResponse:
      description: Paginated list of test components
      properties:
        components:
          description: List of test components
          items:
            $ref: '#/components/schemas/TestComponentDTO'
          type: array
        nextCursor:
          description: Opaque cursor for fetching the next page. Null if no more results.
          type: string
      type: object
    TestPanelDTO:
      description: Lab test panel
      properties:
        components:
          description: Test components in this panel
          items:
            $ref: '#/components/schemas/TestComponentDTO'
          type: array
        externalId:
          description: External ID from vendor
          example: CMP-14
          type: string
        id:
          description: Unique panel identifier
          example: 54321
          format: int64
          type: integer
        name:
          description: Panel name
          example: Comprehensive Metabolic Panel
          type: string
      type: object
    TestWebhookResponse:
      description: Response from webhook test
      properties:
        errorMessage:
          description: Error message if failed
          type: string
        responseBody:
          description: Response body from the endpoint
          example: '{"received":true}'
          type: string
        responseStatusCode:
          description: HTTP response status code from the endpoint
          example: 200
          format: int32
          type: integer
        responseTimeMs:
          description: Response time in milliseconds
          example: 150
          format: int32
          type: integer
        success:
          description: Whether the test was successful
          example: true
          type: boolean
        testEventId:
          description: Test event ID
          example: evt_test_abc123
          type: string
      type: object
    UpdateAppointmentRequest:
      description: Request to update an existing appointment
      properties:
        note:
          description: Updated appointment notes
          example: Follow-up for lab results
          type: string
        practitionerId:
          description: >-
            New practitioner ID for reassignment (staff member with a
            practitioner role)
          example: 223
          format: int64
          type: integer
        startTime:
          description: New appointment start time (ISO 8601) for rescheduling
          example: '2025-01-16T10:00:00-05:00'
          type: string
        status:
          description: New status
          enum:
            - SCHEDULED
            - CONFIRMED
            - CHECKED_IN
            - IN_TREATMENT
            - CHECKED_OUT
            - CANCELLED
            - NO_SHOW
          example: CONFIRMED
          pattern: >-
            (?i)SCHEDULED|CONFIRMED|CHECKED_IN|IN_TREATMENT|CHECKED_OUT|CANCELLED|NO_SHOW
          type: string
      type: object
    UpdateConversionRequest:
      description: Request object for updating a conversion
      properties:
        address:
          description: Street address line 1
          type: string
        address2:
          description: Street address line 2
          type: string
        city:
          description: City
          type: string
        dateOfBirth:
          description: Patient DOB (YYYY-MM-DD)
          format: date
          type: string
        email:
          description: Patient email
          type: string
        firstName:
          description: Patient first name
          type: string
        lastName:
          description: Patient last name
          type: string
        phone:
          description: Patient phone
          type: string
        remoteCareServiceIds:
          description: Array of selected RemoteCareService IDs
          items:
            description: Array of selected RemoteCareService IDs
            format: int64
            type: integer
          type: array
        selfSchedulingAttemptId:
          description: Link to self-scheduling attempt
          format: int64
          type: integer
        state:
          description: State code
          type: string
        zip:
          description: Postal code
          type: string
      type: object
    UpdateFormPacketRequest:
      description: Request to update a form packet
      properties:
        addFormTemplateIds:
          description: Additional form template IDs to add
          example:
            - 104
          items:
            description: Additional form template IDs to add
            format: int64
            type: integer
          type: array
        dueDate:
          description: New due date (ISO 8601)
          example: '2025-01-25T17:00:00-05:00'
          type: string
        status:
          description: New status
          enum:
            - COMPLETED
            - ARCHIVED
          type: string
      type: object
    UpdatePatientRequest:
      description: >-
        Request to update patient information. All fields are optional - only
        provided fields will be updated.
      properties:
        dateOfBirth:
          description: Patient's date of birth in ISO 8601 format (YYYY-MM-DD)
          example: '1990-01-15'
          pattern: ^\d{4}-\d{2}-\d{2}$
          type: string
        email:
          description: Patient's email address
          example: john.doe@example.com
          format: email
          maxLength: 255
          minLength: 0
          type: string
        firstName:
          description: Patient's first name
          example: John
          maxLength: 80
          minLength: 0
          type: string
        gender:
          description: >-
            Patient's gender. Reference
            https://www.hl7.org/fhir/R4/codesystem-gender-identity.html for
            possible values.
          example: Male
          type: string
        lastName:
          description: Patient's last name
          example: Doe
          maxLength: 80
          minLength: 0
          type: string
        mobilePhone:
          description: >-
            Patient's mobile phone number (can include '+' and formatting, will
            be normalized to digits only)
          example: '+14155551234'
          maxLength: 255
          minLength: 0
          pattern: ^\+?[0-9]+$
          type: string
      type: object
    UpdateWebhookEndpointRequest:
      description: Request to update a webhook endpoint
      properties:
        eventTypes:
          description: Updated event types to subscribe to
          items:
            description: Updated event types to subscribe to
            type: string
          type: array
        isEnabled:
          description: Enable or disable the endpoint
          type: boolean
        name:
          description: Friendly name for the endpoint
          example: Production Webhook v2
          type: string
        url:
          description: New webhook URL
          example: https://api.example.com/webhooks/lobbie-v2
          type: string
      type: object
    VerifyCodeRequest:
      description: Request to verify code
      properties:
        code:
          description: Verification code received
          example: '123456'
          type: string
        email:
          description: >-
            Email that received the code. Provide either email or phone, not
            both.
          example: john@example.com
          type: string
        phone:
          description: >-
            Phone number that received the code (10-digit US number, e.g.
            5551234567). Country code is optional and defaults to US (+1).
            Provide either email or phone, not both.
          type: string
      required:
        - code
      type: object
    VerifyCodeResponse:
      description: Response from verify code request
      properties:
        verified:
          description: Whether the code was verified successfully
          example: true
          type: boolean
        verifiedEmail:
          description: Verified email (if verification succeeded)
          example: john@example.com
          type: string
        verifiedPhone:
          description: Verified phone (if verification succeeded)
          example: '5551234567'
          type: string
      type: object
    WebhookEndpointDTO:
      description: Webhook endpoint configuration
      properties:
        createdAt:
          description: Creation timestamp
          example: '2025-01-01T10:00:00Z'
          format: date-time
          type: string
        eventTypes:
          description: Event types this endpoint is subscribed to
          example:
            - appointment.created
            - appointment.updated
            - form.completed
          items:
            description: Event types this endpoint is subscribed to
            example: '["appointment.created","appointment.updated","form.completed"]'
            type: string
          type: array
        failureCount24h:
          description: Number of failed deliveries in the last 24 hours
          example: 2
          format: int32
          type: integer
        id:
          description: Unique webhook endpoint identifier
          example: 12345
          format: int64
          type: integer
        isEnabled:
          description: Whether this endpoint is enabled
          example: true
          type: boolean
        lastFailureAt:
          description: Timestamp of last failed delivery
          format: date-time
          type: string
        lastSuccessAt:
          description: Timestamp of last successful delivery
          format: date-time
          type: string
        name:
          description: Friendly name for the endpoint
          example: Production Webhook
          type: string
        signingSecret:
          description: Signing secret (only shown on creation)
          example: whsec_abc123...
          type: string
        successCount24h:
          description: Number of successful deliveries in the last 24 hours
          example: 42
          format: int32
          type: integer
        updatedAt:
          description: Last update timestamp
          example: '2025-01-10T14:30:00Z'
          format: date-time
          type: string
        url:
          description: Webhook URL where events are delivered
          example: https://api.example.com/webhooks/lobbie
          type: string
      type: object
    WebhookEndpointListResponse:
      description: List of webhook endpoints
      properties:
        webhooks:
          description: List of webhook endpoints
          items:
            $ref: '#/components/schemas/WebhookEndpointDTO'
          type: array
      type: object
  securitySchemes:
    PartnerOAuth:
      bearerFormat: JWT
      description: OAuth 2.0 access token from integration webhook
      scheme: bearer
      type: http
info:
  contact:
    email: api-support@lobbie.com
    name: Lobbie API Team
  description: >
    # Partner API Overview


    ## Authentication


    The Partner API uses **OAuth 2.0 with AWS Cognito** for secure
    machine-to-machine (M2M) authentication.


    ### Prerequisites


    Before making API requests, you must complete the partner onboarding
    process:


    1. **Partner Registration**: Lobbie creates a partner integrator record with
    your unique `client_id`

    2. **Cognito Credentials**: Lobbie provides OAuth 2.0 client credentials
    (client ID and client secret)

    3. **Account Grants**: Lobbie grants your integration access to specific
    accounts


    ### Obtaining an Access Token


    Request an access token using the OAuth 2.0 client credentials by sending an
    HTTPS form POST:


    ```

    POST https://partner-api.lobbie.com/oauth/token

    Content-Type: application/x-www-form-urlencoded


    grant_type=client_credentials&

    client_id=<your_client_id>&

    client_secret=<your_client_secret>

    ```


    The response contains a JWT access token:


    ```json

    {
        "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
        "token_type": "Bearer",
        "expires_in": 3600
    }

    ```


    ### Making Authenticated Requests


    Include the access token in the `Authorization` header of every API request:


    ```

    Authorization: Bearer <access_token>

    ```


    ### Token Management


    - Access tokens expire after the duration specified in `expires_in`
    (default: 60 minutes)

    - Request a new token before the current one expires

    - Store credentials securely—they grant access to protected health
    information (PHI)

    - If credentials are compromised, contact Lobbie support immediately to
    revoke and regenerate


    ### Authorization


    Your partner integration must have an active grant to access each account.
    The API validates:


    1. The JWT token is valid and not expired

    2. Your `client_id` corresponds to an active partner integrator

    3. Your integration has an active grant to the requested account

    4. The requested location belongs to the specified account


    ## Common Errors


    | Status | Error        |
    Description                                                           |

    | ------ | ------------ |
    --------------------------------------------------------------------- |

    | 401    | Unauthorized | Invalid, expired, or missing access
    token                             |

    | 403    | Forbidden    | Integration does not have access to the requested
    account or location |

    | 404    | Not Found    | Resource not found or does not belong to the
    authorized account       |


    ## HIPAA & Compliance


    - All patient data is Protected Health Information (PHI)

    - Encrypt data at rest and in transit

    - Maintain audit logs of all data access

    - Sign Business Associate Agreement (BAA) before production access

    - Follow data retention policies per agreement


    ---


    # Terminology


    This glossary defines domain-specific terms used throughout the Lobbie
    Partner API.


    ---


    ## Core Entities


    ### Account


    A healthcare practice or organization using Lobbie. Each account contains
    practice-wide settings and configurations, and can have multiple locations.
    All API access is scoped to a specific account via OAuth tokens.


    ### Location


    A physical practice site, clinic, or virtual care location within an
    account. Locations have their own addresses, staff assignments, schedules,
    and operational settings. Appointments, forms, and many operations are
    location-scoped. Each location has timezone information critical for
    accurate scheduling. Locations may have an optional `storeId` that partners
    can use to correlate Lobbie locations with their own systems.


    ### Patient


    An individual receiving healthcare services from a specific account.
    Contains demographic information (name, date of birth) and contact details
    (email, phone). Serves as the central entity linking appointments, forms,
    invoices, and clinical data. Subject to HIPAA privacy requirements.


    ---


    ## Scheduling


    ### Appointment


    A scheduled visit between a patient and practitioner at a specific location
    and time. Appointments track the complete visit lifecycle from initial
    scheduling through check-in, the visit itself, and completion or
    cancellation. Each appointment links to an appointment type, patient,
    practitioner, and location.


    ### Appointment Type


    A template defining a schedulable service, including duration, telehealth
    settings, display color, and patient-facing description/instructions.
    Examples: "New Patient Consultation" (30 min), "Follow-up Visit" (15 min),
    "Telehealth Checkup" (20 min). Appointment types determine what services
    patients can book and how long they're scheduled.


    ### Practitioner


    A staff member designated as a clinical provider who can see patients and be
    scheduled for appointments. Practitioners have credentials (MD, DO, NP, PA,
    RN), NPI numbers, specialties, and license information. All practitioners
    are staff members, but not all staff are practitioners.


    ### Self-Scheduling


    Patient-initiated appointment booking through embeddable widgets or API
    integration. Self-scheduling respects practice availability rules,
    appointment type configurations, and booking windows. Patients can browse
    available times and complete bookings without staff intervention.


    ### Self-Scheduling Attempt


    A record of a patient's journey through the self-scheduling process, from
    initiation to completion or abandonment. Captures step-by-step progress for
    conversion analysis, identifying drop-off points, and triggering follow-up
    workflows for incomplete attempts.


    ---


    ## Staff & Access


    ### Staff Member


    Any team member with system access, including administrative staff, clinical
    support, and practitioners. Staff have role assignments determining their
    permissions and location access.


    ### Role Group


    A permission set defining capabilities and access levels for staff members.
    Role groups control what actions staff can perform within the system, from
    standard user access to full administrative privileges. Staff members can
    have multiple role groups assigned, combining permissions as needed.


    ---


    ## Forms & Documentation


    ### Form Template


    A reusable form design defining structure, fields, validation rules, and
    conditional logic. Templates are created once and used to generate form
    instances for patients. Form templates support versioning—when a template is
    modified, a new version is created while preserving previous versions for
    historical form submissions. Examples: "Patient Intake Form", "HIPAA
    Consent", "Medical History Questionnaire".


    ### Form Group


    A collection of one or more form instances assigned to a patient for
    completion. Form groups track overall completion status and can include
    multiple related forms. A form group is considered complete when all forms
    within it have been submitted, and can be archived when no longer needed.


    ### Form


    An individual form instance within a form group, based on a form template
    version. Each form tracks its own completion status and contains the
    patient's responses.


    ### Form Element


    A single field or component within a form template that captures patient
    input or displays content. Element types include: text inputs, text areas,
    dropdowns, checkboxes, radio buttons, date pickers, signatures, initials,
    file uploads, phone numbers, email addresses, addresses, and specialized
    types like payment fields and body diagrams. Elements can be configured as
    required or optional, and can have visibility rules controlling who can view
    or edit them (patient only, staff only, or both).


    ### Form Answer


    A patient's response to a specific form element. Answers are stored per
    element and can be text, selections, dates, signatures, or file uploads
    depending on the element type.


    ### Form Template Group


    A predefined collection of form templates commonly assigned together.
    Simplifies assigning multiple related forms in a single operation (e.g.,
    "New Patient Packet" containing intake, consent, and history forms).


    ---


    ## Billing & Payments


    ### Invoice


    An itemized billing statement for a patient detailing charges for services,
    products, taxes, and fees. Invoices progress through a lifecycle from
    creation to payment or cancellation. Invoices can be linked to appointments
    or created independently.


    ### Invoice Line Item


    A single charge entry within an invoice. Line items specify quantity, unit
    price, and description, and can represent services, products, adjustments,
    or taxes. May reference billing codes and associated care resources.


    ### Payment Request


    A trackable record of a payment’s lifecycle, from initiation to final
    settlement. Each request tracks its status from creation through payment or
    expiration, whether triggered as a remote request sent to a patient (via
    email or SMS) or entered directly by staff for immediate processing.


    ### Recurring Payment


    An automated payment plan with scheduled charges at defined intervals. Used
    for payment plans, memberships, and subscription services. Configured with a
    frequency (weekly, monthly, etc.), amount, linked payment method, and
    optional end date.


    ---


    ## Labs & Clinical


    ### Lab


    A laboratory order containing one or more test panels with results. Labs
    track progress from order placement through result delivery. Labs can be
    in-house or from external vendors and link to patients and optionally
    appointments.


    ### Test Panel


    A grouping of related lab tests within a lab order. Examples: "Comprehensive
    Metabolic Panel", "Complete Blood Count", "Lipid Panel". Each panel contains
    multiple test components.


    ### Test Component


    An individual lab measurement within a test panel. Contains the test name,
    result value, unit of measurement, reference range, and an indicator of
    whether the result is normal or abnormal.


    ### Health Profile


    Structured patient health information including medical history, allergies,
    medications, and clinical data collected through intake forms and clinical
    encounters.


    ---


    ## Patient Management


    ### Category


    A service category that can function as either a CRM-tracked sales pipeline
    or a simple organizational tag. When CRM-tracked, categories enable full
    pipeline tracking through status stages with dashboard visibility. When not
    CRM-tracked, categories function as simple groupings for billing, inventory,
    or reporting. Examples of CRM categories: "Men's Health - Testosterone",
    "Weight Loss - Semaglutide". Examples of simple categories: "Lab Supplies",
    "Office Visits".


    ### Patient Category


    A patient's enrollment in a specific service category with CRM status
    tracking. Represents the link between a patient and a category, tracking
    their progress through the associated CRM pipeline. Appears as an
    "Opportunity" in CRM dashboards. Tracks status transitions with a complete
    audit trail.


    ### CRM Status Group


    A reusable CRM workflow pipeline (sales/marketing funnel) that defines the
    customer journey stages. Think of it as the sales funnel template—the
    workflow (HOW you sell) is separated from the product (WHAT you sell).
    Multiple categories often share the same sales process. Examples: "Digital
    Marketing Funnel" with stages like Cold Lead → Engaged → Sales Qualified →
    Closed Won; "Patient Care Journey" with stages like Intake → Insurance
    Verified → In Treatment → Complete.


    ### CRM Status


    An individual stage within a CRM status group representing where a patient
    is in a workflow. Status progression is tracked through transitions,
    providing a complete audit trail. Examples: "Cold Lead", "Sales Qualified",
    "Proposal Sent", "Closed Won", "Closed Lost".


    ---


    ## Communications


    ### Notification


    A system-generated message sent to a patient via email or SMS. Notifications
    are sent for various purposes including appointment reminders, form
    assignments, payment requests, and account recovery. Each notification
    tracks its delivery status.


    ### Notification Group


    Configuration defining how and when patients receive specific types of
    communications, customizable per location or appointment type.


    ---


    ## Identity & Security


    ### Identity Proof


    A verification session for authenticating patient identity through email
    and/or SMS code verification. Used for patient portal authentication,
    self-scheduling verification, and secure access to patient data. Each
    session generates a secure token and tracks which contact methods have been
    verified.


    ### Verification Method


    The channel(s) required to prove identity, which can be email only, SMS
    only, or both. The verification method determines what must be verified
    before the identity proof is considered complete.
  title: Lobbie Partner API
  version: '2.0'
openapi: 3.0.1
x-tagGroups:
  - name: API Endpoints
    tags:
      - Appointment Types
      - Appointments
      - CRM Status Groups
      - Categories
      - Form Template Groups
      - Form Templates
      - Forms
      - Identity Proof
      - Invoices
      - Labs
      - Locations
      - Notification Groups
      - Notifications
      - Patient Health Profile
      - Patients
      - Payment Requests
      - Recurring Payments
      - Remote Care Conversion
      - Remote Care Services
      - Remote Care Settings
      - Role Groups
      - Self-Scheduling
      - Self-Scheduling Attempt
      - Staff & Practitioners
      - Webhooks
paths:
  /partner/v2/account/{accountId}/appointment/type:
    get:
      description: >-
        Retrieve a paginated list of active appointment types for the account.
        Supports filtering by name/description and keyset pagination.
      operationId: listAppointmentTypes
      parameters:
        - description: Filter appointment types by name (case-insensitive contains match)
          example: Consultation
          in: query
          name: name
          schema:
            maxLength: 100
            minLength: 0
            type: string
        - description: >-
            Filter appointment types by description (case-insensitive contains
            match)
          example: arrive 15 minutes early
          in: query
          name: description
          schema:
            maxLength: 500
            minLength: 0
            type: string
        - description: Sort by field
          in: query
          name: sortBy
          schema:
            default: NAME
            enum:
              - NAME
              - CREATED_DATE
              - DURATION
            pattern: (?i)NAME|CREATED_DATE|DURATION
            type: string
        - description: Sort direction
          in: query
          name: sortDir
          schema:
            default: ASC
            enum:
              - ASC
              - DESC
            pattern: (?i)ASC|DESC
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            maxLength: 2048
            minLength: 0
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: >-
            Filter by active status. If not specified, returns both active and
            inactive appointment types.
          in: query
          name: active
          schema:
            enum:
              - true
              - false
            type: boolean
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentTypeListResponse'
          description: Appointment types retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List appointment types
      tags:
        - Appointment Types
  /partner/v2/account/{accountId}/appointment/type/{appointmentTypeId}:
    get:
      description: Retrieve details for a specific appointment type.
      operationId: getAppointmentType
      parameters:
        - description: Appointment Type ID
          in: path
          name: appointmentTypeId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentTypeDTO'
          description: Appointment type found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Appointment type not found
      summary: Get appointment type by ID
      tags:
        - Appointment Types
  /partner/v2/account/{accountId}/category:
    get:
      description: Retrieve the list of patient categories defined for the account.
      operationId: listCategories
      parameters:
        - description: Filter by active status
          in: query
          name: active
          schema:
            type: boolean
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryListResponse'
          description: Categories retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List categories
      tags:
        - Categories
  /partner/v2/account/{accountId}/category/{categoryId}:
    get:
      description: Retrieve detailed information about a specific category.
      operationId: getCategory
      parameters:
        - description: Category ID
          in: path
          name: categoryId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryDTO'
          description: Category found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Category not found
      summary: Get category by ID
      tags:
        - Categories
  /partner/v2/account/{accountId}/crm-status-group:
    get:
      description: Retrieve the list of CRM status groups defined for the account.
      operationId: listCrmStatusGroups
      parameters:
        - description: Filter by active status
          in: query
          name: active
          schema:
            type: boolean
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmStatusGroupListResponse'
          description: CRM status groups retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List CRM status groups
      tags:
        - CRM Status Groups
  /partner/v2/account/{accountId}/crm-status-group/{groupId}:
    get:
      description: Retrieve detailed information about a specific CRM status group.
      operationId: getCrmStatusGroup
      parameters:
        - description: CRM status group ID
          in: path
          name: groupId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmStatusGroupDTO'
          description: CRM status group found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: CRM status group not found
      summary: Get CRM status group by ID
      tags:
        - CRM Status Groups
  /partner/v2/account/{accountId}/crm-status-group/{groupId}/status:
    get:
      description: Retrieve all CRM statuses within the specified status group.
      operationId: listCrmStatuses
      parameters:
        - description: Filter by active status
          in: query
          name: active
          schema:
            type: boolean
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmStatusListResponse'
          description: CRM statuses retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: CRM status group not found
      summary: List CRM statuses in group
      tags:
        - CRM Status Groups
  /partner/v2/account/{accountId}/crm-status-group/{groupId}/status/{statusId}:
    get:
      description: Retrieve detailed information about a specific CRM status.
      operationId: getCrmStatus
      parameters:
        - description: CRM status ID
          in: path
          name: statusId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmStatusDTO'
          description: CRM status found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: CRM status not found
      summary: Get CRM status by ID
      tags:
        - CRM Status Groups
  /partner/v2/account/{accountId}/health-profile/allergies/{allergyId}:
    get:
      description: >-
        Retrieve detailed information about a specific allergy. Scoped by
        account.
      operationId: getAllergy
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Allergy ID
          in: path
          name: allergyId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllergyDTO'
          description: Allergy found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Allergy not found
      summary: Get allergy by ID
      tags:
        - Patient Health Profile
  /partner/v2/account/{accountId}/health-profile/medications/{medicationId}:
    get:
      description: >-
        Retrieve detailed information about a specific medication. Scoped by
        account.
      operationId: getMedication
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Medication ID
          in: path
          name: medicationId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MedicationDTO'
          description: Medication found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Medication not found
      summary: Get medication by ID
      tags:
        - Patient Health Profile
  /partner/v2/account/{accountId}/health-profile/problems/{problemId}:
    get:
      description: >-
        Retrieve detailed information about a specific problem/diagnosis. Scoped
        by account.
      operationId: getProblem
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Problem ID
          in: path
          name: problemId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDTO'
          description: Problem found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Problem not found
      summary: Get problem by ID
      tags:
        - Patient Health Profile
  /partner/v2/account/{accountId}/identity-proof:
    post:
      description: >-
        Create a new identity proof session for person verification within this
        account. Returns an ID and secure token for subsequent requests.
      operationId: createIdentityProof
      parameters:
        - in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdentityProofCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentityProofResponse'
          description: Identity proof created successfully
        '400':
          description: Invalid request - missing or invalid verification method
        '401':
          description: Unauthorized - invalid or missing partner token
        '404':
          description: Account not found
      summary: Create identity proof
      tags:
        - Identity Proof
  /partner/v2/account/{accountId}/identity-proof/{id}:
    get:
      description: >-
        Returns the current status of an identity proof session, including which
        verification methods have been verified and which are still pending.
      operationId: getIdentityProofStatus
      parameters:
        - in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - in: path
          name: id
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentityProofStatusResponse'
          description: Identity proof status retrieved successfully
        '404':
          description: Identity proof not found
      summary: Get identity proof status
      tags:
        - Identity Proof
  /partner/v2/account/{accountId}/identity-proof/{id}/patient:
    get:
      description: >-
        Find the matched patient for a verified identity proof. Returns the
        patient ID if a unique match is found. Returns 404 if no match found, or
        422 if multiple matches found (duplicate email/phone in account). All
        required communication methods must be verified before calling this
        endpoint.
      operationId: getPatient_1
      parameters:
        - in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - in: path
          name: id
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientMatchResponse'
          description: Patient found successfully
        '404':
          description: Identity proof not found, not fully verified, or no matching patient
        '422':
          description: Multiple patients found with same email/phone - data integrity issue
      summary: Get matched patient
      tags:
        - Identity Proof
  /partner/v2/account/{accountId}/identity-proof/{id}/send:
    post:
      description: >-
        Send verification code to email or phone. Does not perform patient
        matching - only proves contact ownership.
      operationId: sendVerification
      parameters:
        - in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - in: path
          name: id
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            examples:
              Email verification:
                description: Email verification
                value:
                  email: john@example.com
              SMS verification:
                description: SMS verification
                value:
                  phone: '5551234567'
            schema:
              $ref: '#/components/schemas/SendVerificationRequest'
        description: Provide either email or phone, not both
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendVerificationResponse'
          description: Verification code sent successfully
        '400':
          description: Invalid request - missing email/phone or both provided
        '404':
          description: Identity proof not found
      summary: Send verification code
      tags:
        - Identity Proof
  /partner/v2/account/{accountId}/identity-proof/{id}/verify:
    post:
      description: >-
        Verify the code sent via email or SMS. Returns verification status and
        the verified contact information (email/phone).
      operationId: verifyCode
      parameters:
        - in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - in: path
          name: id
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            examples:
              Verify SMS code:
                description: Verify SMS code
                value:
                  phone: '5551234567'
                  code: '123456'
              Verify email code:
                description: Verify email code
                value:
                  email: john@example.com
                  code: '123456'
            schema:
              $ref: '#/components/schemas/VerifyCodeRequest'
        description: >-
          Provide either email or phone (not both), along with the verification
          code
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyCodeResponse'
          description: Verification result (success or failure)
        '400':
          description: >-
            Invalid request - missing email/phone/code or both email and phone
            provided
        '404':
          description: Identity proof not found
      summary: Verify code
      tags:
        - Identity Proof
  /partner/v2/account/{accountId}/location:
    get:
      description: >-
        Retrieve a paginated list of active locations for the account. Supports
        filtering by name and storeId. Use storeId filter to find a location by
        partner's external identifier.
      operationId: listLocations
      parameters:
        - description: Filter locations by name (case-insensitive contains match)
          example: Main Street
          in: query
          name: name
          schema:
            maxLength: 100
            minLength: 0
            type: string
        - description: Filter by exact storeId (partner's external identifier)
          example: STORE123
          in: query
          name: storeId
          schema:
            maxLength: 100
            minLength: 0
            type: string
        - description: Sort by field
          in: query
          name: sortBy
          schema:
            default: NAME
            enum:
              - NAME
              - CREATED_DATE
            pattern: (?i)NAME|CREATED_DATE
            type: string
        - description: Sort direction
          in: query
          name: sortDir
          schema:
            default: ASC
            enum:
              - ASC
              - DESC
            pattern: (?i)ASC|DESC
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            maxLength: 2048
            minLength: 0
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: >-
            Filter by active status. If not specified, returns both active and
            inactive locations.
          in: query
          name: active
          schema:
            enum:
              - true
              - false
            type: boolean
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationListResponse'
          description: Locations retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List locations
      tags:
        - Locations
  /partner/v2/account/{accountId}/location/{locationId}:
    get:
      description: >-
        Retrieve location information by location ID. The location must belong
        to the account associated with the OAuth token.
      operationId: getLocation
      parameters:
        - description: Location ID
          example: 12345
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationDTO'
          description: Location found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Location not found or not associated with the authorized account
      summary: Get location by ID
      tags:
        - Locations
  /partner/v2/account/{accountId}/location/{locationId}/appointment:
    get:
      description: >-
        Retrieve a paginated list of appointments for the account. Supports
        filtering by location, practitioner, patient, date range, and status.
        Results are sorted by appointment start time by default.
      operationId: listAppointments
      parameters:
        - description: Filter by practitioner ID (staff member with a practitioner role)
          in: query
          name: practitionerId
          schema:
            format: int64
            type: integer
        - description: Filter by patient ID
          in: query
          name: patientId
          schema:
            format: int64
            type: integer
        - description: Filter by appointment type ID
          in: query
          name: appointmentTypeId
          schema:
            format: int64
            type: integer
        - description: >-
            Filter by status (SCHEDULED, CONFIRMED, CHECKED_IN, IN_TREATMENT,
            CHECKED_OUT, CANCELLED, NO_SHOW)
          in: query
          name: status
          schema:
            type: string
        - description: Start of date range (ISO 8601)
          example: '2025-01-01T00:00:00Z'
          in: query
          name: startDate
          schema:
            type: string
        - description: End of date range (ISO 8601)
          example: '2025-01-31T23:59:59Z'
          in: query
          name: endDate
          schema:
            type: string
        - description: Sort by field
          in: query
          name: sortBy
          schema:
            default: START_TIME
            enum:
              - START_TIME
              - CREATED_DATE
            pattern: (?i)START_TIME|CREATED_DATE
            type: string
        - description: Sort direction
          in: query
          name: sortDir
          schema:
            default: ASC
            enum:
              - ASC
              - DESC
            pattern: (?i)ASC|DESC
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            maxLength: 2048
            minLength: 0
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentListResponse'
          description: Appointments retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List appointments
      tags:
        - Appointments
    post:
      description: >-
        Schedule a new appointment for a patient. Requires patient ID,
        practitioner ID, appointment type ID, and the desired start time. The
        system will validate availability before confirming the appointment.
      operationId: createAppointment
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAppointmentRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentDTO'
          description: Appointment created successfully
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '409':
          description: Time slot is not available
        '422':
          description: Validation error - missing required fields or invalid references
      summary: Create appointment
      tags:
        - Appointments
  /partner/v2/account/{accountId}/location/{locationId}/appointment/{appointmentId}:
    get:
      description: >-
        Retrieve detailed information about a specific appointment including
        patient details, practitioner, location, and appointment type
        information.
      operationId: getAppointment
      parameters:
        - description: Appointment ID
          example: 12345
          in: path
          name: appointmentId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentDTO'
          description: Appointment found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Appointment not found
      summary: Get appointment by ID
      tags:
        - Appointments
    put:
      description: >-
        Update an existing appointment. Can be used to reschedule (change
        time/practitioner) or update appointment details. Only provided fields
        will be updated.
      operationId: updateAppointment
      parameters:
        - description: Appointment ID
          in: path
          name: appointmentId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAppointmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentDTO'
          description: Appointment updated successfully
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Appointment not found
        '409':
          description: New time slot is not available
      summary: Update appointment
      tags:
        - Appointments
  /partner/v2/account/{accountId}/location/{locationId}/form:
    get:
      description: >-
        Retrieve a paginated list of form packets for the account. Supports
        filtering by patient, location, status, and date range. Form packets
        contain one or more forms assigned to a patient.
      operationId: listFormPackets
      parameters:
        - description: Filter by patient ID
          in: query
          name: patientId
          schema:
            format: int64
            type: integer
        - description: Filter by location ID
          in: query
          name: locationId
          schema:
            format: int64
            type: integer
        - description: Filter by status (PENDING, IN_PROGRESS, COMPLETED, ARCHIVED)
          in: query
          name: status
          schema:
            type: string
        - description: Filter by form template ID
          in: query
          name: formTemplateId
          schema:
            format: int64
            type: integer
        - description: Start of date range (ISO 8601)
          in: query
          name: startDate
          schema:
            type: string
        - description: End of date range (ISO 8601)
          in: query
          name: endDate
          schema:
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormPacketListResponse'
          description: Form packets retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List form packets
      tags:
        - Forms
    post:
      description: >-
        Create a new form packet for a patient. Specify the patient, location,
        and either a list of form template IDs or a form template group ID.
        Optionally pre-fill form fields with known data and set a due date.
      operationId: createFormPacket
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFormPacketRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormPacketDTO'
          description: Form packet created successfully
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '422':
          description: Validation error - invalid template IDs or patient not found
      summary: Create form packet
      tags:
        - Forms
  /partner/v2/account/{accountId}/location/{locationId}/form/group:
    get:
      description: >-
        Retrieve a list of form template groups available for the location. Form
        template groups are pre-configured collections of forms that can be
        assigned together.
      operationId: listFormTemplateGroups
      parameters:
        - description: Include inactive groups
          example: false
          in: query
          name: includeInactive
          schema:
            default: false
            type: boolean
        - description: Pagination cursor
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormTemplateGroupListResponse'
          description: Form template groups retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List form template groups
      tags:
        - Form Template Groups
  /partner/v2/account/{accountId}/location/{locationId}/form/group/{groupId}:
    get:
      description: >-
        Retrieve detailed information about a form template group including the
        list of form templates it contains.
      operationId: getFormTemplateGroup
      parameters:
        - description: Form template group ID
          in: path
          name: groupId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormTemplateGroupDTO'
          description: Form template group found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form template group not found
      summary: Get form template group by ID
      tags:
        - Form Template Groups
  /partner/v2/account/{accountId}/location/{locationId}/form/template:
    get:
      description: >-
        Retrieve a paginated list of active form templates for the account.
        Templates define the structure of forms that can be assigned to
        patients. Supports filtering by appointment type and staff-only
        visibility.
      operationId: listFormTemplates
      parameters:
        - description: Filter by appointment type ID
          in: query
          name: appointmentTypeId
          schema:
            format: int64
            type: integer
        - description: Filter for staff-only templates
          in: query
          name: isStaffOnly
          schema:
            type: boolean
        - description: Include inactive templates
          in: query
          name: includeInactive
          schema:
            type: boolean
        - description: Search by template name
          in: query
          name: search
          schema:
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormTemplateListResponse'
          description: Form templates retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List form templates
      tags:
        - Form Templates
  /partner/v2/account/{accountId}/location/{locationId}/form/template/groups:
    get:
      description: >-
        Retrieve a list of form template groups for the account. Template groups
        are pre-configured bundles of forms, often used for specific workflows
        (e.g., 'New Patient Intake', 'Annual Physical').
      operationId: listFormTemplateGroups_1
      parameters:
        - description: Filter by location ID
          in: query
          name: locationId
          schema:
            format: int64
            type: integer
        - description: Filter by practitioner ID
          in: query
          name: practitionerId
          schema:
            format: int64
            type: integer
        - description: Include inactive groups
          in: query
          name: includeInactive
          schema:
            type: boolean
        - description: Pagination cursor
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormTemplateGroupListResponse'
          description: Form template groups retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List form template groups
      tags:
        - Form Templates
  /partner/v2/account/{accountId}/location/{locationId}/form/template/groups/{groupId}:
    get:
      description: >-
        Retrieve detailed information about a form template group including the
        list of templates it contains.
      operationId: getFormTemplateGroup_1
      parameters:
        - description: Form template group ID
          example: 500
          in: path
          name: groupId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormTemplateGroupDTO'
          description: Form template group found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form template group not found
      summary: Get form template group by ID
      tags:
        - Form Templates
  /partner/v2/account/{accountId}/location/{locationId}/form/template/{formTemplateId}:
    get:
      description: >-
        Retrieve detailed information about a form template including all form
        elements/fields. Use this to understand the structure of a form for
        integration purposes.
      operationId: getFormTemplate
      parameters:
        - description: Form template ID
          example: 12345
          in: path
          name: formTemplateId
          required: true
          schema:
            format: int64
            type: integer
        - description: Include form elements/fields in response
          example: true
          in: query
          name: includeElements
          schema:
            default: true
            type: boolean
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormTemplateDTO'
          description: Form template found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form template not found
      summary: Get form template by ID
      tags:
        - Form Templates
  /partner/v2/account/{accountId}/location/{locationId}/form/template/{formTemplateId}/attributes:
    get:
      description: >-
        Retrieve the list of mapped attributes for a template. Attributes are
        named mappings for form fields (e.g., 'patient_first_name') that can be
        used for pre-filling and data extraction.
      operationId: getFormTemplateAttributes
      parameters:
        - description: Form template ID
          in: path
          name: formTemplateId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormAttributeListResponse'
          description: Form attributes retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form template not found
      summary: Get form template attributes
      tags:
        - Form Templates
  /partner/v2/account/{accountId}/location/{locationId}/form/template/{formTemplateId}/elements:
    get:
      description: >-
        Retrieve the list of form elements (fields) for a template. Each element
        represents an input field, with its type, label, and optional attribute
        mapping.
      operationId: getFormTemplateElements
      parameters:
        - description: Form template ID
          in: path
          name: formTemplateId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormElementListResponse'
          description: Form elements retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form template not found
      summary: Get form template elements
      tags:
        - Form Templates
  /partner/v2/account/{accountId}/location/{locationId}/form/{formPacketId}:
    get:
      description: >-
        Retrieve detailed information about a form packet including all forms,
        their completion status, and submitted answers. Use this to check
        completion progress and retrieve patient responses.
      operationId: getFormPacket
      parameters:
        - description: Form packet ID
          example: 12345
          in: path
          name: formPacketId
          required: true
          schema:
            format: int64
            type: integer
        - description: Include form answers in response
          example: true
          in: query
          name: includeAnswers
          schema:
            default: true
            type: boolean
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormPacketDTO'
          description: Form packet found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form packet not found
      summary: Get form packet by ID
      tags:
        - Forms
    put:
      description: >-
        Update a form packet. Can be used to change the due date, add additional
        forms, or update the status.
      operationId: updateFormPacket
      parameters:
        - description: Form packet ID
          in: path
          name: formPacketId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFormPacketRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormPacketDTO'
          description: Form packet updated successfully
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form packet not found
      summary: Update form packet
      tags:
        - Forms
  /partner/v2/account/{accountId}/location/{locationId}/form/{formPacketId}/archive:
    put:
      description: >-
        Archive a form packet. Archived packets are hidden from default views
        but can still be retrieved by ID or by filtering for archived packets.
      operationId: archiveFormPacket
      parameters:
        - description: Form packet ID
          in: path
          name: formPacketId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormPacketDTO'
          description: Form packet archived successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form packet not found
      summary: Archive form packet
      tags:
        - Forms
  /partner/v2/account/{accountId}/location/{locationId}/form/{formPacketId}/pdf:
    get:
      description: >-
        Generate or retrieve a PDF of the completed form packet. Returns a
        signed URL to download the PDF. The URL is valid for 15 minutes.
      operationId: getFormPacketPdf
      parameters:
        - description: Form packet ID
          in: path
          name: formPacketId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormPdfResponse'
          description: PDF URL generated successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form packet not found
        '409':
          description: PDF generation in progress, try again shortly
      summary: Get form packet PDF
      tags:
        - Forms
  /partner/v2/account/{accountId}/location/{locationId}/form/{formPacketId}/prefill:
    post:
      description: >-
        Pre-populate form fields with known patient data. Provide a map of field
        attribute names to values. Fields that don't exist or are already
        answered will be skipped.
      operationId: prefillFormFields
      parameters:
        - description: Form packet ID
          in: path
          name: formPacketId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrefillRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrefillResponse'
          description: Fields pre-filled successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form packet not found
      summary: Pre-fill form fields
      tags:
        - Forms
  /partner/v2/account/{accountId}/location/{locationId}/form/{formPacketId}/url:
    get:
      description: >-
        Get the patient-facing URL for completing this form packet. This URL can
        be shared with the patient via your own communication channels.
      operationId: getFormPacketUrl
      parameters:
        - description: Form packet ID
          in: path
          name: formPacketId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormUrlResponse'
          description: Form URL generated successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Form packet not found
      summary: Get form packet URL
      tags:
        - Forms
  /partner/v2/account/{accountId}/location/{locationId}/invoice:
    get:
      description: >-
        Retrieve a paginated list of invoices for the location. Supports
        filtering by patient, status, and date range.
      operationId: listInvoices
      parameters:
        - description: Filter by patient ID
          in: query
          name: patientId
          schema:
            format: int64
            type: integer
        - description: >-
            Filter by status (DRAFT, OPEN, VIEWED, PAID, FAILED, PAST_DUE,
            REFUNDED, VOID)
          in: query
          name: status
          schema:
            type: string
        - description: Start of date range (ISO 8601)
          in: query
          name: startDate
          schema:
            type: string
        - description: End of date range (ISO 8601)
          in: query
          name: endDate
          schema:
            type: string
        - description: Pagination cursor
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceListResponse'
          description: Invoices retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List invoices
      tags:
        - Invoices
  /partner/v2/account/{accountId}/location/{locationId}/invoice/{invoiceId}:
    get:
      description: >-
        Retrieve detailed information about a specific invoice including line
        items and payment status.
      operationId: getInvoice
      parameters:
        - description: Invoice ID
          in: path
          name: invoiceId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceDTO'
          description: Invoice found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Invoice not found
      summary: Get invoice by ID
      tags:
        - Invoices
  /partner/v2/account/{accountId}/location/{locationId}/invoice/{invoiceId}/line-item:
    get:
      description: Retrieve all line items for the specified invoice.
      operationId: listLineItems
      parameters:
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemListResponse'
          description: Line items retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Invoice not found
      summary: List invoice line items
      tags:
        - Invoices
  /partner/v2/account/{accountId}/location/{locationId}/invoice/{invoiceId}/line-item/{lineItemId}:
    get:
      description: Retrieve detailed information about a specific line item.
      operationId: getLineItem
      parameters:
        - description: Line item ID
          in: path
          name: lineItemId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineItemDTO'
          description: Line item found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Line item not found
      summary: Get line item by ID
      tags:
        - Invoices
  /partner/v2/account/{accountId}/location/{locationId}/invoice/{invoiceId}/pdf:
    get:
      description: >-
        Generate or retrieve a PDF of the invoice. Returns a signed URL to
        download the PDF.
      operationId: getInvoicePdf
      parameters:
        - description: Invoice ID
          in: path
          name: invoiceId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoicePdfResponse'
          description: PDF URL generated successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Invoice not found
      summary: Get invoice PDF
      tags:
        - Invoices
  /partner/v2/account/{accountId}/location/{locationId}/lab:
    get:
      description: >-
        Retrieve lab orders and results for the location. Supports filtering by
        patient, status, and date range.
      operationId: listLabs
      parameters:
        - description: Filter by patient ID
          in: query
          name: patientId
          schema:
            format: int64
            type: integer
        - description: Filter by appointment ID
          in: query
          name: appointmentId
          schema:
            format: int64
            type: integer
        - description: Filter by status (PROCESSING, COMPLETE, ORDER_ERROR)
          in: query
          name: status
          schema:
            enum:
              - PROCESSING
              - COMPLETE
              - ORDER_ERROR
            pattern: (?i)PROCESSING|COMPLETE|ORDER_ERROR
            type: string
        - description: >-
            Filter by vendor type (IN_HOUSE, LABCORP, PRIME, BRIO, SPOTDX,
            OTHER)
          in: query
          name: vendorType
          schema:
            enum:
              - IN_HOUSE
              - LABCORP
              - PRIME
              - BRIO
              - SPOTDX
              - OTHER
            pattern: (?i)IN_HOUSE|LABCORP|PRIME|BRIO|SPOTDX|OTHER
            type: string
        - description: Start of date range (ISO 8601)
          in: query
          name: startDate
          schema:
            type: string
        - description: End of date range (ISO 8601)
          in: query
          name: endDate
          schema:
            type: string
        - description: Sort by field
          in: query
          name: sortBy
          schema:
            default: ENTRY_DATE
            enum:
              - ENTRY_DATE
              - CREATED_DATE
            pattern: (?i)ENTRY_DATE|CREATED_DATE
            type: string
        - description: Sort direction
          in: query
          name: sortDir
          schema:
            default: DESC
            enum:
              - ASC
              - DESC
            pattern: (?i)ASC|DESC
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            maxLength: 2048
            minLength: 0
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabListResponse'
          description: Labs retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List labs
      tags:
        - Labs
  /partner/v2/account/{accountId}/location/{locationId}/lab/{labId}:
    get:
      description: >-
        Retrieve detailed information about a lab including all test panels and
        components.
      operationId: getLab
      parameters:
        - description: Lab ID
          in: path
          name: labId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabDTO'
          description: Lab found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Lab not found
      summary: Get lab by ID
      tags:
        - Labs
  /partner/v2/account/{accountId}/location/{locationId}/lab/{labId}/test-component:
    get:
      description: Retrieve all test components (results) for the specified lab.
      operationId: listTestComponents
      parameters:
        - in: path
          name: labId
          required: true
          schema:
            format: int64
            type: integer
        - description: Filter by panel ID
          in: query
          name: panelId
          schema:
            format: int64
            type: integer
        - description: Filter by abnormal flag
          in: query
          name: abnormalFlag
          schema:
            enum:
              - BELOW_NORMAL
              - WITHIN_NORMAL
              - ABOVE_NORMAL
            pattern: (?i)BELOW_NORMAL|WITHIN_NORMAL|ABOVE_NORMAL
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            maxLength: 2048
            minLength: 0
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestComponentListResponse'
          description: Test components retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Lab not found
      summary: List test components for lab
      tags:
        - Labs
  /partner/v2/account/{accountId}/location/{locationId}/lab/{labId}/test-component/{componentId}:
    get:
      description: Retrieve detailed information about a specific test component.
      operationId: getTestComponent
      parameters:
        - in: path
          name: labId
          required: true
          schema:
            format: int64
            type: integer
        - description: Test component ID
          in: path
          name: componentId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestComponentDTO'
          description: Test component found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Test component not found
      summary: Get test component by ID
      tags:
        - Labs
  /partner/v2/account/{accountId}/location/{locationId}/notification:
    get:
      description: >-
        Retrieve a paginated list of notifications for the location. Supports
        filtering by patient, notification group, type, status, and date range.
        Each notification tracks email and SMS delivery status independently.
      operationId: listNotifications
      parameters:
        - description: Filter by patient ID
          in: query
          name: patientId
          schema:
            format: int64
            type: integer
        - description: Filter by notification group ID
          in: query
          name: notificationGroupId
          schema:
            format: int64
            type: integer
        - description: Filter by notification type (use actual NotificationType enum name)
          in: query
          name: type
          schema:
            type: string
        - description: Filter by email delivery status
          in: query
          name: emailStatus
          schema:
            enum:
              - UNPROCESSED
              - PROCESSED_SENT
              - PROCESSED_UNSENT
            type: string
        - description: Filter by SMS delivery status
          in: query
          name: smsStatus
          schema:
            enum:
              - UNPROCESSED
              - PROCESSED_SENT
              - PROCESSED_UNSENT
            type: string
        - description: Start of date range for scheduled send time (ISO 8601)
          example: '2025-01-01T00:00:00Z'
          in: query
          name: startDate
          schema:
            type: string
        - description: End of date range for scheduled send time (ISO 8601)
          example: '2025-01-31T23:59:59Z'
          in: query
          name: endDate
          schema:
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationListResponse'
          description: Notifications retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List notifications
      tags:
        - Notifications
  /partner/v2/account/{accountId}/location/{locationId}/notification-group:
    get:
      description: >-
        Retrieve a paginated list of notification groups for the location. Each
        group ties together related notifications for an appointment, form, or
        payment.
      operationId: listNotificationGroups
      parameters:
        - description: Start of date range (ISO 8601)
          example: '2025-01-01T00:00:00Z'
          in: query
          name: startDate
          schema:
            type: string
        - description: End of date range (ISO 8601)
          example: '2025-01-31T23:59:59Z'
          in: query
          name: endDate
          schema:
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationGroupListResponse'
          description: Notification groups retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List notification groups
      tags:
        - Notification Groups
  /partner/v2/account/{accountId}/location/{locationId}/notification-group/{groupId}:
    get:
      description: Retrieve detailed information about a specific notification group.
      operationId: getNotificationGroup
      parameters:
        - description: Notification group ID
          example: 12345
          in: path
          name: groupId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationGroupDTO'
          description: Notification group found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Notification group not found
      summary: Get notification group by ID
      tags:
        - Notification Groups
  /partner/v2/account/{accountId}/location/{locationId}/notification/{notificationId}:
    get:
      description: Retrieve detailed information about a specific notification.
      operationId: getNotification
      parameters:
        - description: Notification ID
          example: 12345
          in: path
          name: notificationId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationDTO'
          description: Notification found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Notification not found
      summary: Get notification by ID
      tags:
        - Notifications
  /partner/v2/account/{accountId}/location/{locationId}/payment-request:
    get:
      description: >-
        Retrieve a paginated list of payment requests for the location. Supports
        filtering by patient, status, and date range.
      operationId: listPaymentRequests
      parameters:
        - description: Filter by patient ID
          in: query
          name: patientId
          schema:
            format: int64
            type: integer
        - description: Filter by status
          in: query
          name: status
          schema:
            enum:
              - PENDING
              - PARTIALLY_PAID
              - PAID
              - VOIDED
              - EXPIRED
            type: string
        - description: Filter by appointment ID
          in: query
          name: appointmentId
          schema:
            format: int64
            type: integer
        - description: Start of creation date range (ISO 8601)
          in: query
          name: createdAfter
          schema:
            type: string
        - description: End of creation date range (ISO 8601)
          in: query
          name: createdBefore
          schema:
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequestListResponse'
          description: Payment requests retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List payment requests
      tags:
        - Payment Requests
  /partner/v2/account/{accountId}/location/{locationId}/payment-request/{paymentRequestId}:
    get:
      description: Retrieve detailed information about a specific payment request.
      operationId: getPaymentRequest
      parameters:
        - description: Payment request ID
          in: path
          name: paymentRequestId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequestDTO'
          description: Payment request found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Payment request not found
      summary: Get payment request by ID
      tags:
        - Payment Requests
  /partner/v2/account/{accountId}/location/{locationId}/recurring-payment:
    get:
      description: >-
        Retrieve a paginated list of recurring payment configurations for the
        location.
      operationId: listRecurringPayments
      parameters:
        - description: Filter by patient ID
          in: query
          name: patientId
          schema:
            format: int64
            type: integer
        - description: Filter by status
          in: query
          name: status
          schema:
            enum:
              - ACTIVE
              - PAUSED
              - CANCELLED
              - COMPLETED
              - FAILED
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringPaymentListResponse'
          description: Recurring payments retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List recurring payments
      tags:
        - Recurring Payments
  /partner/v2/account/{accountId}/location/{locationId}/recurring-payment/{recurringPaymentId}:
    get:
      description: >-
        Retrieve detailed information about a specific recurring payment
        configuration.
      operationId: getRecurringPayment
      parameters:
        - description: Recurring payment ID
          in: path
          name: recurringPaymentId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringPaymentDTO'
          description: Recurring payment found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Recurring payment not found
      summary: Get recurring payment by ID
      tags:
        - Recurring Payments
  /partner/v2/account/{accountId}/location/{locationId}/remote-care/conversion:
    post:
      description: Initialize a new remote care conversion tracking record.
      operationId: createConversion
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionCreateResponseDTO'
          description: Conversion created
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Location not found
      summary: Create conversion
      tags:
        - Remote Care Conversion
  /partner/v2/account/{accountId}/location/{locationId}/remote-care/conversion/{id}:
    get:
      description: Retrieve details of a specific remote care conversion.
      operationId: getConversion
      parameters:
        - description: Conversion ID
          in: path
          name: id
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionFullResponseDTO'
          description: Conversion retrieved
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Conversion not found
      summary: Get conversion by ID
      tags:
        - Remote Care Conversion
    put:
      description: >-
        Update patient data, selected services, or attempt links for a
        conversion. Only provided fields are updated.
      operationId: updateConversion
      parameters:
        - description: Conversion ID
          in: path
          name: id
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateConversionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionFullResponseDTO'
          description: Conversion updated
        '400':
          description: Invalid input data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Conversion not found
      summary: Partial update conversion
      tags:
        - Remote Care Conversion
  /partner/v2/account/{accountId}/location/{locationId}/remote-care/service:
    get:
      description: >-
        Retrieve a paginated list of available remote care services for the
        location.
      operationId: listServices
      parameters:
        - description: Search query for name
          in: query
          name: search
          schema:
            type: string
        - description: Pagination cursor
          in: query
          name: cursor
          schema:
            type: string
        - description: Results per page
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteCareServiceListResponse'
          description: Services retrieved
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Location not found
      summary: List remote care services
      tags:
        - Remote Care Services
  /partner/v2/account/{accountId}/location/{locationId}/remote-care/service/{serviceId}:
    get:
      description: Retrieve details for a specific remote care service.
      operationId: getService
      parameters:
        - description: Service ID
          in: path
          name: serviceId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteCareServiceDTO'
          description: Service found
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Service not found
      summary: Get remote care service by ID
      tags:
        - Remote Care Services
  /partner/v2/account/{accountId}/location/{locationId}/remote-care/setting:
    get:
      description: >-
        Get remote care configuration for the location, including default staff
        and links to self-scheduling settings.
      operationId: getRemoteCareSetting
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
        - description: Location identifier
          in: path
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RemoteCareSettingDTO'
          description: Settings retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Location or remote care settings not found
      summary: Get remote care settings
      tags:
        - Remote Care Settings
  /partner/v2/account/{accountId}/patients:
    get:
      description: >-
        Retrieve a paginated list of patients for the account. Supports
        filtering by name/email and cursor-based pagination.
      operationId: listPatients
      parameters:
        - description: Filter patients by first name (case-insensitive contains match)
          example: John
          in: query
          name: firstName
          schema:
            maxLength: 100
            minLength: 0
            type: string
        - description: Filter patients by last name (case-insensitive contains match)
          example: Smith
          in: query
          name: lastName
          schema:
            maxLength: 100
            minLength: 0
            type: string
        - description: Filter patients by email (case-insensitive contains match)
          example: example@lobbie.com
          in: query
          name: email
          schema:
            maxLength: 254
            minLength: 0
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            maxLength: 2048
            minLength: 0
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientListResponse'
          description: Patients retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List patients
      tags:
        - Patients
    post:
      description: >-
        Create a new patient for the account. The account must match the OAuth
        token context.
      operationId: createPatient
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePatientRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientResponse'
          description: Patient created successfully
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '409':
          description: A patient with this email already exists in the account
      summary: Create a new patient
      tags:
        - Patients
  /partner/v2/account/{accountId}/patients/{patientId}:
    delete:
      description: >-
        Delete a patient from the account. This removes the patient's
        association with the account but may not delete the underlying global
        patient record.
      operationId: deletePatient
      parameters:
        - description: Patient ID
          example: 12345
          in: path
          name: patientId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '204':
          description: Patient deleted successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Patient not found or not associated with the authorized account
        '409':
          description: >-
            Cannot delete patient with active appointments or outstanding
            balance
      summary: Delete patient
      tags:
        - Patients
    get:
      description: >-
        Retrieve patient information by patient ID. The account must match the
        OAuth token context.
      operationId: getPatient
      parameters:
        - description: Patient ID
          example: 12345
          in: path
          name: patientId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientResponse'
          description: Patient found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Patient not found or not associated with the authorized account
      summary: Get patient data
      tags:
        - Patients
    put:
      description: >-
        Update patient information by patient ID. Only provided fields will be
        updated. The account must match the OAuth token context.
      operationId: updatePatient
      parameters:
        - description: Patient ID
          example: 12345
          in: path
          name: patientId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePatientRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientResponse'
          description: Patient updated successfully
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Patient not found or not associated with the authorized account
      summary: Update patient data
      tags:
        - Patients
  /partner/v2/account/{accountId}/patients/{patientId}/category:
    get:
      description: Retrieve the current category assignment for the patient.
      operationId: getPatientCategory
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientCategoryDTO'
          description: Patient category retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Patient not found
      summary: Get patient's current category
      tags:
        - Patients
  /partner/v2/account/{accountId}/patients/{patientId}/category/transition:
    get:
      description: >-
        Retrieve the category transition history for the patient. Shows when and
        why the patient's category changed over time.
      operationId: listCategoryTransitions
      parameters:
        - description: Filter by from category ID
          in: query
          name: fromCategoryId
          schema:
            format: int64
            type: integer
        - description: Filter by to category ID
          in: query
          name: toCategoryId
          schema:
            format: int64
            type: integer
        - description: Start of date range (ISO 8601)
          in: query
          name: startDate
          schema:
            type: string
        - description: End of date range (ISO 8601)
          in: query
          name: endDate
          schema:
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryTransitionListResponse'
          description: Category transitions retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Patient not found
      summary: List patient category transitions
      tags:
        - Patients
  /partner/v2/account/{accountId}/patients/{patientId}/category/transition/{transitionId}:
    get:
      description: Retrieve detailed information about a specific category transition.
      operationId: getCategoryTransition
      parameters:
        - description: Transition ID
          in: path
          name: transitionId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryTransitionDTO'
          description: Category transition found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Transition not found
      summary: Get category transition by ID
      tags:
        - Patients
  /partner/v2/account/{accountId}/patients/{patientId}/health-profile/allergies:
    get:
      description: >-
        Retrieve all allergies for a patient including severity, reactions, and
        status.
      operationId: listAllergies
      parameters:
        - description: Patient ID
          example: 67890
          in: path
          name: patientId
          required: true
          schema:
            format: int64
            type: integer
        - description: >-
            Filter by active status. If not specified, returns both active and
            inactive appointment types.
          in: query
          name: active
          schema:
            enum:
              - true
              - false
            type: boolean
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllergyListResponse'
          description: Allergies retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Patient not found
      summary: List patient allergies
      tags:
        - Patient Health Profile
        - Patients
  /partner/v2/account/{accountId}/patients/{patientId}/health-profile/medications:
    get:
      description: >-
        Retrieve all medications for a patient including dosage instructions and
        status.
      operationId: listMedications
      parameters:
        - description: Patient ID
          example: 67890
          in: path
          name: patientId
          required: true
          schema:
            format: int64
            type: integer
        - description: >-
            Filter by active status. If not specified, returns both active and
            inactive appointment types.
          in: query
          name: active
          schema:
            enum:
              - true
              - false
            type: boolean
        - description: Filter by status (ACTIVE, ON_HOLD, DISCONTINUED, COMPLETED, UNKNOWN)
          in: query
          name: status
          schema:
            pattern: (?i)ACTIVE|ON_HOLD|DISCONTINUED|COMPLETED|UNKNOWN
            type: string
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MedicationListResponse'
          description: Medications retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Patient not found
      summary: List patient medications
      tags:
        - Patient Health Profile
        - Patients
  /partner/v2/account/{accountId}/patients/{patientId}/health-profile/problems:
    get:
      description: >-
        Retrieve all problems (diagnoses) for a patient including ICD-10 codes
        and status.
      operationId: listProblems
      parameters:
        - description: Patient ID
          example: 67890
          in: path
          name: patientId
          required: true
          schema:
            format: int64
            type: integer
        - description: >-
            Filter by active status. If not specified, returns both active and
            inactive appointment types.
          in: query
          name: active
          schema:
            enum:
              - true
              - false
            type: boolean
        - description: Filter by status (ACTIVE, RESOLVED, UNKNOWN)
          in: query
          name: status
          schema:
            pattern: (?i)ACTIVE|RESOLVED|UNKNOWN
            type: string
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemListResponse'
          description: Problems retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Patient not found
      summary: List patient problems/diagnoses
      tags:
        - Patient Health Profile
        - Patients
  /partner/v2/account/{accountId}/self-scheduling/attempt:
    post:
      description: >-
        Initialize a new self-scheduling attempt. Validates that the setting is
        active and, if provided, that the identity proof matches the setting's
        verification requirements.
      operationId: createAttempt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAttemptRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfSchedulingAttemptResponse'
          description: Attempt created successfully
        '400':
          description: >-
            Invalid request (Setting inactive, Proof method mismatch, or Account
            mismatch)
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Setting or Identity Proof not found
        '409':
          description: >-
            Conflict - Self scheduling attempt already created for this identity
            proof
      summary: Create self-scheduling attempt
      tags:
        - Self-Scheduling Attempt
  /partner/v2/account/{accountId}/self-scheduling/attempt/{attemptId}:
    get:
      description: >-
        Retrieve details of an existing self-scheduling attempt by ID. Returns
        attempt status including identity proof verification status, patient ID
        (if set), and appointment ID (if created). Returns 404 if attempt
        doesn't exist or doesn't belong to this account.
      operationId: getSelfSchedulingAttempt
      parameters:
        - in: path
          name: attemptId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfSchedulingAttemptResponse'
          description: Self-scheduling attempt retrieved successfully
        '401':
          description: Unauthorized - invalid or missing partner token
        '404':
          description: Self-scheduling attempt not found
      summary: Get self-scheduling attempt
      tags:
        - Self-Scheduling Attempt
  /partner/v2/account/{accountId}/self-scheduling/attempt/{attemptId}/appointment:
    post:
      description: >-
        Creates an appointment for the specified self-scheduling attempt.
        Patient must be set on the attempt before creating an appointment.
        Scheduler config must belong to the self-scheduling setting.
      operationId: createAppointment_1
      parameters:
        - in: path
          name: attemptId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAppointmentRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAppointmentResponse'
          description: Appointment created successfully
        '400':
          description: >-
            Bad request - patient not set, invalid scheduler config, or invalid
            parameters
        '401':
          description: Unauthorized - invalid or missing partner token
        '404':
          description: Self-scheduling attempt not found
        '409':
          description: Conflict - appointment already exists for this attempt
        '500':
          description: Internal server error - appointment creation failed
      summary: Create appointment for self-scheduling attempt
      tags:
        - Self-Scheduling Attempt
  /partner/v2/account/{accountId}/self-scheduling/attempt/{attemptId}/patient:
    post:
      description: >-
        Resolves or creates a patient from the provided demographics and
        attaches them to the self-scheduling attempt. If the attempt has a
        verified identity proof, patient resolution will use it for matching.
        Returns 200 if an existing patient was found, 201 if a new patient was
        created.
      operationId: attachPatientToSelfSchedulingAttempt
      parameters:
        - in: path
          name: attemptId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttachPatientToSelfSchedulingAttemptRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientResponse'
          description: Existing patient attached to self-scheduling attempt
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatientResponse'
          description: New patient created and attached to self-scheduling attempt
        '400':
          description: Bad request - invalid input
        '401':
          description: Unauthorized - invalid or missing partner token
        '404':
          description: Self-scheduling attempt not found
      summary: Attach a patient to a self-scheduling attempt
      tags:
        - Self-Scheduling Attempt
  /partner/v2/account/{accountId}/self-scheduling/availability:
    get:
      description: >-
        Returns available appointment slots for a time range. Time range must
        not exceed 2 months (62 days).
      operationId: getAvailability
      parameters:
        - description: Self-scheduling setting ID
          example: 123
          in: query
          name: selfSchedulingSettingId
          required: true
          schema:
            format: int64
            type: integer
        - description: Start time in milliseconds since epoch
          example: 1704067200000
          in: query
          name: startUnix
          required: true
          schema:
            format: int64
            type: integer
        - description: End time in milliseconds since epoch
          example: 1706745600000
          in: query
          name: endUnix
          required: true
          schema:
            format: int64
            type: integer
        - description: Location ID
          example: 1
          in: query
          name: locationId
          required: true
          schema:
            format: int64
            type: integer
        - description: Appointment type ID
          example: 10
          in: query
          name: appointmentTypeId
          required: true
          schema:
            format: int64
            type: integer
        - description: Comma-separated practitioner IDs to filter (optional)
          example: 7,8,9
          in: query
          name: practitionerIds
          schema:
            type: string
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              examples:
                Non-selectable practitioners:
                  description: Non-selectable practitioners
                  summary: System auto-assigns the best-ranked practitioner per slot
                  value:
                    slotsByDate:
                      1/15/2025:
                        - startUnix: 1736946000000
                          endUnix: 1736947800000
                          practitionerId: 42
                          schedulerConfigId: 7
                        - startUnix: 1736947800000
                          endUnix: 1736949600000
                          practitionerId: 55
                          schedulerConfigId: 12
                      1/16/2025:
                        - startUnix: 1737032400000
                          endUnix: 1737034200000
                          practitionerId: 42
                          schedulerConfigId: 7
                    practitioners:
                      - displayName: Jane Smith
                        practitionerId: 42
                        firstAvailableSlot: 1736946000000
                      - displayName: John Doe
                        practitionerId: 55
                        firstAvailableSlot: 1736947800000
                    arePractitionersSelectable: false
                    timeZone: America/New_York
                Selectable practitioners:
                  description: Selectable practitioners
                  summary: >-
                    Patient chooses practitioner; each slot lists all available
                    practitioners
                  value:
                    slotsByDate:
                      1/15/2025:
                        - startUnix: 1736946000000
                          endUnix: 1736947800000
                          practitionerToConfig:
                            '42': 7
                            '55': 12
                        - startUnix: 1736947800000
                          endUnix: 1736949600000
                          practitionerToConfig:
                            '42': 7
                    practitioners:
                      - displayName: Jane Smith
                        practitionerId: 42
                        firstAvailableSlot: 1736946000000
                      - displayName: John Doe
                        practitionerId: 55
                        firstAvailableSlot: 1736946000000
                    arePractitionersSelectable: true
                    timeZone: America/New_York
              schema:
                $ref: '#/components/schemas/PreparedScheduleOutputDTO'
          description: Availability slots retrieved successfully
        '400':
          description: >-
            Invalid parameters - time range exceeds 62 days, invalid IDs, or
            other validation errors
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: >-
            Self-scheduling setting not found or not associated with the
            authorized account
      summary: Get appointment availability
      tags:
        - Self-Scheduling
  /partner/v2/account/{accountId}/self-scheduling/setting/{selfSchedulingSettingId}:
    get:
      description: >-
        Retrieve self-scheduling configuration with associated practitioners,
        locations, appointment types, and scheduler configs.
      operationId: getSetting
      parameters:
        - description: Self-scheduling setting ID
          example: 123
          in: path
          name: selfSchedulingSettingId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfSchedulingSettingResponse'
          description: Self-scheduling setting retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: >-
            Self-scheduling setting not found or not associated with the
            authorized account
      summary: Get self-scheduling setting
      tags:
        - Self-Scheduling
  /partner/v2/account/{accountId}/staff:
    get:
      description: >-
        Retrieve a paginated list of staff members for the account. Supports
        filtering by location, role, status, and practitioner status.
      operationId: listStaff
      parameters:
        - description: Filter by location ID
          in: query
          name: locationId
          schema:
            format: int64
            type: integer
        - description: >-
            Filter by role group ID. Use the /role-group endpoint to retrieve
            available role groups.
          in: query
          name: roleGroupId
          schema:
            format: int64
            type: integer
        - description: Filter by status (case-insensitive)
          in: query
          name: status
          schema:
            pattern: (?i)ACTIVE|INACTIVE|PENDING
            type: string
        - description: Filter by first name (case-insensitive contains)
          in: query
          name: firstName
          schema:
            type: string
        - description: Filter by last name (case-insensitive contains)
          in: query
          name: lastName
          schema:
            type: string
        - description: Filter by email (case-insensitive contains)
          in: query
          name: email
          schema:
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (max 100)
          example: 20
          in: query
          name: limit
          schema:
            default: 20
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StaffListResponse'
          description: Staff members retrieved successfully
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List staff members
      tags:
        - Staff & Practitioners
  /partner/v2/account/{accountId}/staff/{staffId}:
    get:
      description: Retrieve detailed information about a specific staff member.
      operationId: getStaff
      parameters:
        - description: Staff member ID
          in: path
          name: staffId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StaffDTO'
          description: Staff member found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Staff member not found
      summary: Get staff member by ID
      tags:
        - Staff & Practitioners
  /partner/v2/account/{accountId}/webhook:
    get:
      description: Retrieve all configured webhook endpoints for the account.
      operationId: listWebhookEndpoints
      parameters:
        - description: Include disabled endpoints
          in: query
          name: includeDisabled
          schema:
            type: boolean
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointListResponse'
          description: Webhook endpoints retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List webhook endpoints
      tags:
        - Webhooks
    post:
      description: >-
        Create a new webhook endpoint to receive event notifications. Specify
        the URL and the event types you want to subscribe to. A signing secret
        will be generated and returned - store it securely.
      operationId: createWebhookEndpoint
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookEndpointRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointDTO'
          description: Webhook endpoint created successfully
        '400':
          description: Invalid request data or unreachable URL
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '422':
          description: Validation error - invalid URL or event types
      summary: Create webhook endpoint
      tags:
        - Webhooks
  /partner/v2/account/{accountId}/webhook/event-types:
    get:
      description: Retrieve the list of event types that can be subscribed to.
      operationId: listEventTypes
      parameters:
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTypeListResponse'
          description: Event types retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List available event types
      tags:
        - Webhooks
  /partner/v2/account/{accountId}/webhook/{webhookId}:
    delete:
      description: Delete a webhook endpoint. Pending deliveries will be cancelled.
      operationId: deleteWebhookEndpoint
      parameters:
        - description: Webhook endpoint ID
          in: path
          name: webhookId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '204':
          description: Webhook endpoint deleted successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Webhook endpoint not found
      summary: Delete webhook endpoint
      tags:
        - Webhooks
    get:
      description: >-
        Retrieve detailed information about a webhook endpoint including its
        configuration and recent delivery status.
      operationId: getWebhookEndpoint
      parameters:
        - description: Webhook endpoint ID
          in: path
          name: webhookId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointDTO'
          description: Webhook endpoint found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Webhook endpoint not found
      summary: Get webhook endpoint by ID
      tags:
        - Webhooks
    put:
      description: Update a webhook endpoint's URL, event subscriptions, or enabled status.
      operationId: updateWebhookEndpoint
      parameters:
        - description: Webhook endpoint ID
          in: path
          name: webhookId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookEndpointRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointDTO'
          description: Webhook endpoint updated successfully
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Webhook endpoint not found
      summary: Update webhook endpoint
      tags:
        - Webhooks
  /partner/v2/account/{accountId}/webhook/{webhookId}/test:
    post:
      description: >-
        Send a test event to the webhook endpoint to verify connectivity. The
        test event will have type 'test.ping' with sample data.
      operationId: testWebhookEndpoint
      parameters:
        - description: Webhook endpoint ID
          in: path
          name: webhookId
          required: true
          schema:
            format: int64
            type: integer
        - description: Account identifier
          in: path
          name: accountId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookResponse'
          description: Test event sent and delivered successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Webhook endpoint not found
        '502':
          description: Test delivery failed - endpoint returned an error
      summary: Send test event
      tags:
        - Webhooks
  /partner/v2/health:
    get:
      description: Verify connectivity to the Partner API
      operationId: health
      responses:
        '200':
          description: Successfully connected to the Partner API
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '500':
          description: Internal server error
      summary: Health check
  /partner/v2/role-group:
    get:
      description: >-
        Retrieve the list of available role groups. Role groups define access
        levels that can be assigned to staff members. Role group IDs are
        constant across all accounts and will not change without explicit
        notice, though new role groups may be added over time.
      operationId: listRoleGroups
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleGroupListResponse'
          description: Role groups retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List role groups
      tags:
        - Role Groups
  /partner/v2/role-group/{roleGroupId}:
    get:
      description: Retrieve information about a specific role group.
      operationId: getRoleGroup
      parameters:
        - description: Role group ID
          in: path
          name: roleGroupId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleGroupDTO'
          description: Role group found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Role group not found
      summary: Get role group by ID
      tags:
        - Role Groups
  /partner/v2/webhook:
    get:
      description: Retrieve all configured webhook endpoints for the account.
      operationId: listWebhookEndpoints_1
      parameters:
        - description: Include disabled endpoints
          in: query
          name: includeDisabled
          schema:
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointListResponse'
          description: Webhook endpoints retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List webhook endpoints
      tags:
        - Webhooks
    post:
      description: >-
        Create a new webhook endpoint to receive event notifications. Specify
        the URL and the event types you want to subscribe to. A signing secret
        will be generated and returned - store it securely.
      operationId: createWebhookEndpoint_1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookEndpointRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointDTO'
          description: Webhook endpoint created successfully
        '400':
          description: Invalid request data or unreachable URL
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '422':
          description: Validation error - invalid URL or event types
      summary: Create webhook endpoint
      tags:
        - Webhooks
  /partner/v2/webhook/event-types:
    get:
      description: Retrieve the list of event types that can be subscribed to.
      operationId: listEventTypes_1
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTypeListResponse'
          description: Event types retrieved successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
      summary: List available event types
      tags:
        - Webhooks
  /partner/v2/webhook/{webhookId}:
    delete:
      description: Delete a webhook endpoint. Pending deliveries will be cancelled.
      operationId: deleteWebhookEndpoint_1
      parameters:
        - description: Webhook endpoint ID
          in: path
          name: webhookId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '204':
          description: Webhook endpoint deleted successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Webhook endpoint not found
      summary: Delete webhook endpoint
      tags:
        - Webhooks
    get:
      description: >-
        Retrieve detailed information about a webhook endpoint including its
        configuration and recent delivery status.
      operationId: getWebhookEndpoint_1
      parameters:
        - description: Webhook endpoint ID
          in: path
          name: webhookId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointDTO'
          description: Webhook endpoint found and returned successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Webhook endpoint not found
      summary: Get webhook endpoint by ID
      tags:
        - Webhooks
    put:
      description: Update a webhook endpoint's URL, event subscriptions, or enabled status.
      operationId: updateWebhookEndpoint_1
      parameters:
        - description: Webhook endpoint ID
          in: path
          name: webhookId
          required: true
          schema:
            format: int64
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookEndpointRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointDTO'
          description: Webhook endpoint updated successfully
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Webhook endpoint not found
      summary: Update webhook endpoint
      tags:
        - Webhooks
  /partner/v2/webhook/{webhookId}/test:
    post:
      description: >-
        Send a test event to the webhook endpoint to verify connectivity. The
        test event will have type 'test.ping' with sample data.
      operationId: testWebhookEndpoint_1
      parameters:
        - description: Webhook endpoint ID
          in: path
          name: webhookId
          required: true
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookResponse'
          description: Test event sent and delivered successfully
        '401':
          description: Unauthorized - invalid or missing token
        '403':
          description: Forbidden - integration not enabled for this account
        '404':
          description: Webhook endpoint not found
        '502':
          description: Test delivery failed - endpoint returned an error
      summary: Send test event
      tags:
        - Webhooks
security:
  - PartnerOAuth: []
servers:
  - description: Production
    url: https://api-prod.lobbie.com/lobbie/api/partner/v2
tags:
  - description: >-
      Patient allergies, medications, and problems retrieval (get by ID under
      account)
    name: Patient Health Profile
  - description: Patient category retrieval endpoints
    name: Patients
  - description: Appointment scheduling and management endpoints
    name: Appointments
  - description: Appointment Type configuration endpoints
    name: Appointment Types
  - description: Patient category definition retrieval endpoints
    name: Categories
  - description: CRM status retrieval endpoints
    name: CRM Status Groups
  - description: Form template group retrieval endpoints
    name: Form Template Groups
  - description: Form packet management and submission endpoints
    name: Forms
  - description: Form template and template group reference data
    name: Form Templates
  - description: Invoice line item retrieval endpoints
    name: Invoices
  - description: Lab test component retrieval endpoints
    name: Labs
  - description: Location endpoints for scheduling flow
    name: Locations
  - description: Notification group retrieval endpoints
    name: Notification Groups
  - description: Notification retrieval endpoints
    name: Notifications
  - description: Payment request retrieval endpoints
    name: Payment Requests
  - description: Recurring payment retrieval endpoints
    name: Recurring Payments
  - description: Remote care conversion funnel endpoints
    name: Remote Care Conversion
  - description: Remote care service catalog endpoints
    name: Remote Care Services
  - description: Remote care configuration endpoints
    name: Remote Care Settings
  - description: System-wide role group retrieval endpoints
    name: Role Groups
  - description: Self-scheduling configuration and availability endpoints
    name: Self-Scheduling
  - description: Staff member and practitioner retrieval endpoints
    name: Staff & Practitioners
  - description: Webhook configuration and event delivery management
    name: Webhooks
  - description: Account-scoped identity verification endpoints
    name: Identity Proof
  - description: Account-scoped self-scheduling attempt endpoints
    name: Self-Scheduling Attempt
