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

# List appointments

> Returns a paginated list of appointments. Requires read:appointments scope.



## OpenAPI

````yaml /openapi-v4.json get /appointments
openapi: 3.0.0
info:
  title: Max AI Public API
  description: API for third-party marketplace apps
  version: '4.0'
  contact: {}
servers:
  - url: https://api.maxcare.ai/v4
security: []
tags: []
paths:
  /appointments:
    get:
      tags:
        - Appointments
      summary: List appointments
      description: >-
        Returns a paginated list of appointments. Requires read:appointments
        scope.
      operationId: AppointmentsPublicController_listAppointments
      parameters:
        - name: page
          required: false
          in: query
          description: Page number (1-indexed)
          schema:
            default: 1
            example: 1
        - name: pageSize
          required: false
          in: query
          description: Number of items per page (max 100)
          schema:
            default: 100
            example: 100
        - name: dateFrom
          required: false
          in: query
          description: Filter appointments from this date (ISO 8601)
          schema:
            example: '2025-01-01'
            type: string
        - name: dateTo
          required: false
          in: query
          description: Filter appointments up to this date (ISO 8601)
          schema:
            example: '2025-12-31'
            type: string
        - name: statuses
          required: false
          in: query
          description: Comma-separated list of statuses to filter by
          schema:
            type: array
            items:
              type: string
        - name: facilityId
          required: false
          in: query
          description: Filter by facility ID
          schema:
            type: string
        - name: patientId
          required: false
          in: query
          description: Filter by patient ID
          schema:
            type: string
        - name: sortBy
          required: false
          in: query
          description: Sort field
          schema:
            enum:
              - scheduledStartDate
              - lastSyncedAt
              - status
            type: string
        - name: sortOrder
          required: false
          in: query
          description: Sort direction
          schema:
            enum:
              - asc
              - desc
            type: string
        - name: X-Organization-Id
          in: header
          required: true
          schema:
            type: string
          description: Target clinic organization ID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAppointmentsSuccessResponseV4'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiUnauthorizedResponse'
        '403':
          description: Insufficient scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiForbiddenResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiRateLimitResponse'
      security:
        - api-key: []
components:
  schemas:
    ListAppointmentsSuccessResponseV4:
      type: object
      properties:
        code:
          type: string
          description: Response code
          example: success
        data:
          $ref: '#/components/schemas/ListAppointmentsResponseDataV4'
      required:
        - code
        - data
    PublicApiUnauthorizedResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: unauthorized
        message:
          type: string
          description: Human-readable error message
          example: Invalid or missing API key
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiForbiddenResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: forbidden
        message:
          type: string
          description: Human-readable error message
          example: Insufficient scope
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiRateLimitResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: rate_limit_exceeded
        message:
          type: string
          description: Human-readable error message
          example: Rate limit exceeded. Maximum 1000 requests per 60 seconds.
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    ListAppointmentsResponseDataV4:
      type: object
      properties:
        appointments:
          type: array
          items:
            $ref: '#/components/schemas/ExternalAppointmentResponseV4'
        pagination:
          $ref: '#/components/schemas/PaginationInfoResponse'
      required:
        - appointments
        - pagination
    ExternalAppointmentResponseV4:
      type: object
      properties:
        id:
          type: string
          description: Appointment unique identifier
          example: apt_e5f6a7b8c9d04e1f2a3b4c5d6e7f8a9b
        scheduledStartDate:
          type: string
          description: Scheduled start date (ISO 8601)
          example: '2025-01-20T09:00:00.000Z'
        scheduledEndDate:
          type: string
          description: Scheduled end date (ISO 8601)
          nullable: true
          example: '2025-01-20T09:30:00.000Z'
        status:
          type: string
          description: Appointment status
          example: confirmed
        isNewPatient:
          type: boolean
          description: Whether the patient is new
          nullable: true
          example: false
        facilityId:
          type: string
          description: Facility ID
          nullable: true
          example: fac_b2c3d4e5f6a74b8c9d0e1f2a3b4c5d6e
        createdAt:
          type: string
          description: Created timestamp
          example: '2025-01-15T09:30:00.000Z'
        patient:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ExternalPatientResponseV3'
        provider:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ExternalProviderResponseV3'
      required:
        - id
        - scheduledStartDate
        - scheduledEndDate
        - status
        - isNewPatient
        - facilityId
        - createdAt
        - patient
        - provider
    PaginationInfoResponse:
      type: object
      properties:
        page:
          type: number
          description: Current page number
          example: 1
        pageSize:
          type: number
          description: Items per page
          example: 100
        totalCount:
          type: number
          description: Total number of items
          example: 250
        totalPages:
          type: number
          description: Total number of pages
          example: 3
      required:
        - page
        - pageSize
        - totalCount
        - totalPages
    ExternalPatientResponseV3:
      type: object
      properties:
        id:
          type: string
          description: Patient unique identifier
          example: pat_c56103bcd39c46d39f3138dd2b5e05f6
        mrn:
          type: string
          description: Medical record number
          nullable: true
          example: MRN-10042
        firstName:
          type: string
          description: First name
          nullable: true
          example: Sarah
        lastName:
          type: string
          description: Last name
          nullable: true
          example: Johnson
        middleName:
          type: string
          description: Middle name
          nullable: true
          example: Marie
        gender:
          type: string
          description: Gender
          nullable: true
          example: Female
        dateOfBirth:
          type: string
          description: Date of birth (YYYY-MM-DD)
          nullable: true
          example: '1985-03-15'
        email:
          type: string
          description: Email address
          nullable: true
          example: sarah.johnson@email.com
        phone:
          type: string
          description: Phone number
          nullable: true
          example: (555) 123-4567
        createdAt:
          type: string
          description: Created timestamp
          example: '2024-08-15T09:30:00.000Z'
        updatedAt:
          type: string
          description: Last updated timestamp
          example: '2025-01-20T14:22:00.000Z'
      required:
        - id
        - mrn
        - firstName
        - lastName
        - middleName
        - gender
        - dateOfBirth
        - email
        - phone
        - createdAt
        - updatedAt
    ExternalProviderResponseV3:
      type: object
      properties:
        id:
          type: string
          description: Provider unique identifier
          example: prv_d4e5f6a7b8c94d0e1f2a3b4c5d6e7f8a
        firstName:
          type: string
          description: First name
          nullable: true
          example: James
        lastName:
          type: string
          description: Last name
          nullable: true
          example: Wilson
        displayFirstName:
          type: string
          description: Display first name
          nullable: true
          example: Dr. James
        displayLastName:
          type: string
          description: Display last name
          nullable: true
          example: Wilson, MD
        roles:
          description: Provider roles
          example:
            - Physician
            - Surgeon
          type: array
          items:
            type: string
        username:
          type: string
          description: EHR username
          nullable: true
          example: jwilson
        individualNpi:
          type: string
          description: Individual NPI number
          nullable: true
          example: '1234567890'
        canFinalize:
          type: boolean
          description: Whether the provider can finalize (bill-under) notes
          example: true
        canCosign:
          type: boolean
          description: Whether the provider can cosign other providers' notes
          example: false
        createdAt:
          type: string
          description: Created timestamp
          example: '2024-06-01T08:00:00.000Z'
        updatedAt:
          type: string
          description: Last updated timestamp
          example: '2025-02-10T16:45:00.000Z'
      required:
        - id
        - firstName
        - lastName
        - displayFirstName
        - displayLastName
        - roles
        - username
        - individualNpi
        - canFinalize
        - canCosign
        - createdAt
        - updatedAt
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Marketplace API key

````