> ## Documentation Index
> Fetch the complete documentation index at: https://ekacare-consent-url-fix.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Appointments

> 

### Overview
This API endpoint is used to retrieve all the appointments scheduled for a business with flexible filters.
### Additional Information:

  - Valid filter combinations:
    1. `patient_id` (alone)
    2. `doctor_id`, `start_date`, `end_date`
    3. `clinic_id`, `start_date`, `end_date`
    4. `start_date`, `end_date`
    5. `doctor_id`, `clinic_id`, `start_date`, `end_date`
  - Dates must follow `YYYY-MM-DD` format.
  - The date range must not exceed **7 days**.
  - `end_date` cannot be before `start_date`.
  - There is a `limit` i.e the maximum number of appointments returned per page. The value of `limit` is automatically set based on the filters used:  
      - **20** → when filtering by `patient_id` (alone).  
      - **50** → when filtering by (`doctor_id`, `start_date`, `end_date`) OR (`clinic_id`, `start_date`, `end_date`) OR (`doctor_id`, `clinic_id`, `start_date`, `end_date`).  
      - **30** → when filtering only by (`start_date`, `end_date`).  

### Appointment_statuses:

      Booked / Queue States:
        - BK (Booked) : Appointment created/confirmed.
        - CK (Checked-in) : Booked appointment added to the Queue (Checked-in).
        - RV (Reserved) : Appointment marked as Reserved, when patient said they will come for the appointment on the follow-up appointment message.
        - IN (Initiated) : Appointment marked as Initiated, when patient received follow-up appointment message.
        - PA  (Parked) : Appointment moved to Parked state.

      Ongoing States:
        - OG (Ongoing): Consultation is in progress.

      Completion Statuses:
        - CM (Completed): Appointment completed with a prescription created.
        - CMNP (Completed No Prescription) : Appointment marked Exit from Queue / Completed without a prescription.
        - AB (Aborted) : Appointment was started (Start Visit) but not completed. Automatically marked AB at 12:00 AM next day.
        - NS (No Show) : Appointment was added to Queue but not started/completed. Automatically marked NS at 12:00 AM next day.
        - NSD (No Show Doctor) : No-show tagged specifically from a doctor’s action (if implemented).
        - NSS (No Show Staff) : No-show tagged specifically from a staff action (if implemented).

      Cancellation Statuses:
        - CN (Cancelled) : Appointment cancelled via API.
        - CND (Cancelled Doctor) : Cancelled from the doctor’s account in the tool.
        - CNS (Cancelled Staff) : Cancelled from the staff’s account in the tool.
        - PC (Provisional Cancelled) : Appointment marked as provisional cancellation, when patient said they will not come for the appointment on the follow-up appointment message.
        - PNR (Payment Not Received) : Appointment marked as PNR, when patient tried paying for a pre-paid appointment but the payment failed.

      Reschedule Statuses:
        - RE : Rescheduled via API.
        - RES : Rescheduled from staff account.
        - RED : Rescheduled from doctor account.



## OpenAPI

````yaml get /dr/v1/appointment
openapi: 3.0.0
info:
  title: Ekacare API & Webhook Documentation
  contact: {}
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /dr/v1/appointment:
    get:
      tags:
        - Appointment API
      summary: Get Appointments
      description: >-


        ### Overview

        This API endpoint is used to retrieve all the appointments scheduled for
        a business with flexible filters.

        ### Additional Information:

          - Valid filter combinations:
            1. `patient_id` (alone)
            2. `doctor_id`, `start_date`, `end_date`
            3. `clinic_id`, `start_date`, `end_date`
            4. `start_date`, `end_date`
            5. `doctor_id`, `clinic_id`, `start_date`, `end_date`
          - Dates must follow `YYYY-MM-DD` format.
          - The date range must not exceed **7 days**.
          - `end_date` cannot be before `start_date`.
          - There is a `limit` i.e the maximum number of appointments returned per page. The value of `limit` is automatically set based on the filters used:  
              - **20** → when filtering by `patient_id` (alone).  
              - **50** → when filtering by (`doctor_id`, `start_date`, `end_date`) OR (`clinic_id`, `start_date`, `end_date`) OR (`doctor_id`, `clinic_id`, `start_date`, `end_date`).  
              - **30** → when filtering only by (`start_date`, `end_date`).  

        ### Appointment_statuses:

              Booked / Queue States:
                - BK (Booked) : Appointment created/confirmed.
                - CK (Checked-in) : Booked appointment added to the Queue (Checked-in).
                - RV (Reserved) : Appointment marked as Reserved, when patient said they will come for the appointment on the follow-up appointment message.
                - IN (Initiated) : Appointment marked as Initiated, when patient received follow-up appointment message.
                - PA  (Parked) : Appointment moved to Parked state.

              Ongoing States:
                - OG (Ongoing): Consultation is in progress.

              Completion Statuses:
                - CM (Completed): Appointment completed with a prescription created.
                - CMNP (Completed No Prescription) : Appointment marked Exit from Queue / Completed without a prescription.
                - AB (Aborted) : Appointment was started (Start Visit) but not completed. Automatically marked AB at 12:00 AM next day.
                - NS (No Show) : Appointment was added to Queue but not started/completed. Automatically marked NS at 12:00 AM next day.
                - NSD (No Show Doctor) : No-show tagged specifically from a doctor’s action (if implemented).
                - NSS (No Show Staff) : No-show tagged specifically from a staff action (if implemented).

              Cancellation Statuses:
                - CN (Cancelled) : Appointment cancelled via API.
                - CND (Cancelled Doctor) : Cancelled from the doctor’s account in the tool.
                - CNS (Cancelled Staff) : Cancelled from the staff’s account in the tool.
                - PC (Provisional Cancelled) : Appointment marked as provisional cancellation, when patient said they will not come for the appointment on the follow-up appointment message.
                - PNR (Payment Not Received) : Appointment marked as PNR, when patient tried paying for a pre-paid appointment but the payment failed.

              Reschedule Statuses:
                - RE : Rescheduled via API.
                - RES : Rescheduled from staff account.
                - RED : Rescheduled from doctor account.
      operationId: GetBusinessAppointments
      parameters:
        - name: Authorization
          in: header
          required: true
          style: simple
          schema:
            type: string
            example: auth
        - name: patient_id
          in: query
          description: Filter by patient. Cannot be combined with any other filter.
          required: false
          schema:
            type: string
        - name: doctor_id
          in: query
          description: Filter by doctor (must be combined with start_date and end_date).
          required: false
          schema:
            type: string
        - name: clinic_id
          in: query
          description: Filter by clinic (must be combined with start_date and end_date).
          required: false
          schema:
            type: string
        - name: start_date
          in: query
          description: Start date of appointments.
          required: false
          schema:
            type: string
            format: date
            example: '2025-05-01'
        - name: end_date
          in: query
          description: End date of appointments.
          required: false
          schema:
            type: string
            format: date
            example: '2025-05-07'
        - name: page_no
          in: query
          description: |
            Page number for pagination (starts from 0).  
              - Each page contains up to say **50 appointments** (`limit=50`).  
              - `page_no=0` means the first page.  
              - If the `"appointments"` array has exactly 50 items, there may be more results. Continue with `page_no=1`, `page_no=2`, etc.  
              - If the `"appointments"` array has fewer than 50 items, there are no more results and you can stop fetching.  
          required: false
          schema:
            type: integer
            example: 0
      responses:
        '200':
          description: Successful response with appointment list
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointments:
                    type: array
                    items:
                      type: object
                      properties:
                        appointment_id:
                          type: string
                        created_at:
                          type: integer
                        doctor_id:
                          type: string
                        patient_id:
                          type: string
                        clinic_id:
                          type: string
                        channel:
                          type: string
                        status:
                          type: string
                          example: BK
                          enum:
                            - BK
                            - OG
                            - CM
                            - CMNP
                            - CN
                            - CND
                            - CNS
                        mode:
                          type: string
                          example: in_clinic
                          enum:
                            - tele
                            - in_clinic
                        start_time:
                          type: integer
                        end_time:
                          type: integer
                        prescription_id:
                          type: string
                        prescription_url:
                          type: string
                        partner_appointment_id:
                          type: string
                        partner_clinic_id:
                          type: string
                        partner_doctor_id:
                          type: string
                        partner_patient_id:
                          type: string
              example:
                appointments:
                  - appointment_id: apt_001
                    partner_appointment_id: p_001
                    created_at: 1730189586
                    doctor_id: doc_123
                    clinic_id: cln_456
                    patient_id: pat_789
                    channel: Walkin
                    status: CM
                    mode: in_clinic
                    start_time: 1730189586
                    end_time: 1730189586
                    prescription_id: presc_001
                    prescription_url: https://prescription-store-s3.eka.care/P-DW-1234.pdf
                    partner_patient_id: partner_patient_id1
                    partner_doctor_id: partner_doc_id1
                    partner_clinic_id: partner_clinic_id1
        '400':
          description: Invalid request (validation error)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
              example:
                error:
                  code: INVALID_REQUEST_PARAMETERS
                  message: You must provide one of the valid filter combinations.
        '403':
          description: Forbidden (no permission to access resource)
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              example:
                message: Forbidden
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
              example:
                error:
                  code: SERVER_ERROR
                  message: >-
                    An unexpected error occurred while processing your request.
                    Please try again later.
      deprecated: false

````