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

# Add Appointment Definition

> A `POST` to the `/appointment-definitions` endpoint allows your application to create an appointment definition record.



## OpenAPI

````yaml post /v3/appointment-definitions
openapi: 3.1.0
info:
  title: Omneo
  version: 0.0.1
servers:
  - url: https://api.{tenant}.getomneo.com/api
    variables:
      tenant:
        default: example
security: []
paths:
  /v3/appointment-definitions:
    post:
      tags:
        - Appointment Definition
      summary: Add Appointment Definition
      description: >-
        A `POST` to the `/appointment-definitions` endpoint allows your
        application to create an appointment definition record.
      operationId: appointment-definitions.store
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreAppointmentDefinition'
      responses:
        '201':
          description: '`AppointmentDefinition`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AppointmentDefinition'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    StoreAppointmentDefinition:
      type: object
      properties:
        handle:
          type: string
          maxLength: 255
        name:
          type: string
          maxLength: 255
        description:
          type:
            - string
            - 'null'
        is_published:
          type: boolean
        is_archived:
          type: boolean
        duration_minutes:
          type: integer
          minimum: 1
        buffer_before_minutes:
          type: integer
          minimum: 0
        buffer_after_minutes:
          type: integer
          minimum: 0
        min_lead_minutes:
          type: integer
          minimum: 0
        max_advance_days:
          type:
            - integer
            - 'null'
          minimum: 1
        slot_interval_minutes:
          type:
            - integer
            - 'null'
          minimum: 1
        booking_type:
          type: string
          enum:
            - instant
            - approval_required
            - walk_in_only
        allow_customer_booking:
          type: boolean
        allow_walk_in:
          type: boolean
        requires_staff:
          type: boolean
        customer_must_select_staff:
          type: boolean
        use_staff_from_location:
          type: boolean
        max_concurrent_bookings:
          type:
            - integer
            - 'null'
          minimum: 1
        allow_waitlist:
          type: boolean
        allow_queue:
          type: boolean
        meta:
          type:
            - array
            - 'null'
          items:
            type: string
        created_target_id:
          type:
            - integer
            - 'null'
        confirmed_target_id:
          type:
            - integer
            - 'null'
        cancelled_target_id:
          type:
            - integer
            - 'null'
        rejected_target_id:
          type:
            - integer
            - 'null'
        reminder_target_id:
          type:
            - integer
            - 'null'
        notify_created_offset_days:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_created_offset_hours:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_confirmed_offset_days:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_confirmed_offset_hours:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_cancelled_offset_days:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_cancelled_offset_hours:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_rejected_offset_days:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_rejected_offset_hours:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_reminder_offset_days:
          type:
            - integer
            - 'null'
          minimum: 0
        notify_reminder_offset_hours:
          type:
            - integer
            - 'null'
          minimum: 0
        location_ids:
          type: array
          items:
            type: integer
        staff_ids:
          type: array
          items:
            type: string
        booking_questionnaire:
          type: object
          properties:
            name:
              type: string
              maxLength: 255
            handle:
              type:
                - string
                - 'null'
              maxLength: 255
            description:
              type:
                - string
                - 'null'
            is_active:
              type: boolean
            meta:
              type:
                - array
                - 'null'
              items:
                type: string
            questions:
              type: array
              items:
                type: object
                properties:
                  question_id:
                    type: integer
                  question_handle:
                    type: string
                  question_version_id:
                    type:
                      - integer
                      - 'null'
                  mapping_key:
                    type: string
                    pattern: ^[a-z0-9_]+$
                    maxLength: 255
                  sort_order:
                    type: integer
                    minimum: 0
                  is_required:
                    type: boolean
                  visibility_condition:
                    type:
                      - array
                      - 'null'
                    items:
                      type: string
                  is_active:
                    type: boolean
                required:
                  - mapping_key
            pages:
              type: array
              items:
                type: object
                properties:
                  title:
                    type:
                      - string
                      - 'null'
                    maxLength: 255
                  description:
                    type:
                      - string
                      - 'null'
                  image_url:
                    type:
                      - string
                      - 'null'
                    format: uri
                    maxLength: 2048
                  section_header:
                    type:
                      - string
                      - 'null'
                    maxLength: 255
                  sort_order:
                    type: integer
                    minimum: 0
                  questions:
                    type: array
                    items:
                      type: object
                      properties:
                        question_id:
                          type: integer
                        question_handle:
                          type: string
                        question_version_id:
                          type:
                            - integer
                            - 'null'
                        mapping_key:
                          type: string
                          pattern: ^[a-z0-9_]+$
                          maxLength: 255
                        sort_order:
                          type: integer
                          minimum: 0
                        is_required:
                          type: boolean
                        visibility_condition:
                          type:
                            - array
                            - 'null'
                          items:
                            type: string
                        is_active:
                          type: boolean
                      required:
                        - mapping_key
              minItems: 1
        normal_hours:
          type: array
          items:
            type: object
            properties:
              day_of_week:
                type: string
                enum:
                  - MON
                  - TUE
                  - WED
                  - THU
                  - FRI
                  - SAT
                  - SUN
              available_from:
                type:
                  - string
                  - 'null'
              available_until:
                type:
                  - string
                  - 'null'
            required:
              - day_of_week
          minItems: 1
        special_hours:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              is_repeating:
                type: boolean
              available_from:
                type:
                  - string
                  - 'null'
              available_until:
                type:
                  - string
                  - 'null'
              start_at:
                type: string
              end_at:
                type: string
            required:
              - name
              - start_at
              - end_at
      required:
        - handle
        - name
        - duration_minutes
        - booking_type
        - booking_questionnaire
        - normal_hours
      title: StoreAppointmentDefinition
    AppointmentDefinition:
      type: object
      properties:
        id:
          type: integer
        handle:
          type: string
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        is_published:
          type: boolean
        is_archived:
          type: boolean
        duration_minutes:
          type: integer
        buffer_before_minutes:
          type: integer
        buffer_after_minutes:
          type: integer
        min_lead_minutes:
          type: integer
        max_advance_days:
          type:
            - integer
            - 'null'
        slot_interval_minutes:
          type:
            - integer
            - 'null'
        booking_type:
          type: string
        allow_customer_booking:
          type: boolean
        allow_walk_in:
          type: boolean
        requires_staff:
          type: boolean
        customer_must_select_staff:
          type: boolean
        use_staff_from_location:
          type: boolean
        max_concurrent_bookings:
          type:
            - integer
            - 'null'
        allow_waitlist:
          type: boolean
        allow_queue:
          type: boolean
        meta:
          type:
            - array
            - 'null'
          items: {}
        created_target_id:
          type:
            - integer
            - 'null'
        confirmed_target_id:
          type:
            - integer
            - 'null'
        cancelled_target_id:
          type:
            - integer
            - 'null'
        rejected_target_id:
          type:
            - integer
            - 'null'
        reminder_target_id:
          type:
            - integer
            - 'null'
        notify_created_offset_days:
          type:
            - integer
            - 'null'
        notify_created_offset_hours:
          type:
            - integer
            - 'null'
        notify_confirmed_offset_days:
          type:
            - integer
            - 'null'
        notify_confirmed_offset_hours:
          type:
            - integer
            - 'null'
        notify_cancelled_offset_days:
          type:
            - integer
            - 'null'
        notify_cancelled_offset_hours:
          type:
            - integer
            - 'null'
        notify_rejected_offset_days:
          type:
            - integer
            - 'null'
        notify_rejected_offset_hours:
          type:
            - integer
            - 'null'
        notify_reminder_offset_days:
          type:
            - integer
            - 'null'
        notify_reminder_offset_hours:
          type:
            - integer
            - 'null'
        has_booking_questionnaire:
          type: boolean
        normal_hours:
          type: array
          items:
            $ref: '#/components/schemas/AppointmentDefinitionNormalHour'
        special_hours:
          type: array
          items:
            $ref: '#/components/schemas/AppointmentDefinitionSpecialHour'
        locations:
          type: array
          items: {}
        staff:
          type: array
          items:
            $ref: '#/components/schemas/AppointmentDefinitionStaff'
        booking_questionnaire:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            name:
              type: string
            purpose:
              type: string
            is_active:
              type: string
            pages:
              type: string
          required:
            - id
            - name
            - purpose
            - is_active
            - pages
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - handle
        - name
        - description
        - is_published
        - is_archived
        - duration_minutes
        - buffer_before_minutes
        - buffer_after_minutes
        - min_lead_minutes
        - max_advance_days
        - slot_interval_minutes
        - booking_type
        - allow_customer_booking
        - allow_walk_in
        - requires_staff
        - customer_must_select_staff
        - use_staff_from_location
        - max_concurrent_bookings
        - allow_waitlist
        - allow_queue
        - meta
        - created_target_id
        - confirmed_target_id
        - cancelled_target_id
        - rejected_target_id
        - reminder_target_id
        - notify_created_offset_days
        - notify_created_offset_hours
        - notify_confirmed_offset_days
        - notify_confirmed_offset_hours
        - notify_cancelled_offset_days
        - notify_cancelled_offset_hours
        - notify_rejected_offset_days
        - notify_rejected_offset_hours
        - notify_reminder_offset_days
        - notify_reminder_offset_hours
        - has_booking_questionnaire
        - created_at
        - updated_at
      title: AppointmentDefinition
    AppointmentDefinitionNormalHour:
      type: object
      properties:
        id:
          type: integer
        appointment_definition_id:
          type: integer
        day_of_week:
          type: string
        available_from:
          type:
            - string
            - 'null'
        available_until:
          type:
            - string
            - 'null'
        is_closed:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - appointment_definition_id
        - day_of_week
        - available_from
        - available_until
        - is_closed
        - created_at
        - updated_at
      title: AppointmentDefinitionNormalHour
    AppointmentDefinitionSpecialHour:
      type: object
      properties:
        id:
          type: integer
        appointment_definition_id:
          type: integer
        name:
          type: string
        is_repeating:
          type: boolean
        available_from:
          type:
            - string
            - 'null'
        available_until:
          type:
            - string
            - 'null'
        start_at:
          type: string
        end_at:
          type: string
        is_closed:
          type: string
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - appointment_definition_id
        - name
        - is_repeating
        - available_from
        - available_until
        - start_at
        - end_at
        - is_closed
        - created_at
        - updated_at
      title: AppointmentDefinitionSpecialHour
    AppointmentDefinitionStaff:
      type: object
      properties:
        id:
          type: integer
        appointment_definition_id:
          type: integer
        staff_id:
          type: string
        is_active:
          type: boolean
        staff:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            first_name:
              type:
                - string
                - 'null'
            last_name:
              type:
                - string
                - 'null'
            email:
              type: string
            mobile_phone:
              type:
                - string
                - 'null'
            normal_hours:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  day_of_week:
                    type: string
                  available_from:
                    type: string
                  available_until:
                    type: string
                  is_closed:
                    type: string
                required:
                  - id
                  - day_of_week
                  - available_from
                  - available_until
                  - is_closed
            special_hours:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  is_repeating:
                    type: string
                  available_from:
                    type: string
                  available_until:
                    type: string
                  start_at:
                    type: string
                  end_at:
                    type: string
                required:
                  - id
                  - name
                  - is_repeating
                  - available_from
                  - available_until
                  - start_at
                  - end_at
          required:
            - id
            - first_name
            - last_name
            - email
            - mobile_phone
            - normal_hours
            - special_hours
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - appointment_definition_id
        - staff_id
        - is_active
        - staff
        - created_at
        - updated_at
      title: AppointmentDefinitionStaff
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````