openapi: 3.1.0
info:
  title: AbaNinja Holidays API
  version: 3.0.0
  x-domain-id: holidays
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: holidays
    description: Manage holidays
    x-displayName: Holidays
  - name: holiday-settings
    description: Manage holiday settings
    x-displayName: Holiday Settings
security:
  - ApiToken: []
paths:
  /accounts/{accountUuid}/holidays/v2/holidays:
    get:
      tags:
        - holidays
      summary: Get all holidays
      description: Get all holidays for an account
      operationId: holidays_list_holidays
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: year
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            maximum: 9999
            minimum: 1000
        - name: date
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date
        - name: countryCode
          in: query
          required: true
          schema:
            type: string
            format: iso-3166-alpha-2
            example: CH
            enum:
              - AT
              - FR
              - DE
              - IT
              - LI
              - CH
        - name: state
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date
            maxLength: 6
            minLength: 2
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        type: array
                        items:
                          title: Holiday Resource
                          properties:
                            uuid:
                              type:
                                - string
                                - 'null'
                              format: uuid
                            date:
                              type: string
                              format: date
                            halfDay:
                              type: boolean
                            translations:
                              properties:
                                de:
                                  properties:
                                    name:
                                      type: string
                                  type: object
                                en:
                                  properties:
                                    name:
                                      type: string
                                  type: object
                                fr:
                                  properties:
                                    name:
                                      type: string
                                  type: object
                                it:
                                  properties:
                                    name:
                                      type: string
                                  type: object
                              type: object
                          type: object
                      status:
                        example: 200
                    type: object
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 6265cd9a54f2ba727e2b2fa6bacec087
      x-required-scopes:
        - customers
        - time-tracking
    post:
      tags:
        - holidays
      summary: Create custom holiday
      description: Create a custom holiday for an account
      operationId: holidays_create_holidays
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Create custom holiday
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/holiday-custom.schema.json
              description: A Schema for creating/updating custom holidays in AbaNinja over API
              type: object
              properties:
                date:
                  type: string
                  format: date
                countryCode:
                  type: string
                  minLength: 2
                  maxLength: 2
                state:
                  type: string
                  minLength: 1
                  maxLength: 6
                halfDay:
                  type: boolean
                translations:
                  type: object
                  properties:
                    de:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                          maxLength: 255
                    en:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                          maxLength: 255
                    fr:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                          maxLength: 255
                    it:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                          maxLength: 255
                  required:
                    - de
                    - en
                    - fr
                    - it
              required:
                - date
                - countryCode
                - state
                - halfDay
                - translations
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        title: Custom Holiday Resource
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          date:
                            type: string
                            format: date
                          halfDay:
                            type: boolean
                          countryCode:
                            type: string
                            format: iso-3166-alpha-2
                            example: CH
                            maxLength: 2
                            minLength: 2
                          state:
                            type:
                              - string
                              - 'null'
                          translations:
                            properties:
                              de:
                                properties:
                                  name:
                                    type: string
                                type: object
                              en:
                                properties:
                                  name:
                                    type: string
                                type: object
                              fr:
                                properties:
                                  name:
                                    type: string
                                type: object
                              it:
                                properties:
                                  name:
                                    type: string
                                type: object
                            type: object
                        type: object
                      status:
                        example: 201
                    type: object
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: bb5ffb52fd57d7d6431860618f9e05e2
      x-required-scopes:
        - customers
        - time-tracking
  /accounts/{accountUuid}/holidays/v2/settings:
    get:
      tags:
        - holiday-settings
      summary: Get holiday settings
      description: Get the holiday settings for an account
      operationId: holidays_list_settings
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        title: Holiday Settings Resource
                        properties:
                          useSystemHolidays:
                            type: boolean
                        type: object
                      status:
                        example: 200
                    type: object
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 97b9d0c0da8390454861199a4b8f7680
      x-required-scopes:
        - customers
        - time-tracking
    patch:
      tags:
        - holiday-settings
      summary: Update holiday settings
      description: Update the holiday settings for an account
      operationId: holidays_update_settings
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Update holiday settings
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/holiday-settings.schema.json
              description: A Schema for updating holiday settings in AbaNinja over API
              type: object
              properties:
                useSystemHolidays:
                  type: boolean
              required:
                - useSystemHolidays
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        title: Holiday Settings Resource
                        properties:
                          useSystemHolidays:
                            type: boolean
                        type: object
                      status:
                        example: 200
                    type: object
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 0a4e538ef06e33dbbdc23ddfb831c8db
      x-required-scopes:
        - customers
        - time-tracking
  /accounts/{accountUuid}/holidays/v2/holidays/{holidayUuid}:
    get:
      tags:
        - holidays
      summary: Get custom holiday
      description: Get a custom holiday for an account
      operationId: holidays_get_holidays
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: holidayUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        title: Custom Holiday Resource
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          date:
                            type: string
                            format: date
                          halfDay:
                            type: boolean
                          countryCode:
                            type: string
                            format: iso-3166-alpha-2
                            example: CH
                            maxLength: 2
                            minLength: 2
                          state:
                            type:
                              - string
                              - 'null'
                          translations:
                            properties:
                              de:
                                properties:
                                  name:
                                    type: string
                                type: object
                              en:
                                properties:
                                  name:
                                    type: string
                                type: object
                              fr:
                                properties:
                                  name:
                                    type: string
                                type: object
                              it:
                                properties:
                                  name:
                                    type: string
                                type: object
                            type: object
                        type: object
                      status:
                        example: 200
                    type: object
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: df78bc09403871d9f7243f19f4049919
      x-required-scopes:
        - customers
        - time-tracking
    patch:
      tags:
        - holidays
      summary: Update custom holiday
      description: Update a custom holiday for an account
      operationId: holidays_update_holidays
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: holidayUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Update custom holiday
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/holiday-custom.schema.json
              description: A Schema for creating/updating custom holidays in AbaNinja over API
              type: object
              properties:
                date:
                  type: string
                  format: date
                countryCode:
                  type: string
                  minLength: 2
                  maxLength: 2
                state:
                  type: string
                  minLength: 1
                  maxLength: 6
                halfDay:
                  type: boolean
                translations:
                  type: object
                  properties:
                    de:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                          maxLength: 255
                    en:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                          maxLength: 255
                    fr:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                          maxLength: 255
                    it:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                          maxLength: 255
                  required:
                    - de
                    - en
                    - fr
                    - it
              required:
                - date
                - countryCode
                - state
                - halfDay
                - translations
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        title: Custom Holiday Resource
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          date:
                            type: string
                            format: date
                          halfDay:
                            type: boolean
                          countryCode:
                            type: string
                            format: iso-3166-alpha-2
                            example: CH
                            maxLength: 2
                            minLength: 2
                          state:
                            type:
                              - string
                              - 'null'
                          translations:
                            properties:
                              de:
                                properties:
                                  name:
                                    type: string
                                type: object
                              en:
                                properties:
                                  name:
                                    type: string
                                type: object
                              fr:
                                properties:
                                  name:
                                    type: string
                                type: object
                              it:
                                properties:
                                  name:
                                    type: string
                                type: object
                            type: object
                        type: object
                      status:
                        example: 200
                    type: object
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: a5d86d03f5c234dbb2ea22548195aa51
      x-required-scopes:
        - customers
        - time-tracking
    delete:
      tags:
        - holidays
      summary: Delete custom holiday
      description: Delete a custom holiday for an account
      operationId: holidays_delete_holidays
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: holidayUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: Successful response
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 4b7cc7341a1169e75b347ee8535e1ef1
      x-required-scopes:
        - customers
        - time-tracking
  /accounts/{accountUuid}/holidays/v2/holidays/countries:
    get:
      tags:
        - holidays
      summary: Get countries
      description: Get available holiday countries for an account
      operationId: holidays_list_countries
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        type: array
                        items:
                          title: Country Resource
                          properties:
                            code:
                              type: string
                            name:
                              type: string
                          type: object
                      status:
                        example: 200
                    type: object
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 7d297b1117f33e3f77448d538c7c6da8
      x-required-scopes:
        - customers
        - time-tracking
  /accounts/{accountUuid}/holidays/v2/settings/convert:
    post:
      tags:
        - holiday-settings
      summary: Convert system holidays
      description: Convert the system holidays for an account
      operationId: holidays_create_convert
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Convert system holidays
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/holiday-convert.schema.json
              description: A Schema for converting system holidays to custom holidays in AbaNinja over API
              type: object
              properties:
                year:
                  type: integer
                countryCode:
                  type: string
                  minLength: 2
                  maxLength: 2
                state:
                  type: string
                  minLength: 1
                  maxLength: 6
              required:
                - year
                - countryCode
                - state
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data: {}
                      status:
                        example: 200
                    type: object
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for erronous requests
                    required:
                      - detail
                      - type
                      - message
                      - status
                    properties:
                      detail:
                        title: details
                      type:
                        title: type
                        type: string
                      requestUuid:
                        title: requestUuid
                        type: string
                        format: uuid
                      path:
                        title: path
                        type: string
                      message:
                        title: message
                        type:
                          - string
                          - 'null'
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                    type: object
                  - properties: {}
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 28c9a1c8aa8c612832f5fbb5c8e97896
      x-required-scopes:
        - customers
        - time-tracking
  /accounts/{accountUuid}/holidays/v2/holidays/countries/{countryCode}/states:
    get:
      tags:
        - holidays
      summary: Get states
      description: Get available holiday states for an account
      operationId: holidays_list_states
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: countryCode
          in: path
          required: true
          schema:
            type: string
            format: iso-3166-alpha-2
            example: CH
            enum:
              - AT
              - FR
              - DE
              - IT
              - LI
              - CH
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - description: The response format of most endpoints for successful requests
                    required:
                      - data
                      - message
                      - status
                    properties:
                      data:
                        title: data
                      message:
                        title: message
                        type: string
                      status:
                        title: status
                        description: HTTP status code
                        type: integer
                      meta:
                        title: meta
                        type:
                          - object
                          - 'null'
                    type: object
                  - properties:
                      data:
                        type: array
                        items:
                          title: State Resource
                          properties:
                            code:
                              type: string
                            name:
                              type: string
                          type: object
                      status:
                        example: 200
                    type: object
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/customers
            - https://api.abaninja.ch/auth/time-tracking
      x-legacy-operation-id: 784df3a3042bc82a069aec0cc5569a8a
      x-required-scopes:
        - customers
        - time-tracking
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
