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

# Create Calendar Resource

> Create calendar resource by resource type



## OpenAPI

````yaml /api-reference/calendars/openapi.json post /calendars/resources/{resourceType}
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/resources/{resourceType}:
    post:
      tags:
        - Calendar Resources - Rooms and Equipment
      summary: Create Calendar Resource
      description: Create calendar resource by resource type
      operationId: create-calendar-resource
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-04-15'
        - name: resourceType
          required: true
          in: path
          description: Calendar Resource Type
          schema:
            type: string
            enum:
              - equipments
              - rooms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCalendarResourceDTO'
      responses:
        '201':
          description: Calendar resource created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CalendarResourceByIdResponseDTO'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
      security:
        - Location-Access:
            - calendars/resources.write
components:
  schemas:
    CreateCalendarResourceDTO:
      type: object
      properties:
        locationId:
          type: string
        name:
          type: string
        description:
          type: string
        quantity:
          type: number
          description: Quantity of the equipment.
        outOfService:
          type: number
          description: Quantity of the out of service equipment.
        capacity:
          type: number
          description: Capacity of the room.
        calendarIds:
          description: |-
            Service calendar IDs to be mapped with the resource.

                One equipment can only be mapped with one service calendar.
                
            One room can be mapped with multiple service calendars.
          maxItems: 100
          type: array
          items:
            type: string
      required:
        - locationId
        - name
        - description
        - quantity
        - outOfService
        - capacity
        - calendarIds
    CalendarResourceByIdResponseDTO:
      type: object
      properties:
        locationId:
          type: string
          description: Location ID of the resource
        name:
          type: string
          description: Name of the resource
          example: yoga room
        resourceType:
          type: string
          enum:
            - equipments
            - rooms
        isActive:
          type: boolean
          description: Whether the resource is active
        description:
          type: string
          description: Description of the resource
        quantity:
          type: number
          description: Quantity of the resource
        outOfService:
          type: number
          description: Indicates if the resource is out of service
          example: 0
        capacity:
          type: number
          description: Capacity of the resource
          example: 85
        calendarIds:
          description: Calendar IDs
          example:
            - Jsj0xnlDDjw0SuvX1J13
            - oCM5feFC86FAAbcO7lJK
          type: array
          items:
            type: string
      required:
        - locationId
        - name
        - resourceType
        - isActive
        - calendarIds
    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

````