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

# Create an appointment



## OpenAPI

````yaml POST /appointments
openapi: 3.1.0
info:
  title: Caspen
  version: 0.0.1
servers:
  - url: https://api.caspen.com/v1
    description: Production
security: []
paths:
  /appointments:
    post:
      tags:
        - Appointment
      operationId: appointment.store
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreAppointmentRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    StoreAppointmentRequest:
      type: object
      properties:
        location_id:
          type: integer
        practitioner_id:
          type: integer
        service_id:
          type: integer
        starts_at:
          type: string
          format: date-time
        ends_at:
          type: string
          format: date-time
        buffer_before_duration:
          type: integer
          minimum: 0
          maximum: 120
        buffer_after_duration:
          type: integer
          minimum: 0
          maximum: 120
        note:
          type:
            - string
            - 'null'
          maxLength: 255
        room_id:
          type:
            - integer
            - 'null'
        vehicle_id:
          type:
            - integer
            - 'null'
        travel:
          type: boolean
        travel_name:
          type:
            - string
            - 'null'
          maxLength: 255
        travel_price:
          type:
            - integer
            - 'null'
          minimum: 0
        travel_before_duration:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 600
        travel_after_duration:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 600
        travel_address:
          type:
            - string
            - 'null'
          maxLength: 500
        client_ids:
          type: array
          items:
            type: integer
          minItems: 1
        repeating_rule:
          type: object
          properties:
            frequency:
              type: string
              enum:
                - weekly
            interval:
              type: integer
              minimum: 1
              maximum: 4
            days:
              type: array
              items:
                type: string
                enum:
                  - mon
                  - tue
                  - wed
                  - thu
                  - fri
                  - sat
                  - sun
              minItems: 1
            occurrences:
              type: integer
              minimum: 1
              maximum: 100
            skip_conflicts:
              type: boolean
        resource_ids:
          type: array
          items:
            type: integer
        travel_expenses:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                maxLength: 255
              price:
                type: integer
                minimum: 0
              price_unit:
                type: string
                enum:
                  - km
                  - mile
                  - each
              quantity:
                type: number
                minimum: 0
                maximum: 999999.99
            required:
              - name
              - price
              - price_unit
              - quantity
        transports:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                maxLength: 255
              price:
                type: integer
                minimum: 0
              price_unit:
                type: string
                enum:
                  - km
                  - mile
                  - each
              quantity:
                type: number
                minimum: 0
                maximum: 999999.99
            required:
              - name
              - price
              - price_unit
              - quantity
      required:
        - location_id
        - practitioner_id
        - service_id
        - starts_at
        - ends_at
        - client_ids
      title: StoreAppointmentRequest
  responses:
    AuthenticationException:
      description: Unauthenticated
      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

````