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

# Create an availability

> Create availability for the current user and given schedule



## OpenAPI

````yaml /openapi.json post /availability/
openapi: 3.1.0
info:
  title: Cal ID API
  description: >-
    API documentation for external developers integrating with Cal ID. This
    documentation is auto-generated from our OpenAPI specification and includes
    details on all available endpoints, request/response schemas, and
    authentication methods.


    Authentication is required for all endpoints and can be done using API key
    generated from the Cal ID dashboard under the `settings/developer/api-keys`
    page. Use the Authorization header with the Bearer scheme to authenticate
    your requests.


    Example:

    - API Key: `Authorization: Bearer calid_xxxxx`


    Note: To manage Team's resources use the Team's owner/admin API key
  version: 1.0.0
  contact:
    name: API Support
    email: support@cal.id
    url: https://cal.id
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.cal.id
    description: 'Production server '
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Health check endpoints
  - name: Users
    description: User management endpoints
  - name: Event Types
    description: Event type management endpoints
  - name: Teams
    description: Team management endpoints
  - name: Team Event Types
    description: Event type management endpoints for teams
  - name: Team Memberships
    description: Membership management endpoints for teams
  - name: Team Schedules
    description: Schedule management endpoints for teams
  - name: Availability
    description: User availability management endpoints
  - name: Schedule
    description: User schedule management endpoints
  - name: Slots
    description: Available slots retrieval endpoints
  - name: Booking
    description: Event booking endpoints
paths:
  /availability/:
    post:
      tags:
        - Availability
      summary: Create an availability
      description: Create availability for the current user and given schedule
      operationId: create_availability
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                scheduleId:
                  type: integer
                  exclusiveMinimum: 0
                  description: Schedule identifier that owns this availability block.
                  example: 42
                  minimum: 1
                startTime:
                  type: string
                  minLength: 1
                  description: >-
                    Availability start timestamp stored as time-of-day in
                    UTC-compatible format.
                  example: '1970-01-01T09:00:00.000Z'
                endTime:
                  type: string
                  minLength: 1
                  description: >-
                    Availability end timestamp stored as time-of-day in
                    UTC-compatible format.
                  example: '1970-01-01T17:00:00.000Z'
                days:
                  type: array
                  items:
                    type: integer
                  minItems: 1
                  description: >-
                    Weekday numbers for recurring availability (0 = Sunday, 6 =
                    Saturday).
                  example:
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
              required:
                - scheduleId
                - startTime
                - endTime
                - days
              additionalProperties: false
              example:
                scheduleId: 42
                days:
                  - 1
                  - 2
                  - 3
                  - 4
                  - 5
                startTime: '1970-01-01T09:00:00.000Z'
                endTime: '1970-01-01T17:00:00.000Z'
        required: true
      responses:
        '200':
          description: Created availability
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                      userId:
                        anyOf:
                          - type: integer
                          - type: 'null'
                      eventTypeId:
                        anyOf:
                          - type: integer
                          - type: 'null'
                      days:
                        type: array
                        items:
                          type: integer
                      startTime:
                        type: string
                        format: date-time
                      endTime:
                        type: string
                        format: date-time
                      date:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: 'null'
                      scheduleId:
                        anyOf:
                          - type: integer
                          - type: 'null'
                      targetTimeZones:
                        type: array
                        items:
                          type: string
                      Schedule:
                        type: object
                        properties:
                          userId:
                            type: integer
                        required:
                          - userId
                        additionalProperties: false
                    required:
                      - id
                      - days
                      - startTime
                      - endTime
                      - targetTimeZones
                      - Schedule
                    additionalProperties: false
                  message:
                    type: string
                  meta:
                    type: object
                    properties:
                      pagination:
                        type: object
                        properties:
                          page:
                            type: number
                          limit:
                            type: number
                          total:
                            type: number
                          totalPages:
                            type: number
                        required:
                          - page
                          - limit
                          - total
                          - totalPages
                        additionalProperties: false
                    additionalProperties: {}
                required:
                  - success
                additionalProperties: false
                description: Created availability
        '400':
          description: Invalid availability payload
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - message
                  - error
                additionalProperties: false
                description: Invalid availability payload
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - message
                  - error
                additionalProperties: false
                description: Unauthorized
        '500':
          description: Failed to create availability
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details: {}
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - message
                  - error
                additionalProperties: false
                description: Failed to create availability
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT | API Key
      description: |-

        Use the Authorization header with Bearer scheme.

        Examples:
        - API Key: Authorization: Bearer calid_xxxxx
            

````

## Related topics

- [Create Availability in Cal ID](/docs/availability/create.md)
- [Team Availability](/docs/availability/team-availability.md)
- [How to set Availability for an Event type?](/docs/event-types/setup/event-availability.md)
- [Multiple Schedules](/docs/availability/multiple-schedules.md)
- [Multiple Time Slots per Day](/docs/availability/multiple-time-slots.md)
