> ## 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 availability templates

> Bookable-availability windows (ModMed calendar preferences · EZDerm blocks) plus their materialised occurrences in the window. Overlapping templates are returned as SEPARATE rows: overlap is additive capacity, and merging them would halve the practice's bookable schedule.



## OpenAPI

````yaml /openapi-v3.json get /schedule/availability-templates
openapi: 3.0.0
info:
  title: Max AI Public API
  description: API for third-party marketplace apps
  version: '3.0'
  contact: {}
servers:
  - url: https://api.maxcare.ai/v3
security: []
tags: []
paths:
  /schedule/availability-templates:
    get:
      tags:
        - Schedule
      summary: List availability templates
      description: >-
        Bookable-availability windows (ModMed calendar preferences · EZDerm
        blocks) plus their materialised occurrences in the window. Overlapping
        templates are returned as SEPARATE rows: overlap is additive capacity,
        and merging them would halve the practice's bookable schedule.
      operationId: SchedulePublicController_listAvailabilityTemplates
      parameters:
        - name: facilityId
          required: false
          in: query
          description: Facility ID (fac_…)
          schema:
            type: string
        - name: providerId
          required: false
          in: query
          description: Provider ID (prv_…)
          schema:
            type: string
        - name: from
          required: true
          in: query
          description: Window start (YYYY-MM-DD, inclusive)
          schema:
            example: '2026-08-01'
            type: string
        - name: to
          required: true
          in: query
          description: Window end (YYYY-MM-DD, inclusive)
          schema:
            example: '2026-09-30'
            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/ListAvailabilityTemplatesSuccessResponse'
        '400':
          description: Missing or invalid request parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiBadRequestResponse'
        '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'
        '502':
          description: EHR sync failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiBadGatewayResponse'
        '503':
          description: EHR integration unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceUnavailableResponse'
      security:
        - api-key: []
components:
  schemas:
    ListAvailabilityTemplatesSuccessResponse:
      type: object
      properties:
        code:
          type: string
          description: Response code
          example: success
        data:
          $ref: '#/components/schemas/ListAvailabilityTemplatesData'
      required:
        - code
        - data
    PublicApiBadRequestResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: bad_request
        message:
          type: string
          description: Human-readable error message
          example: '''id'' must be a valid UUID'
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    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
    PublicApiBadGatewayResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: unexpected_integration_error
        message:
          type: string
          description: Human-readable error message
          example: EHR sync failed
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiServiceUnavailableResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: server_unresponsive
        message:
          type: string
          description: Human-readable error message
          example: EHR integration is not available for this note
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    ListAvailabilityTemplatesData:
      type: object
      properties:
        templates:
          type: array
          items:
            $ref: '#/components/schemas/AvailabilityTemplateResponse'
        instances:
          description: Materialised occurrences in the window, exceptions already applied
          type: array
          items:
            $ref: '#/components/schemas/AvailabilityInstanceResponse'
        meta:
          $ref: '#/components/schemas/FreshnessMetaResponse'
      required:
        - templates
        - instances
        - meta
    AvailabilityTemplateResponse:
      type: object
      properties:
        id:
          type: string
          example: avt_9f2c1d0e3b4a5968778695a4b3c2d1e0
        externalId:
          type: string
          description: The EHR's own identifier (ModMed calendar preference · EZDerm block)
          example: '5512'
        providerId:
          type: string
          example: prv_35103413aaaa4bbbccccddddeeeeffff
        facilityId:
          type: string
          example: fac_2706aaaa4bbbccccddddeeeeffff1111
        name:
          type: string
          nullable: true
          example: Morning clinic
        startTimeLocal:
          type: string
          description: Local wall clock in `timezone`
          example: '08:00'
        endTimeLocal:
          type: string
          description: Local wall clock in `timezone`
          example: '12:00'
        timezone:
          type: string
          description: IANA zone name — never a vendor alias
          example: America/Detroit
        slotIntervalMinutes:
          type: number
          example: 15
        concurrency:
          type: number
          description: >-
            Capacity contributed by THIS template. Overlapping templates are
            ADDITIVE and are returned as separate rows — do not merge them.
          example: 1
        recurrence:
          type: object
          nullable: true
          description: Recurrence rule, when the EHR exposes one
          example:
            rrule: FREQ=WEEKLY;BYDAY=MO,TU,WE
            until: null
        allowedAppointmentTypeIds:
          nullable: true
          description: >-
            `null` means the EHR does not model a type restriction — NOT that no
            types are allowed
          example: null
          type: array
          items:
            type: string
        active:
          type: boolean
          example: true
      required:
        - id
        - externalId
        - providerId
        - facilityId
        - name
        - startTimeLocal
        - endTimeLocal
        - timezone
        - slotIntervalMinutes
        - concurrency
        - recurrence
        - allowedAppointmentTypeIds
        - active
    AvailabilityInstanceResponse:
      type: object
      properties:
        templateId:
          type: string
          example: avt_9f2c1d0e3b4a5968778695a4b3c2d1e0
        providerId:
          type: string
          example: prv_35103413aaaa4bbbccccddddeeeeffff
        facilityId:
          type: string
          example: fac_2706aaaa4bbbccccddddeeeeffff1111
        startsAt:
          type: string
          example: '2026-08-03T08:00:00-04:00'
        endsAt:
          type: string
          example: '2026-08-03T12:00:00-04:00'
        concurrency:
          type: number
          example: 1
      required:
        - templateId
        - providerId
        - facilityId
        - startsAt
        - endsAt
        - concurrency
    FreshnessMetaResponse:
      type: object
      properties:
        sourceSyncedAt:
          type: string
          description: >-
            When the underlying data was last synced from, or read from, the
            EHR. Null means complete sync coverage for the requested scope and
            dates is unknown. Read `sourceKind` before treating this as a lag
            measurement — on a live read it is the moment of the read itself, so
            `now - sourceSyncedAt` is always ~0 and measures nothing.
          nullable: true
          example: '2026-07-26T12:59:31.000Z'
        sourceKind:
          type: string
          enum:
            - live_read
            - mirror
          description: >-
            What `sourceSyncedAt` actually is. `live_read`: the endpoint went to
            the EHR for this request, so the timestamp is the read time and
            there is no lag to measure. `mirror`: the timestamp is a real sync
            watermark and `now - sourceSyncedAt` IS the lag. Slot searches use
            `mirror` unless strong consistency is requested. A consumer
            computing mirror lag must skip `live_read` responses rather than
            average a structural zero into its numbers.
          example: live_read
        maxStalenessSeconds:
          type: number
          description: The staleness this endpoint is designed to stay within, in seconds
          example: 60
        strongConsistency:
          type: boolean
          description: >-
            Whether the response bypassed caches and read the EHR live
            (`?consistency=strong`)
          example: false
      required:
        - sourceSyncedAt
        - sourceKind
        - maxStalenessSeconds
        - strongConsistency
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Marketplace API key

````