> ## 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 facilities

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



## OpenAPI

````yaml /openapi-v2.json get /facilities
openapi: 3.0.0
info:
  title: Max AI Public API
  description: API for third-party marketplace apps
  version: '2.0'
  contact: {}
servers:
  - url: https://api.maxcare.ai/v2
security: []
tags: []
paths:
  /facilities:
    get:
      tags:
        - Facilities
      summary: List facilities
      description: Returns a paginated list of facilities. Requires read:facilities scope.
      operationId: FacilitiesPublicController_listFacilities
      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: search
          required: false
          in: query
          description: Search by facility name
          schema:
            type: string
        - name: isVisible
          required: false
          in: query
          description: Filter by visibility status
          schema:
            type: boolean
        - 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/ListFacilitiesSuccessResponseV2'
        '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:
    ListFacilitiesSuccessResponseV2:
      type: object
      properties:
        code:
          type: string
          description: Response code
          example: success
        data:
          $ref: '#/components/schemas/ListFacilitiesResponseDataV2'
      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
    ListFacilitiesResponseDataV2:
      type: object
      properties:
        facilities:
          type: array
          items:
            $ref: '#/components/schemas/ExternalFacilityResponseV2'
        pagination:
          $ref: '#/components/schemas/PaginationInfoResponse'
      required:
        - facilities
        - pagination
    ExternalFacilityResponseV2:
      type: object
      properties:
        id:
          type: string
          description: Facility unique identifier
          example: b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e
        name:
          type: string
          description: Facility name
          example: West LA Dermatology
        timezone:
          type: string
          description: Timezone
          nullable: true
          example: America/Los_Angeles
        address:
          description: Facility address
          allOf:
            - $ref: '#/components/schemas/FacilityAddress'
        specialty:
          type: string
          description: Specialty
          nullable: true
          example: Dermatology
        organizationNpi:
          type: string
          description: Organization NPI number
          nullable: true
          example: '1234567890'
        createdAt:
          type: string
          description: Created timestamp
          example: '2024-05-01T10:00:00.000Z'
        updatedAt:
          type: string
          description: Last updated timestamp
          example: '2025-01-15T12:30:00.000Z'
      required:
        - id
        - name
        - timezone
        - address
        - specialty
        - organizationNpi
        - createdAt
        - updatedAt
    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
    FacilityAddress:
      type: object
      properties:
        line1:
          type: string
          description: Address line 1
          nullable: true
          example: 123 Medical Center Dr
        line2:
          type: string
          description: Address line 2
          nullable: true
          example: Suite 200
        city:
          type: string
          description: City
          nullable: true
          example: Los Angeles
        state:
          type: string
          description: State
          nullable: true
          example: CA
        zipcode:
          type: string
          description: ZIP code
          nullable: true
          example: '90025'
      required:
        - line1
        - line2
        - city
        - state
        - zipcode
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Marketplace API key

````