openapi: 3.1.0
info:
  title: AbaNinja Time Tracking API - Employee Groups
  version: 3.0.0
  x-domain-id: time-tracking
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: time-tracking-employee-groups
    description: Manage employee groups
    x-displayName: Employee Groups
security:
  - ApiToken: []
paths:
  /accounts/{accountUuid}/time/v2/employee-groups:
    get:
      tags:
        - time-tracking-employee-groups
      summary: Get employee groups
      description: Get all employee groups for an account
      operationId: time_list_employee_groups
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      title: Employee Group Resource
                      properties:
                        uuid:
                          type: string
                          format: uuid
                        translations:
                          properties:
                            de:
                              properties:
                                description:
                                  type:
                                    - string
                                    - 'null'
                                name:
                                  type: string
                              type: object
                            en:
                              properties:
                                description:
                                  type:
                                    - string
                                    - 'null'
                                name:
                                  type: string
                              type: object
                            fr:
                              properties:
                                description:
                                  type:
                                    - string
                                    - 'null'
                                name:
                                  type: string
                              type: object
                            it:
                              properties:
                                description:
                                  type:
                                    - string
                                    - 'null'
                                name:
                                  type: string
                              type: object
                          type: object
                      type: object
                  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/time-tracking
      x-legacy-operation-id: e0175cb85da7aabef8d7826636aaf532
      x-required-scopes:
        - time-tracking
    post:
      tags:
        - time-tracking-employee-groups
      summary: Add employee group
      description: Add a new employee group for an account
      operationId: time_create_employee_groups
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Add employee group
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/time-employee-group.schema.json
              description: A Schema for creating/updating timetracking employee group in AbaNinja over API
              type: object
              properties:
                translations:
                  type: object
                  properties:
                    de:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                    en:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                    fr:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                    it:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                  required:
                    - de
                    - en
                    - fr
                    - it
              required:
                - translations
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Employee Group Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      translations:
                        properties:
                          de:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          en:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          fr:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          it:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                        type: object
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 201
                  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/time-tracking
      x-legacy-operation-id: 4a6f16c60634fff931a2a57eb0fc088c
      x-required-scopes:
        - time-tracking
  /accounts/{accountUuid}/time/v2/employee-groups/{employeeGroupUuid}:
    get:
      tags:
        - time-tracking-employee-groups
      summary: Get employee group
      description: Get an employee group for an account
      operationId: time_get_employee_groups
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeGroupUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Employee Group Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      translations:
                        properties:
                          de:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          en:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          fr:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          it:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                        type: object
                    type: object
                  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
        '404':
          description: Resource not found
          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/time-tracking
      x-legacy-operation-id: 485209891ad670337ee166176e06af38
      x-required-scopes:
        - time-tracking
    patch:
      tags:
        - time-tracking-employee-groups
      summary: Update employee group
      description: Update an employee group for an account
      operationId: time_update_employee_groups
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeGroupUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Update employee group
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/time-employee-group.schema.json
              description: A Schema for creating/updating timetracking employee group in AbaNinja over API
              type: object
              properties:
                translations:
                  type: object
                  properties:
                    de:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                    en:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                    fr:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                    it:
                      type: object
                      properties:
                        name:
                          type:
                            - string
                            - 'null'
                        description:
                          type:
                            - string
                            - 'null'
                  required:
                    - de
                    - en
                    - fr
                    - it
              required:
                - translations
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Employee Group Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      translations:
                        properties:
                          de:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          en:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          fr:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                          it:
                            properties:
                              description:
                                type:
                                  - string
                                  - 'null'
                              name:
                                type: string
                            type: object
                        type: object
                    type: object
                  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
        '404':
          description: Resource not found
          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/time-tracking
      x-legacy-operation-id: 391fa6fb94139b647359d3bc1b172a29
      x-required-scopes:
        - time-tracking
    delete:
      tags:
        - time-tracking-employee-groups
      summary: Delete employee group
      description: Delete an employee group of an account
      operationId: time_delete_employee_groups
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeGroupUuid
          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:
                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
        '404':
          description: Resource not found
          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/time-tracking
      x-legacy-operation-id: b0e1d7d39fa7e6fe8c88bca067af432e
      x-required-scopes:
        - time-tracking
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
