openapi: 3.1.0
info:
  title: AbaNinja Holidays API - Settings
  version: 3.0.0
  x-domain-id: holidays
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: holiday-settings
    description: Manage holiday settings
    x-displayName: Holiday Settings
security:
  - ApiToken: []
paths:
  /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:
                properties:
                  data:
                    title: Holiday Settings Resource
                    properties:
                      useSystemHolidays:
                        type: boolean
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
      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:
                properties:
                  data:
                    title: Holiday Settings Resource
                    properties:
                      useSystemHolidays:
                        type: boolean
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
      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/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:
                properties:
                  data: {}
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                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
                required:
                  - detail
                  - type
                  - message
                  - status
      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
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
