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

# Get Free Slots

> Get free slots for a calendar between a date range. Optionally a consumer can also request free slots in a particular timezone and also for a particular user.



## OpenAPI

````yaml /api-reference/calendars/openapi.json get /calendars/{calendarId}/free-slots
openapi: 3.0.0
info:
  title: Calendars API
  description: Documentation for Calendars API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Calendars
    description: Documentation for Calendars API
  - name: Calendar Groups
    description: Documentation for Calendars API
  - name: Calendar Events
    description: Documentation for Calendars API
  - name: Appointment Notes
    description: Documentation for Calendars API
  - name: Calendar Resources - Rooms and Equipment
    description: Documentation for Calendars API
  - name: Calendar Notifications
    description: Documentation for Calendars API
  - name: Availability
    description: Documentation for Calendars API
paths:
  /calendars/{calendarId}/free-slots:
    get:
      tags:
        - Calendars
      summary: Get Free Slots
      description: >-
        Get free slots for a calendar between a date range. Optionally a
        consumer can also request free slots in a particular timezone and also
        for a particular user.
      operationId: get-slots
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-04-15'
        - name: calendarId
          required: true
          in: path
          description: Calendar Id
          schema:
            type: string
            example: ocQHyuzHvysMo5N5VsXc
        - name: startDate
          required: true
          in: query
          description: >-
            Start Date (**⚠️ Important:** Date range cannot be more than 31
            days)
          schema:
            example: 1548898600000
            type: number
        - name: endDate
          required: true
          in: query
          description: End Date (**⚠️ Important:** Date range cannot be more than 31 days)
          schema:
            example: 1601490599999
            type: number
        - name: timezone
          required: false
          in: query
          description: The timezone in which the free slots are returned
          schema:
            example: America/Chihuahua
            type: string
        - name: userId
          required: false
          in: query
          description: The user for whom the free slots are returned
          schema:
            example: 082goXVW3lIExEQPOnd3
            type: string
        - name: userIds
          required: false
          in: query
          description: The users for whom the free slots are returned
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Availability map keyed by date (YYYY-MM-DD)
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/SlotsSchema'
                example:
                  '2024-10-28':
                    slots:
                      - '2024-10-28T10:00:00-05:00'
                      - '2024-10-28T11:00:00-05:00'
                  '2024-10-29':
                    slots:
                      - '2024-10-29T10:00:00-05:00'
                      - '2024-10-29T14:30:00-05:00'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
      security:
        - bearer:
            - calendars.readonly
components:
  schemas:
    SlotsSchema:
      type: object
      properties:
        slots:
          example:
            - '2024-10-28T10:00:00-05:00'
            - '2024-10-28T11:00:00-05:00'
          type: array
          items:
            type: string
      required:
        - slots
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Use the Access Token generated with user type as Sub-Account (OR)
        Private Integration Token of Sub-Account.
      type: http

````