openapi: 3.1.0
info:
  title: PracSuite API
  description: >
    This is the official PracSuite API.


    It follows standard REST conventions, so you can work with it using any HTTP
    client and any programming language that can send HTTP requests.


    All responses are returned in JSON format.
  version: v1
  contact:
    name: PracSuite API Support
    email: helpdesk@pracsuite.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.pracsuite.com/v1
    description: Prod server
security:
  - x-api-key: []
    A-api-key: []
paths:
  /patient:
    get:
      summary: List all Patients
      operationId: listPatients-Get
      tags:
        - Patient
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["client_id","first_name","surname","file_created"]'
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | first_name | [string](/#string) |
            | surname | [string](/#string) |
            | file_created | [timestamp](/#timestamp) |
            | date_of_birth | [date](/#date) |
            | preferred_name | [string](/#string) |
            | email | [string](/#string) |
            | archived | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | email | [string](/#string) |
            | home_phone | [string](/#string) |
            | work_phone | [string](/#string) |
            | mobile | [string](/#string) |
            | phone | [string](/#string) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of all patients
          content:
            application/json:
              schema:
                type: object
                properties:
                  clients:
                    type: array
                    items:
                      $ref: '#/components/schemas/PatientWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/patient?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/patient?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/patient?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      summary: Create Patient
      operationId: createPatient-Post
      tags:
        - Patient
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatientPost'
      responses:
        '201':
          description: Successfully create Patient
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Patient'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/InvalidBody'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /patient/{patient_id}:
    get:
      summary: Get Patient
      operationId: getPatient-Get
      tags:
        - Patient
      parameters:
        - in: path
          name: patient_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Get Patient Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Patient'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /practitioner:
    get:
      summary: List all Practitioners
      operationId: listPractitioners-Get
      tags:
        - Practitioner
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["practitioner_id","first_name","surname","created"]'
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | archived | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | profession_id | [integer](/#integer) |
            | business_id | [integer](/#integer) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of all practitioners
          content:
            application/json:
              schema:
                type: object
                properties:
                  practitioners:
                    type: array
                    items:
                      $ref: '#/components/schemas/PractitionerWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/practitioner?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/practitioner?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/practitioner?page=3
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /practitioner/{practitioner_id}:
    get:
      summary: Get Practitioner
      operationId: getPractitioner-Get
      tags:
        - Practitioner
      parameters:
        - in: path
          name: practitioner_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Get Practitioner Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Practitioner'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /business/{business_id}/practitioner:
    get:
      summary: List Practitioners from Business
      operationId: listPractitionersFromBusiness-Get
      tags:
        - Practitioner
      parameters:
        - in: path
          name: business_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["practitioner_id","first_name","surname","created"]'
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | archived | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | profession_id | [integer](/#integer) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of all practitioners
          content:
            application/json:
              schema:
                type: object
                properties:
                  practitioners:
                    type: array
                    items:
                      $ref: '#/components/schemas/PractitionerWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/business/1/practitioner?page=2
                      previous:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/business/1/practitioner?page=1
                      next:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/business/1/practitioner?page=3
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /business:
    get:
      summary: List all Businesses
      operationId: listBusinesses-Get
      tags:
        - Business
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["business_id","business_name","display_name"]'
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | archived | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of all businesses
          content:
            application/json:
              schema:
                type: object
                properties:
                  businesses:
                    type: array
                    items:
                      $ref: '#/components/schemas/BusinessWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/business?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/business?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/business?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /business/{business_id}:
    get:
      summary: Get Business
      operationId: getBusiness-Get
      tags:
        - Business
      parameters:
        - in: path
          name: business_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Get Business Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Business'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /profession:
    get:
      summary: List all Professions
      operationId: listProfessions-Get
      tags:
        - Profession
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["profession_id","created","updated","archived"]'
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | archived | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of all professions
          content:
            application/json:
              schema:
                type: object
                properties:
                  professions:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProfessionWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/profession?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/profession?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/profession?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /profession/{profession_id}:
    get:
      summary: Get Profession
      operationId: getProfession-Get
      tags:
        - Profession
      parameters:
        - in: path
          name: profession_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Get Profession Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /profession/{profession_id}/practitioner:
    get:
      summary: List Practitioners from Profession
      operationId: listPractitionersFromProfession-Get
      tags:
        - Practitioner
      parameters:
        - in: path
          name: profession_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["practitioner_id","first_name","surname","created"]'
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | archived | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | business_id | [integer](/#integer) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of all practitioners
          content:
            application/json:
              schema:
                type: object
                properties:
                  practitioners:
                    type: array
                    items:
                      $ref: '#/components/schemas/PractitionerWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/profession/1/practitioner?page=2
                      previous:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/profession/1/practitioner?page=1
                      next:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/profession/1/practitioner?page=3
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /pronoun:
    get:
      summary: List all Pronouns
      operationId: listPronouns-Get
      tags:
        - Pronoun
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["pronoun_id","description"]'
      responses:
        '200':
          description: A list of all pronouns
          content:
            application/json:
              schema:
                type: object
                properties:
                  pronouns:
                    type: array
                    items:
                      $ref: '#/components/schemas/PronounWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/pronoun?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/pronoun?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/pronoun?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /sex:
    get:
      summary: List all sexes
      operationId: listSex-Get
      tags:
        - Sex
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["sex_id","description"]'
      responses:
        '200':
          description: A list of all sexes
          content:
            application/json:
              schema:
                type: object
                properties:
                  sexes:
                    type: array
                    items:
                      $ref: '#/components/schemas/SexWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/sex?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/sex?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/sex?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /fee_category:
    get:
      summary: List all Fee Categories
      operationId: listFeeCategories-Get
      tags:
        - Fee Category
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["fee_cat_id","description"]'
      responses:
        '200':
          description: A list of all fee categories
          content:
            application/json:
              schema:
                type: object
                properties:
                  fee_categories:
                    type: array
                    items:
                      $ref: '#/components/schemas/FeeCategoryWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/fee_category?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/fee_category?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/fee_category?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /appointment:
    get:
      summary: List Appointments
      operationId: listAppointments-Get
      tags:
        - Appointment
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: >-
            ["appointment_id","created","updated","profession_id","business_id","client_id","appointment_type_id","app_time"]
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [time](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | app_time | [datetime](/#datetime)|
            | profession_id | [integer](/#integer) |
            | business_id | [integer](/#integer) |
            | client_id | [integer](/#integer) |
            | appointment_type_id | [integer](/#integer) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of appointments
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointments:
                    type: array
                    items:
                      $ref: '#/components/schemas/AppointmentWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      summary: Create Appointment
      operationId: createAppointment-Post
      tags:
        - Appointment
      description: |
        This endpoint is used to create an Appointment in the appointment book
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppointmentCreatePost'
      responses:
        '201':
          description: Successfully create Appointment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Appointment'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/InternalServerError'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /reserve_appointment:
    post:
      summary: Reserve Appointment
      operationId: reserveAppointment-Post
      tags:
        - Appointment
      description: >
        This endpoint is used to reserve a spot in the appointment book before
        applying an `appointment_type_id`, etc. 


        After this you then call Finalise Appointment to apply the rest of the
        fields.


        The exception is when you pass `rule_out: true`. Then you don't need to
        call finalise
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppointmentReservePost'
      responses:
        '201':
          description: Successfully reser Appointment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentLite'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/InvalidBody'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /appointment/{appointment_id}:
    get:
      summary: Get Appointment
      operationId: getAppointment-Get
      tags:
        - Appointment
      parameters:
        - in: path
          name: appointment_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Appointment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      summary: Finalise Appointment
      operationId: finaliseAppointment-Post
      tags:
        - Appointment
      parameters:
        - in: path
          name: appointment_id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppointmentFinalisePost'
      responses:
        '201':
          description: Successfully finalised Appointment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Appointment'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/InvalidBody'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /appointment_type/{appointment_type_id}/appointment:
    get:
      summary: List Appointments by Appointment Type
      operationId: listAppointmentsByAppointmentType-Get
      tags:
        - Appointment
      parameters:
        - in: path
          name: appointment_type_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: >-
            ["appointment_id","created","updated","profession_id","business_id","client_id","appointment_type_id","app_time"]
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | app_time | [datetime](/#datetime)|
            | profession_id | [integer](/#integer) |
            | business_id | [integer](/#integer) |
            | client_id | [integer](/#integer) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of appointments
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointments:
                    type: array
                    items:
                      $ref: '#/components/schemas/AppointmentWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /business/{business_id}/appointment:
    get:
      summary: List Appointments by Business
      operationId: listAppointmentsByBusiness-Get
      tags:
        - Appointment
      parameters:
        - in: path
          name: business_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: >-
            ["appointment_id","created","updated","profession_id","business_id","client_id","appointment_type_id","app_time"]
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | app_time | [datetime](/#datetime)|
            | profession_id | [integer](/#integer) |
            | client_id | [integer](/#integer) |
            | appointment_type_id | [integer](/#integer) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of appointments
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointments:
                    type: array
                    items:
                      $ref: '#/components/schemas/AppointmentWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /profession/{profession_id}/appointment:
    get:
      summary: List Appointments by Profession
      operationId: listAppointmentsByProfession-Get
      tags:
        - Appointment
      parameters:
        - in: path
          name: profession_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: >-
            ["appointment_id","created","updated","profession_id","business_id","client_id","appointment_type_id","app_time"]
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | app_time | [datetime](/#datetime)|
            | business_id | [integer](/#integer) |
            | client_id | [integer](/#integer) |
            | appointment_type_id | [integer](/#integer) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of appointments
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointments:
                    type: array
                    items:
                      $ref: '#/components/schemas/AppointmentWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /patient/{patient_id}/appointment:
    get:
      summary: List Appointments by Patient
      operationId: listAppointmentsByPatient-Get
      tags:
        - Appointment
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: >-
            ["appointment_id","created","updated","profession_id","business_id","client_id","appointment_type_id","app_time"]
        - in: path
          name: patient_id
          required: true
          schema:
            type: integer
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
            | app_time | [datetime](/#datetime)|
            | profession_id | [integer](/#integer) |
            | business_id | [integer](/#integer) |
            | appointment_type_id | [integer](/#integer) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of appointments
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointments:
                    type: array
                    items:
                      $ref: '#/components/schemas/AppointmentWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /appointment_type:
    get:
      summary: List Appointment Types
      operationId: listAppointmentTypes-Get
      tags:
        - Appointment Type
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: >-
            ["appointment_type_id","created","updated","archived","profession_id"]
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | archived | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of appointment types
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointment_types:
                    type: array
                    items:
                      $ref: '#/components/schemas/AppointmentTypeWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment_type?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment_type?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/appointment_type?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /appointment_type/{appointment_type_id}:
    get:
      summary: Get Appointment Type
      operationId: getAppointmentType-Get
      tags:
        - Appointment Type
      parameters:
        - in: path
          name: appointment_type_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentType'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /profession/{profession_id}/appointment_type:
    get:
      summary: Get Appointment Types by Profession
      operationId: getProfessionAppointmentTypes-Get
      tags:
        - Appointment Type
      parameters:
        - in: path
          name: profession_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: >-
            ["appointment_type_id","created","updated","archived","profession_id"]
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | created | [timestamp](/#timestamp) |
            | archived | [timestamp](/#timestamp) |
            | updated | [timestamp](/#timestamp) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  appointment_types:
                    type: array
                    items:
                      $ref: '#/components/schemas/AppointmentTypeWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/profession/1/appointment_type?page=2
                      previous:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/profession/1/appointment_type?page=1
                      next:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/profession/1/appointment_type?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /item:
    get:
      summary: List Items
      operationId: listItems-Get
      tags:
        - Item
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["item_id","description","item_code"]'
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value | Format |
            |---|---|
            | item_code | [string](/#string) |
            | description | [string](/#string) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of item codes
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ItemWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/item?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/item?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/item?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /item/{item_id}:
    get:
      summary: Get Item
      operationId: getItem-Get
      tags:
        - Item
      parameters:
        - in: path
          name: item_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Item'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /item_group:
    get:
      summary: List Item Groups
      operationId: listItemGroups-Get
      tags:
        - Item Group
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["item_group_id","description"]'
        - in: query
          name: q[]
          description: |
            Filter result by one or more fields.

            See [Query Filtering](/#query-filtering)

            Available filters:

            | Value       | Format               |
            |-------------|----------------------|
            | description | [string](/#string)   |
            | archived    | [boolean](/#boolean) |
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: A list of item groups
          content:
            application/json:
              schema:
                type: object
                properties:
                  item_groups:
                    type: array
                    items:
                      $ref: '#/components/schemas/ItemGroupWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/item_group?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/item_group?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/item_group?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /item_group/{item_group_id}:
    get:
      summary: Get Item Group
      operationId: getItemGroup-Get
      tags:
        - Item Group
      parameters:
        - in: path
          name: item_group_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /resource:
    get:
      summary: List Resources
      operationId: listResources-Get
      tags:
        - Resource
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["resource_id","description","resource_rank"]'
      responses:
        '200':
          description: A list of resources
          content:
            application/json:
              schema:
                type: object
                properties:
                  resources:
                    type: array
                    items:
                      $ref: '#/components/schemas/ResourceWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /resource/{resource_id}:
    get:
      summary: Get Resource
      operationId: getResource-Get
      tags:
        - Resource
      parameters:
        - in: path
          name: resource_id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /appointment/{appointment_id}/resource:
    get:
      summary: List Resources by Appointment
      operationId: listResourcesByAppointment-Get
      tags:
        - Resource
      parameters:
        - in: path
          name: appointment_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["resource_id","description","resource_rank"]'
      responses:
        '200':
          description: A list of resources
          content:
            application/json:
              schema:
                type: object
                properties:
                  resources:
                    type: array
                    items:
                      $ref: '#/components/schemas/ResourceWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /appointment_type/{appointment_type_id}/resource:
    get:
      summary: List Resources by Appointment Type
      operationId: listResourcesByAppointmentType-Get
      tags:
        - Resource
      parameters:
        - in: path
          name: appointment_type_id
          required: true
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/Sort'
          example: '["resource_id","description","resource_rank"]'
      responses:
        '200':
          description: A list of resources
          content:
            application/json:
              schema:
                type: object
                properties:
                  resources:
                    type: array
                    items:
                      $ref: '#/components/schemas/ResourceWithMeta'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=2
                      previous:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=1
                      next:
                        type: string
                        format: uri
                        example: https://api.pracsuite.com/v1/resource?page=3
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /available_appointments:
    get:
      summary: List available appointment times
      operationId: listAvailableAppointments-Get
      tags:
        - Available Appointment
      parameters:
        - in: query
          name: from
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: to
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: appointment_type_id
          required: true
          schema:
            type: integer
        - in: query
          name: client_id
          description: Required if account_id is not null
          schema:
            type: integer
        - in: query
          name: account_id
          schema:
            type: integer
        - in: query
          name: business_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: practitioner_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: profession_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: resource_ids
          schema:
            type: array
            items:
              type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: A list of appts
          content:
            application/json:
              schema:
                type: object
                properties:
                  available_times:
                    type: array
                    items:
                      $ref: '#/components/schemas/AvailableAppointment'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/available_appointments?page=2&appointment_type_id=1&from=2025-01-01&to=2025-01-07
                      previous:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/available_appointments?page=1&appointment_type_id=1&from=2025-01-01&to=2025-01-07
                      next:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/available_appointments?page=3&appointment_type_id=1&from=2025-01-01&to=2025-01-07
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /next_available_appointment:
    get:
      summary: Get Next available appointment time
      operationId: getNextAvailableAppointment-Get
      tags:
        - Available Appointment
      parameters:
        - in: query
          name: from
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: to
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: appointment_type_id
          required: true
          schema:
            type: integer
        - in: query
          name: client_id
          description: Required if account_id is not null
          schema:
            type: integer
        - in: query
          name: account_id
          schema:
            type: integer
        - in: query
          name: business_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: practitioner_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: profession_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: resource_ids
          schema:
            type: array
            items:
              type: integer
      responses:
        '200':
          description: Next Available Appt
          content:
            application/json:
              schema:
                type: object
                properties:
                  available_times:
                    type: array
                    items:
                      $ref: '#/components/schemas/AvailableAppointment'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/next_available_appointment?page=2&appointment_type_id=1&from=2025-01-01&to=2025-01-07
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /available_group_appointments:
    get:
      summary: List available group appointments
      operationId: listAvailableGroupAppointments-Get
      tags:
        - Available Group Appointment
      parameters:
        - in: query
          name: from
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: to
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: appointment_type_id
          required: true
          schema:
            type: integer
        - in: query
          name: business_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: practitioner_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: profession_ids
          schema:
            type: array
            items:
              type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: A list of group appts
          content:
            application/json:
              schema:
                type: object
                properties:
                  available_times:
                    type: array
                    items:
                      $ref: '#/components/schemas/AvailableGroupAppointment'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/available_group_appointments?page=2&appointment_type_id=1&from=2025-01-01&to=2025-01-07
                      previous:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/available_group_appointments?page=1&appointment_type_id=1&from=2025-01-01&to=2025-01-07
                      next:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/available_group_appointments?page=3&appointment_type_id=1&from=2025-01-01&to=2025-01-07
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /next_available_group_appointment:
    get:
      summary: Get Next available group appointment time
      operationId: getNextAvailableGroupAppointment-Get
      tags:
        - Available Group Appointment
      parameters:
        - in: query
          name: from
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: to
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: appointment_type_id
          required: true
          schema:
            type: integer
        - in: query
          name: business_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: practitioner_ids
          schema:
            type: array
            items:
              type: integer
        - in: query
          name: profession_ids
          schema:
            type: array
            items:
              type: integer
      responses:
        '200':
          description: Next Available Appt
          content:
            application/json:
              schema:
                type: object
                properties:
                  available_times:
                    type: array
                    items:
                      $ref: '#/components/schemas/AvailableGroupAppointment'
                  total_entries:
                    type: integer
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                        format: uri
                        example: >-
                          https://api.pracsuite.com/v1/next_available_group_appointment?page=2&appointment_type_id=1&from=2025-01-01&to=2025-01-07
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    Page:
      in: query
      name: page
      example: 1
      schema:
        type: integer
        minimum: 1
    PageSize:
      in: query
      name: page_size
      example: 50
      schema:
        type: integer
        minimum: 1
        maximum: 100
    Sort:
      in: query
      name: sort_by
      explode: false
      description: Comma separated search fields
      schema:
        type: array
        items:
          type: string
          example: '["field_name","field_name"]'
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Vendor API Key
    A-api-key:
      type: apiKey
      in: header
      name: A-api-key
      description: PracSuite generated api key
  schemas:
    PageMetadata:
      type: object
      properties:
        row_num:
          type: integer
          readOnly: true
        total_rows:
          type: integer
          readOnly: true
    PatientLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/patient/1
        accounts:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/patient/1/account
        appointments:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/patient/1/appointment
      required:
        - self
    Patient:
      type: object
      title: Patient
      x-tags:
        - Patient
      properties:
        links:
          $ref: '#/components/schemas/PatientLinks'
        client_id:
          type: integer
          example: 1
        first_name:
          type: string
        tenant_id:
          type: integer
        title:
          type: string
        middle_name:
          type: string
        surname:
          type: string
        preferred_name:
          type: string
        date_of_birth:
          type: string
          format: date
        email:
          type: string
          format: email
        gender:
          type: string
        address_1:
          type: string
        address_2:
          type: string
        address_3:
          type: string
        address_4:
          type: string
        suburb:
          type: string
        address_state:
          type: string
        postcode:
          type: string
        country:
          type: string
        home_phone:
          type: string
        work_phone:
          type: string
        mobile:
          type: string
        fax:
          type: string
        file_no:
          type: string
        patient_notes:
          type: string
        patient_warnings:
          type: string
        fee_category:
          type: string
        health_fund:
          type: string
        health_fund_member_no:
          type: string
        pension_no:
          type: string
        pension_expiry:
          type: string
          format: date-time
        worksafe_claim_no:
          type: string
        archive:
          type: boolean
        occupation:
          type: string
        default_account_id:
          type: integer
        medicare_no:
          type: string
        medicare_irn:
          type: string
        medicare_expiry:
          type: string
          format: date
        medicare_claimant:
          type: boolean
        dva_no:
          type: string
        dva_type:
          type: string
        health_fund_patient_id:
          type: integer
        file_created:
          type: string
          format: date-time
        medicare_claimants:
          type: string
          description: Raw JSON string of claimant objects
        default_business:
          type: string
        default_practitioner:
          type: string
        referrer:
          type: string
        referrer_email:
          type: string
          format: email
        referrer_organisation:
          type: string
        referrer_source:
          type: string
        referral_date:
          type: string
          format: date
        medical_warnings:
          type: string
          description: HTML content
        reminders_notifications:
          type: string
          description: HTML content
        gp_name:
          type: string
        deceased:
          type: boolean
        family_notes:
          type: string
        health_fund_card_issue_no:
          type: string
        covid_vaccination_status:
          type: string
        covid_vaccination_date:
          type: string
          format: date
        ndis_number:
          type: string
        email_marketing:
          type: string
          enum:
            - Soft Opt-In
            - Opt-In
            - Soft Opt-Out
            - Opt-Out
        sms_marketing:
          type: string
          enum:
            - Soft Opt-In
            - Opt-In
            - Soft Opt-Out
            - Opt-Out
        sex:
          type: string
        pronouns:
          type: string
        default_phone_reminder:
          type: boolean
        default_sms_reminder:
          type: boolean
        default_email_reminder:
          type: boolean
        default_sms_confirmation:
          type: boolean
        default_email_confirmation:
          type: boolean
        default_sms_follow_up:
          type: boolean
        default_email_follow_up:
          type: boolean
    PatientWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Patient'
    PatientPost:
      type: object
      properties:
        first_name:
          type: string
        surname:
          type: string
        date_of_birth:
          type: string
          format: date
        address_1:
          type: string
        suburb:
          type: string
        address_state:
          type: string
        postcode:
          type: string
        country:
          type: string
        email:
          type: string
          format: email
        gender:
          type: string
        home_phone:
          type: string
        mobile:
          type: string
        preferred_phone:
          type: integer
          enum:
            - 1
            - 3
          description: Home Phone = 1 Mobile = 3
        fee_cat_id:
          type: integer
        default_practitioner_business_id:
          type: integer
        default_sms_reminder:
          type: boolean
        default_email_reminder:
          type: boolean
        default_sms_confirmation:
          type: boolean
        default_email_confirmation:
          type: boolean
        default_sms_follow_up:
          type: boolean
        default_email_follow_up:
          type: boolean
        sms_marketing_type:
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
          description: Soft Opt-In = 1, Opt-In = 2, Soft Opt-Out = 3, Opt-Out = 4
        email_marketing_type:
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
          description: Soft Opt-In = 1, Opt-In = 2, Soft Opt-Out = 3, Opt-Out = 4
        timezone:
          type: string
          example: Australia/Adelaide
          description: |
            see: [timezones](/guides/timezones)
        sex_id:
          type: integer
        pronoun_id:
          type: integer
      required:
        - first_name
        - surname
    PractitionerLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/practitioner/1
    Practitioner:
      type: object
      title: Practitioner
      x-tags:
        - Practitioner
      properties:
        links:
          $ref: '#/components/schemas/PractitionerLinks'
        tenant_id:
          type: integer
        practitioner_id:
          type: integer
        title:
          type: string
        first_name:
          type: string
        surname:
          type: string
        short_description:
          type: string
        professional_title:
          type: string
        qualifications:
          type: string
        archive:
          type: boolean
          example: false
        email:
          type: string
          format: email
        about_me:
          type: string
        telehealth_patient_link:
          type: string
        telehealth_practitioner_link:
          type: string
        created:
          type: string
          format: date-time
          example: 2020-08-24T06:46:22.174468z
    PractitionerWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Practitioner'
    BusinessLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/business/1
        appointment:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/business/1/appointment
    Business:
      type: object
      title: Business
      x-tags:
        - Business
      properties:
        links:
          $ref: '#/components/schemas/BusinessLinks'
        tenant_id:
          type:
            - integer
          example: 1
        business_id:
          type:
            - integer
          example: 123
        business_name:
          type:
            - string
        display_name:
          type:
            - string
        address_1:
          type:
            - string
            - 'null'
        address_2:
          type:
            - string
            - 'null'
        address_3:
          type:
            - string
            - 'null'
        address_4:
          type:
            - string
            - 'null'
        suburb:
          type:
            - string
            - 'null'
        address_state:
          type:
            - string
            - 'null'
        postcode:
          type:
            - string
            - 'null'
        country:
          type:
            - string
            - 'null'
        archive:
          type:
            - boolean
            - 'null'
          example: false
        phone:
          type:
            - string
            - 'null'
        fax:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
          format: email
        website:
          type:
            - string
            - 'null'
          format: uri
        appointment_start_time:
          type:
            - string
            - 'null'
          format: time
        appointment_end_time:
          type:
            - string
            - 'null'
          format: time
        registration_number:
          type:
            - string
            - 'null'
        registration_type:
          type:
            - string
            - 'null'
        short_description:
          type:
            - string
            - 'null'
        ndis_registration_number:
          type:
            - string
            - 'null'
    BusinessWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Business'
    ProfessionLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/profession/1
        appointment:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/profession/1/appointment
        appointment_type:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/profession/1/appointment_type
    Profession:
      type: object
      title: Profession
      x-tags:
        - Profession
      properties:
        links:
          $ref: '#/components/schemas/ProfessionLinks'
        tenant_id:
          type: integer
        profession_id:
          type: integer
        description:
          type: string
        default_title:
          type: string
        archived:
          type: boolean
    ProfessionWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Profession'
    Pronoun:
      type: object
      title: Pronoun
      x-tags:
        - Pronoun
      properties:
        tenant_id:
          type: integer
        pronoun_id:
          type: integer
        description:
          type: string
        nominative:
          type: string
        objective:
          type: string
        possessive:
          type: string
        possessive_determiner:
          type: string
        reflexive:
          type: string
    PronounWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Pronoun'
    Sex:
      type: object
      title: Sex
      x-tags:
        - Sex
      properties:
        tenant_id:
          type: integer
        sex_id:
          type: integer
        description:
          type: string
    SexWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Sex'
    FeeCategory:
      type: object
      title: Fee Category
      x-tags:
        - Fee Category
      properties:
        tenant_id:
          type: integer
        fee_cat_id:
          type: integer
        description:
          type: string
        active:
          type: boolean
    FeeCategoryWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/FeeCategory'
    AppointmentLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/appointment/1
        resources:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/appointment/1/resource
    Appointment:
      type: object
      title: Appointment
      x-tags:
        - Appointment
      properties:
        links:
          $ref: '#/components/schemas/AppointmentLinks'
        tenant_id:
          type: integer
        appointment_id:
          type: integer
        client_id:
          type: integer
        app_time:
          type: string
          format: date-time
        description:
          type: string
        appointment_type_id:
          type: integer
        appointment_status_id:
          type: integer
        category:
          type: string
        duration:
          type: integer
        notes:
          type: string
        practitioner_id:
          type: integer
        business_id:
          type: integer
        profession_id:
          type: integer
        item_id:
          type: integer
        account_id:
          type: integer
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
        item_group_id:
          type: integer
        telehealth_patient_link:
          type: string
        telehealth_practitioner_link:
          type: string
    AppointmentWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Appointment'
    AppointmentCreatePost:
      type: object
      properties:
        client_id:
          type: integer
        account_id:
          type: integer
        appointment_type_id:
          type: integer
        app_time:
          type: string
          description: >
            Required. ISO datetime in the tenant's timezone. Format:
            yyyy-MM-dd'T'HH:mm:ss
          example: '2025-01-01T12:00:00'
        practitioner_business_id:
          type: integer
        duration:
          type: integer
          description: |
            Must be between 5 and 1440 and divisible by 5.
          minimum: 5
          maximum: 1440
        appointment_status_id:
          type: integer
        item_id:
          type: integer
        item_group_id:
          type: integer
        column:
          type: integer
          default: 1
        width:
          type: integer
          default: 1
        resource_ids:
          type: array
          example:
            - 1
            - 2
          items:
            type: integer
        hourly_billing:
          type: boolean
        sms_reminder:
          type: boolean
        email_reminder:
          type: boolean
        sms_follow_up:
          type: boolean
        email_follow_up:
          type: boolean
      required:
        - app_time
        - practitioner_business_id
        - duration
        - client_id
        - account_id
        - appointment_type_id
    AppointmentReservePost:
      type: object
      properties:
        app_time:
          type: string
          description: >
            Required. ISO datetime in the tenant's timezone. Format:
            yyyy-MM-dd'T'HH:mm:ss
          example: '2025-01-01T12:00:00'
        practitioner_business_id:
          type: integer
        duration:
          type: integer
          description: |
            Must be between 5 and 1440 and divisible by 5.
          minimum: 5
          maximum: 1440
        column:
          type: integer
          default: 1
        width:
          type: integer
          default: 1
      required:
        - app_time
        - practitioner_business_id
        - duration
    AppointmentLite:
      type: object
      properties:
        appointment_id:
          type: integer
        app_time:
          type: string
          example: '2025-01-01T12:00:00'
        practitioner_id:
          type: integer
        business_id:
          type: integer
        practitioner_business_id:
          type: integer
        duration:
          type: integer
          description: |
            Must be between 5 and 1440 and divisible by 5.
          minimum: 5
          maximum: 1440
        column:
          type: integer
          default: 1
        width:
          type: integer
          default: 1
        category:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
          description: Reserved = 0, Patient = 1, Note = 2, Group = 3, Ruleout = 4
      required:
        - appointment_id
        - app_time
        - practitioner_id
        - business_id
        - duration
    AppointmentFinalisePost:
      type: object
      properties:
        client_id:
          type: integer
        account_id:
          type: integer
        appointment_type_id:
          type: integer
        appointment_status_id:
          type: integer
        item_id:
          type: integer
        item_group_id:
          type: integer
        resource_ids:
          type: array
          example:
            - 1
            - 2
          items:
            type: integer
        hourly_billing:
          type: boolean
        sms_reminder:
          type: boolean
        email_reminder:
          type: boolean
        sms_follow_up:
          type: boolean
        email_follow_up:
          type: boolean
      required:
        - client_id
        - account_id
        - appointment_type_id
    AppointmentTypeLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/appointment_type/1
        appointment:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/appointment_type/1/appointment
        resource:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/appointment_type/1/resource
    AppointmentType:
      type: object
      title: Appointment Type
      x-tags:
        - Appointment Type
      properties:
        links:
          $ref: '#/components/schemas/AppointmentTypeLinks'
        tenant_id:
          type: integer
        appointment_type_id:
          type: integer
        description:
          type: string
        short_description:
          type: string
        archived:
          type: boolean
        group_appointment:
          type: boolean
        group_max_size:
          type: integer
        telehealth:
          type: boolean
    AppointmentTypeWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/AppointmentType'
    ItemLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/item/1
    Item:
      type: object
      title: Item
      x-tags:
        - Item
      properties:
        links:
          $ref: '#/components/schemas/ItemLinks'
        tenant_id:
          type: integer
        item_id:
          type: integer
        item_code:
          type: string
        description:
          type: string
        gst:
          type: boolean
        archived:
          type: boolean
        print_code:
          type: string
    ItemWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Item'
    ItemGroupLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
          example: https://api.pracsuite.com/v1/item_group/1
    ItemGroup:
      type: object
      title: Item Group
      x-tags:
        - Item Group
      properties:
        links:
          $ref: '#/components/schemas/ItemGroupLinks'
        tenant_id:
          type: integer
        item_group_id:
          type: integer
        description:
          type: string
        archived:
          type: boolean
    ItemGroupWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/ItemGroup'
    Resource:
      type: object
      title: Resource
      x-tags:
        - Resource
      properties:
        tenant_id:
          type: integer
        resource_id:
          type: integer
        description:
          type: string
        resource_rank:
          type: integer
        archived:
          type: boolean
    ResourceWithMeta:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - $ref: '#/components/schemas/Resource'
    AvailableAppointment:
      type: object
      title: Available Appointment
      x-tags:
        - Available Appointment
      properties:
        app_time:
          type: string
          format: date-time
        column_number:
          type: integer
        item_id:
          type: integer
        item_group_id:
          type:
            - integer
            - 'null'
        hourly_billing:
          type: boolean
        ndis_claim_type:
          type:
            - string
            - 'null'
        ndis_cancellation_reason:
          type:
            - string
            - 'null'
        appointment_type_id:
          type: integer
        practitioner_business_id:
          type: integer
        practitioner_id:
          type: integer
        business_id:
          type: integer
        profession_id:
          type: integer
        width:
          type: integer
        duration:
          type: integer
        resource_ids:
          type: array
          items:
            type: integer
        practitioner_name:
          type: string
    AvailableGroupAppointment:
      type: object
      title: Available Group Appointment
      x-tags:
        - Available Group Appointment
      properties:
        appointment_id:
          type: integer
        current_class_size:
          type: integer
        max_class_size:
          type: integer
        app_time:
          type: string
          format: date-time
        column_number:
          type: integer
        item_id:
          type: integer
        item_group_id:
          type: integer
        hourly_billing:
          type: boolean
        ndis_claim_type:
          type: string
        ndis_cancellation_reason:
          type: string
        appointment_type_id:
          type: integer
        practitioner_business_id:
          type: integer
        practitioner_id:
          type: integer
        business_id:
          type: integer
        profession_id:
          type: integer
        width:
          type: integer
        duration:
          type: integer
        resource_ids:
          type: array
          items:
            type: integer
        practitioner_name:
          type: string
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                  code:
                    type: string
                    example: INVALID_PARAMS
                  title:
                    type: string
                    example: Invalid Params
                  detail:
                    type: string
                    description: Human readable explanation of the error
                    example: One or more request parameters are invalid.
                required:
                  - status
                  - code
                  - title
              request_id:
                type: string
                format: uuid
                example: 00000000-0000-0000-0000-000000000000
            required:
              - error
              - request_id
    Unauthorised:
      description: Unauthorised
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  status:
                    type: integer
                    example: 403
                  code:
                    type: string
                    example: UNAUTHORIZED
                  title:
                    type: string
                    example: Unauthorised
                  detail:
                    type: string
                    description: Human readable explanation of the error
                    example: Access could not be verified for this request.
                required:
                  - status
                  - code
                  - title
              request_id:
                type: string
                format: uuid
                example: 00000000-0000-0000-0000-000000000000
            required:
              - error
              - request_id
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  status:
                    type: integer
                    example: 403
                  code:
                    type: string
                    example: MISSING_AUTHENTICATION_TOKEN
                  title:
                    type: string
                    example: Unauthorised
                  detail:
                    type: string
                    description: Human readable explanation of the error
                    example: >-
                      Authentication token is missing or the requested endpoint
                      does not exist
                required:
                  - status
                  - code
                  - title
              request_id:
                type: string
                format: uuid
                example: 00000000-0000-0000-0000-000000000000
            required:
              - error
              - request_id
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                  code:
                    type: string
                    example: SERVER_ERROR
                  title:
                    type: string
                    example: Server Error
                  detail:
                    type: string
                    description: Human readable explanation of the error
                    example: >-
                      An unexpected error occurred while processing your
                      request. Please try again in a few minutes. If it keeps
                      happening, contact support with Request ID:
                      00000000-0000-0000-0000-000000000000.
                required:
                  - status
                  - code
                  - title
              request_id:
                type: string
                format: uuid
                example: 00000000-0000-0000-0000-000000000000
            required:
              - error
              - request_id
    InvalidBody:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  status:
                    type: integer
                    example: 422
                  code:
                    type: string
                    example: INVALID_BODY
                  title:
                    type: string
                    example: Invalid Body
                  detail:
                    type: string
                    description: Human readable explanation of the error
                    example: There are some issues with the request body.
                  validation:
                    type: array
                    description: List of validation errors for specific fields
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          example: surname
                        message:
                          type: string
                          example: The surname field is required.
                      required:
                        - field
                        - message
                required:
                  - status
                  - code
                  - title
                  - detail
                  - validation
              request_id:
                type: string
                format: uuid
                example: 00000000-0000-0000-0000-000000000000
            required:
              - error
              - request_id
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  status:
                    type: integer
                    example: 404
                  code:
                    type: string
                    example: NOT_FOUND
                  title:
                    type: string
                    example: Not Found
                  detail:
                    type: string
                    description: Human readable explanation of the error
                    example: Could not find {Resource} with ID {ID_HERE}
                required:
                  - status
                  - code
                  - title
              request_id:
                type: string
                format: uuid
                example: 00000000-0000-0000-0000-000000000000
            required:
              - error
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  status:
                    type: integer
                    example: 409
                  code:
                    type: string
                    example: RESERVE_APPOINTMENT_CONFLICT
                  title:
                    type: string
                    example: Unable to reserve the appointment
                  detail:
                    type: string
                    description: Human readable explanation of the error
                    example: This appointment slot is taken.
                required:
                  - status
                  - code
                  - title
                  - detail
              request_id:
                type: string
                format: uuid
                example: 00000000-0000-0000-0000-000000000000
            required:
              - error
              - request_id
tags:
  - name: Appointment
    description: |
      test
  - name: Appointment Type
    description: |
      test
  - name: Available Appointment
    description: Avaiasldfsdflsd
  - name: Available Group Appointment
    description: Avaiasldfsdflsd
  - name: Business
    description: sdfsfd
  - name: Fee Category
    description: sdfsfd
  - name: Item
    description: sdfsfd
  - name: Item Group
    description: sdfsfd
  - name: Patient
    description: >
      Patients are the people that book in for appointments.


      When you're working with patient information, make sure you abide by the
      relevant regulations for security and privacy.


      A couple of fields in the patient record deserve special consideration:


      `accepted_privacy_policy` stores the patient's consent to the business's
      own privacy policy. Values can be null (no response), true (accepted) or
      false (rejected). Please consider how this may affect you storing
      information on this patient.


      `time_zone` will contain a valid IANA time zone identifier if the
      patient's time zone has been set, or null if it hasn't. It can be set via
      the API, in which case it accepts IANA time zone identifiers.
  - name: Practitioner
    description: |
      test
  - name: Profession
    description: |
      test
  - name: Pronoun
    description: |
      test
  - name: Resource
    description: |
      test
  - name: Sex
    description: |
      test
