openapi: 3.1.0
info:
  title: AbaNinja Time Tracking API - Activities
  version: 3.0.0
  x-domain-id: time-tracking
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: time-tracking-activities
    description: Manage time tracking activities
    x-displayName: Activities
security:
  - ApiToken: []
paths:
  /accounts/{accountUuid}/time/v2/employees/{employeeUuid}/activities:
    post:
      tags:
        - time-tracking-activities
      summary: Add activity
      description: Add an activity for an employee
      operationId: time_create_activities
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Add activity
        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-activity.schema.json
              description: A Schema for creating/updating timetracking employee activity in AbaNinja over API
              type: object
              properties:
                activityTypeUuid:
                  type: string
                  format: uuid
                startDate:
                  type: string
                  format: date
                endDate:
                  type: string
                  format: date
                startTime:
                  type: string
                  pattern: ^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$
                  example: '14:35'
                endTime:
                  type: string
                  pattern: ^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$
                  example: '15:45'
                halfDay:
                  type: boolean
                addressUuid:
                  type:
                    - string
                    - 'null'
                  format: uuid
                contractNoteUuid:
                  type:
                    - string
                    - 'null'
                  format: uuid
                productUuid:
                  type:
                    - string
                    - 'null'
                  format: uuid
                description:
                  type:
                    - string
                    - 'null'
                  maxLength: 5000
              required:
                - activityTypeUuid
                - startDate
                - endDate
                - startTime
                - endTime
                - halfDay
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Activity Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      accountUuid:
                        type: string
                        format: uuid
                      employeeUuid:
                        type: string
                        format: uuid
                      activityTypeUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      addressUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      addressDescription:
                        type: string
                        deprecated: true
                      productUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      productKey:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      productDescription:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      startDate:
                        type: string
                        format: date
                        deprecated: true
                      endDate:
                        type: string
                        format: date
                        deprecated: true
                      startTime:
                        type: string
                        deprecated: true
                      endTime:
                        type: string
                        deprecated: true
                      startDateTime:
                        description: ISO8601 local time
                        type: string
                        example: '2024-01-14T20:20:00'
                      endDateTime:
                        description: ISO8601 local time
                        type: string
                        example: '2024-01-14T21:00:00'
                      halfDay:
                        type: boolean
                      description:
                        type:
                          - string
                          - 'null'
                      contractNoteId:
                        type:
                          - integer
                          - 'null'
                        deprecated: true
                      contractNoteUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      isInvoiced:
                        type: boolean
                        deprecated: true
                      isClosed:
                        type: boolean
                      closedAt:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      closedAtDateTime:
                        description: ISO8601 local time
                        type:
                          - string
                          - 'null'
                        format: date-time
                        example: '2024-01-31T13:00:00'
                      contractNoteName:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      poNumber:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                    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
        '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: 431ae5f3836e07be0778352aeea0617c
      x-required-scopes:
        - time-tracking
  /accounts/{accountUuid}/time/v2/employees/{employeeUuid}/activities/{activityUuid}:
    get:
      tags:
        - time-tracking-activities
      summary: Get activity
      description: Get the activity of an employee
      operationId: time_get_activities
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: activityUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Activity Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      accountUuid:
                        type: string
                        format: uuid
                      employeeUuid:
                        type: string
                        format: uuid
                      activityTypeUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      addressUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      addressDescription:
                        type: string
                        deprecated: true
                      productUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      productKey:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      productDescription:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      startDate:
                        type: string
                        format: date
                        deprecated: true
                      endDate:
                        type: string
                        format: date
                        deprecated: true
                      startTime:
                        type: string
                        deprecated: true
                      endTime:
                        type: string
                        deprecated: true
                      startDateTime:
                        description: ISO8601 local time
                        type: string
                        example: '2024-01-14T20:20:00'
                      endDateTime:
                        description: ISO8601 local time
                        type: string
                        example: '2024-01-14T21:00:00'
                      halfDay:
                        type: boolean
                      description:
                        type:
                          - string
                          - 'null'
                      contractNoteId:
                        type:
                          - integer
                          - 'null'
                        deprecated: true
                      contractNoteUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      isInvoiced:
                        type: boolean
                        deprecated: true
                      isClosed:
                        type: boolean
                      closedAt:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      closedAtDateTime:
                        description: ISO8601 local time
                        type:
                          - string
                          - 'null'
                        format: date-time
                        example: '2024-01-31T13:00:00'
                      contractNoteName:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      poNumber:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                    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: f16a63369ed653063051cb4641e1d21e
      x-required-scopes:
        - time-tracking
    patch:
      tags:
        - time-tracking-activities
      summary: Update activity
      description: Update an activity for an employee
      operationId: time_update_activities
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: activityUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Update activity
        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-activity.schema.json
              description: A Schema for creating/updating timetracking employee activity in AbaNinja over API
              type: object
              properties:
                activityTypeUuid:
                  type: string
                  format: uuid
                startDate:
                  type: string
                  format: date
                endDate:
                  type: string
                  format: date
                startTime:
                  type: string
                  pattern: ^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$
                  example: '14:35'
                endTime:
                  type: string
                  pattern: ^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$
                  example: '15:45'
                halfDay:
                  type: boolean
                addressUuid:
                  type:
                    - string
                    - 'null'
                  format: uuid
                contractNoteUuid:
                  type:
                    - string
                    - 'null'
                  format: uuid
                productUuid:
                  type:
                    - string
                    - 'null'
                  format: uuid
                description:
                  type:
                    - string
                    - 'null'
                  maxLength: 5000
              required:
                - activityTypeUuid
                - startDate
                - endDate
                - startTime
                - endTime
                - halfDay
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Activity Resource
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      accountUuid:
                        type: string
                        format: uuid
                      employeeUuid:
                        type: string
                        format: uuid
                      activityTypeUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      addressUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      addressDescription:
                        type: string
                        deprecated: true
                      productUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      productKey:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      productDescription:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      startDate:
                        type: string
                        format: date
                        deprecated: true
                      endDate:
                        type: string
                        format: date
                        deprecated: true
                      startTime:
                        type: string
                        deprecated: true
                      endTime:
                        type: string
                        deprecated: true
                      startDateTime:
                        description: ISO8601 local time
                        type: string
                        example: '2024-01-14T20:20:00'
                      endDateTime:
                        description: ISO8601 local time
                        type: string
                        example: '2024-01-14T21:00:00'
                      halfDay:
                        type: boolean
                      description:
                        type:
                          - string
                          - 'null'
                      contractNoteId:
                        type:
                          - integer
                          - 'null'
                        deprecated: true
                      contractNoteUuid:
                        type:
                          - string
                          - 'null'
                        format: uuid
                      isInvoiced:
                        type: boolean
                        deprecated: true
                      isClosed:
                        type: boolean
                      closedAt:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      closedAtDateTime:
                        description: ISO8601 local time
                        type:
                          - string
                          - 'null'
                        format: date-time
                        example: '2024-01-31T13:00:00'
                      contractNoteName:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                      poNumber:
                        type:
                          - string
                          - 'null'
                        deprecated: true
                    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: cc9c50be3263112eeaf66b1a4e9f3b0d
      x-required-scopes:
        - time-tracking
    delete:
      tags:
        - time-tracking-activities
      summary: Delete activity
      description: Delete an activity for an employee
      operationId: time_delete_activities
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: activityUuid
          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: 9e2c66989f7d589d11a9a66571529e7f
      x-required-scopes:
        - time-tracking
  /accounts/{accountUuid}/time/v2/employees/{employeeUuid}/activities/{activityUuid}/actions:
    get:
      tags:
        - time-tracking-activities
      summary: Get single actions
      description: Get the single actions of an activity
      operationId: time_list_actions
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: employeeUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: activityUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      title: Single Employee Activity Action Resource
                      properties:
                        key:
                          type: string
                        description:
                          type: string
                        isApplicable:
                          type: boolean
                      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: 010c7b7da19dd6a55414a6980735faa9
      x-required-scopes:
        - time-tracking
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
