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

# Get Inactive Patients

> Get inactive patients (no appointment in X days and no future appointments).

Returns paginated list of patients with their last appointment details and spending.



## OpenAPI

````yaml get /analytics/dashboards/patient-breakdown/inactive-patients
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /analytics/dashboards/patient-breakdown/inactive-patients:
    get:
      tags:
        - provider
        - analytics
        - analytics
      summary: Get Inactive Patients
      description: >-
        Get inactive patients (no appointment in X days and no future
        appointments).


        Returns paginated list of patients with their last appointment details
        and spending.
      operationId: >-
        get_inactive_patients_analytics_dashboards_patient_breakdown_inactive_patients_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: days_since_last_appointment
          in: query
          required: false
          schema:
            type: integer
            description: >-
              Number of days since last appointment to consider a patient
              inactive
            default: 90
            title: Days Since Last Appointment
          description: Number of days since last appointment to consider a patient inactive
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            description: Field to sort by
            default: last_appointment_date
            title: Sort By
          description: Field to sort by
        - name: sort_direction
          in: query
          required: false
          schema:
            enum:
              - asc
              - desc
            type: string
            description: Sort direction
            default: asc
            title: Sort Direction
          description: Sort direction
        - name: patient_source
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter by patient source
            title: Patient Source
          description: Filter by patient source
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 25
            title: Per Page
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_InactivePatientItem_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Page_InactivePatientItem_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/InactivePatientItem'
          type: array
          title: Data
        total:
          type: integer
          title: Total
      type: object
      required:
        - data
        - total
      title: Page[InactivePatientItem]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InactivePatientItem:
      properties:
        patientId:
          type: string
          title: Patientid
          description: Patient ID
        patientName:
          type: string
          title: Patientname
          description: Patient full name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Patient email
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
          description: Patient date of birth
        lastAppointmentDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Lastappointmentdate
          description: Last appointment date/time
        lastAppointmentStatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastappointmentstatus
          description: Last appointment status
        lastAppointmentServices:
          items:
            type: string
          type: array
          title: Lastappointmentservices
          description: Services from last appointment
        lastAppointmentProviders:
          items:
            $ref: >-
              #/components/schemas/decoda__apps__api__routes__analytics__dashboards__patient_breakdown__ProviderInfo
          type: array
          title: Lastappointmentproviders
          description: Providers from last appointment
        pastAppointmentCount:
          type: integer
          title: Pastappointmentcount
          description: Number of past appointments
        totalSpent:
          type: integer
          title: Totalspent
          description: Total amount spent in cents
      type: object
      required:
        - patientId
        - patientName
        - pastAppointmentCount
        - totalSpent
      title: InactivePatientItem
      description: Inactive patient data for the table.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    decoda__apps__api__routes__analytics__dashboards__patient_breakdown__ProviderInfo:
      properties:
        id:
          type: string
          title: Id
        firstName:
          type: string
          title: Firstname
        lastName:
          type: string
          title: Lastname
      type: object
      required:
        - id
        - firstName
        - lastName
      title: ProviderInfo
      description: Provider information.

````