openapi: 3.0.3
info:
  title: 'Aether DUM API'
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://dum-staging.aetherdigitaltherapy.com'
paths:
  /api/blade-data:
    post:
      summary: 'Send BLADE data'
      description: "Save BLADE data in JSON format to a file with timestamp in name.\nFiles are stored in storage/app/blade/ which is not publicly accessible.\nOnly SuperAdmin users can send BLADE data."
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        201:
          description: 'Success response'
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'BLADE data saved successfully'
                  file: blade_data_2025-10-05_12-07-07_09.json
                properties:
                  message:
                    type: string
                    example: 'BLADE data saved successfully'
                  file:
                    type: string
                    example: blade_data_2025-10-05_12-07-07_09.json
      tags:
        - 'BLADE data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: string
                  description: 'BLADE data in JSON format. Must be a valid JSON string.'
                  example: "[\n                    {\n                        \"extractor_name\": \"number_of_all_dum_dumps\",\n                        \"extractor_arguments\": {\n                            \"period\": \"0001-01-01 - 9999-12-31\",\n                            \"dum_version\": \"all\"\n                        },\n                        \"extractor_category\": \"dum1a\",\n                        \"result\": 10506\n                    }\n                ]"
              required:
                - data
    get:
      summary: 'Get latest BLADE data'
      description: "Retrieve the most recently saved BLADE data file.\nThis is the only way to access BLADE data files - they are not publicly accessible."
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: 'Success response'
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      extractor_name: number_of_all_dum_dumps
                      extractor_arguments:
                        period: '0001-01-01 - 9999-12-31'
                        dum_version: all
                      result: 8537
                    -
                      extractor_name: number_of_users_dumping_dum
                      extractor_arguments:
                        period: '0001-01-01 - 9999-12-31'
                        dum_version: all
                      result: 530
                    -
                      extractor_name: average_number_of_user_dum_dumps
                      extractor_arguments:
                        period: '0001-01-01 - 9999-12-31'
                        dum_version: all
                      result: 16.107547169811
                  file: blade_data_2025-10-05_12-07-07_09.json
                properties:
                  data:
                    type: array
                    example:
                      -
                        extractor_name: number_of_all_dum_dumps
                        extractor_arguments:
                          period: '0001-01-01 - 9999-12-31'
                          dum_version: all
                        result: 8537
                      -
                        extractor_name: number_of_users_dumping_dum
                        extractor_arguments:
                          period: '0001-01-01 - 9999-12-31'
                          dum_version: all
                        result: 530
                      -
                        extractor_name: average_number_of_user_dum_dumps
                        extractor_arguments:
                          period: '0001-01-01 - 9999-12-31'
                          dum_version: all
                        result: 16.107547169811
                    items:
                      type: object
                  file:
                    type: string
                    example: blade_data_2025-10-05_12-07-07_09.json
      tags:
        - 'BLADE data'
  '/api/charts/grip/{deviceId}':
    get:
      summary: 'Get chart breakdown'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: 'Success response'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                example:
                  -
                    group_by: '1'
                    device_id: '66'
                    grip: '1'
                    instances: '158'
                    time: '62050'
                    percentage: '31.3492'
                    goal: '158'
                  -
                    group_by: '2'
                    device_id: '66'
                    grip: '2'
                    instances: '44'
                    time: '2524'
                    percentage: '8.7302'
                    goal: '44'
                  -
                    group_by: '3'
                    device_id: '66'
                    grip: '3'
                    instances: '6'
                    time: '24'
                    percentage: '1.1905'
                    goal: '6'
                  -
                    group_by: '4'
                    device_id: '66'
                    grip: '4'
                    instances: '44'
                    time: '8234'
                    percentage: '8.7302'
                    goal: '44'
                  -
                    group_by: '6'
                    device_id: '66'
                    grip: '6'
                    instances: '164'
                    time: '134904'
                    percentage: '32.5397'
                    goal: '164'
                  -
                    group_by: '7'
                    device_id: '66'
                    grip: '7'
                    instances: '52'
                    time: '8760'
                    percentage: '10.3175'
                    goal: '52'
                  -
                    group_by: '8'
                    device_id: '66'
                    grip: '8'
                    instances: '14'
                    time: '160'
                    percentage: '2.7778'
                    goal: '14'
                  -
                    group_by: '9'
                    device_id: '66'
                    grip: '9'
                    instances: '22'
                    time: '11746'
                    percentage: '4.3651'
                    goal: '22'
      tags:
        - Charts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                date_from:
                  type: string
                  description: 'Start date for data fetching. Default: current date. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2023-05-01'
                date_to:
                  type: string
                  description: 'End date for data fetching. Default: current date. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>. Must be a date after or equal to <code>date_from</code>.'
                  example: '2023-05-10'
                group:
                  type: string
                  description: 'Thanks to grouping, you can divide the results into a type of grip or a period of time. Must be one of <code>hourly</code>, <code>day</code>, <code>week</code>, <code>month</code>, or <code>grip</code>.'
                  example: grip
                grips:
                  type: array
                  description: 'Select specified grips to display in chart.'
                  example:
                    - 1
                    - 2
                    - 5
                  items:
                    type: string
              required:
                - date_from
    parameters:
      -
        in: path
        name: deviceId
        description: 'Device Id'
        example: 1
        required: true
        schema:
          type: integer
  '/api/charts/grip-count/{deviceId}':
    get:
      summary: 'Get chart grasp count'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: 'Success response'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                example:
                  -
                    group_by: '1'
                    device_id: '75'
                    grip: '1'
                    instances: '324'
                    percentage: '36.7764'
                    goal: '9'
                  -
                    group_by: '2'
                    device_id: '75'
                    grip: '2'
                    instances: '6'
                    percentage: '0.6810'
                    goal: '3'
                  -
                    group_by: '3'
                    device_id: '75'
                    grip: '3'
                    instances: '11'
                    percentage: '1.2486'
                    goal: '2'
                  -
                    group_by: '6'
                    device_id: '75'
                    grip: '6'
                    instances: '374'
                    percentage: '42.4518'
                    goal: '9'
                  -
                    group_by: '7'
                    device_id: '75'
                    grip: '7'
                    instances: '24'
                    percentage: '2.7242'
                    goal: '6'
                  -
                    group_by: '8'
                    device_id: '75'
                    grip: '8'
                    instances: '1'
                    percentage: '0.1135'
                    goal: '1'
                  -
                    group_by: '12'
                    device_id: '75'
                    grip: '12'
                    instances: '141'
                    percentage: '16.0045'
                    goal: '5'
      tags:
        - Charts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                date_from:
                  type: string
                  description: 'Start date for data fetching. Default: current date. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2023-05-01'
                date_to:
                  type: string
                  description: 'End date for data fetching. Default: current date. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>. Must be a date after or equal to <code>date_from</code>.'
                  example: '2023-05-10'
                group:
                  type: string
                  description: 'Thanks to grouping, you can divide the results into a type of grip or a period of time. Must be one of <code>hourly</code>, <code>day</code>, <code>week</code>, <code>month</code>, or <code>grip</code>.'
                  example: grip
                grips:
                  type: array
                  description: 'Select specified grips to display in chart.'
                  example:
                    - 1
                    - 2
                    - 5
                  items:
                    type: string
              required:
                - date_from
    parameters:
      -
        in: path
        name: deviceId
        description: 'Device Id'
        example: 12
        required: true
        schema:
          type: integer
  '/api/charts/emg-peak/{deviceId}':
    get:
      summary: 'Get emg peak chart data'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: 'Success response day'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                example:
                  -
                    device_id: 1
                    period: day
                    datetime_interval: '2022-07-27 15:00'
                    count: '304'
                  -
                    device_id: 1
                    period: day
                    datetime_interval: '2022-07-27 15:15'
                    count: '2032'
                  -
                    device_id: 1
                    period: day
                    datetime_interval: '2022-07-27 15:30'
                    count: '2296'
                  -
                    device_id: 1
                    period: day
                    datetime_interval: '2022-07-27 15:45'
                    count: '2544'
      tags:
        - Charts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                period:
                  type: string
                  description: 'The range over which the data will be grouped into charts. Must be one of <code>day</code>, <code>month</code>, or <code>all</code>.'
                  example: day
                date_from:
                  type: string
                  description: 'Start date for data fetching. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2023-05-01'
                date_to:
                  type: string
                  description: 'End date for data fetching. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>. Must be a date after or equal to <code>date_from</code>.'
                  example: '2023-05-10'
              required:
                - period
                - date_from
    parameters:
      -
        in: path
        name: deviceId
        description: 'Device Id'
        example: 1
        required: true
        schema:
          type: integer
  '/api/charts/velocity-level/{deviceId}':
    get:
      summary: 'Get chart velocity level data'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: 'Success response'
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                example:
                  -
                    group_by: '15'
                    device_id: 1016
                    grip: 1
                    velocity_open_1: '127'
                    velocity_open_2: '127'
                    velocity_open_3: '0'
                    velocity_close_1: '508'
                    velocity_close_2: '0'
                    velocity_close_3: '0'
                  -
                    group_by: '15'
                    device_id: 1016
                    grip: 2
                    velocity_open_1: '3683'
                    velocity_open_2: '4826'
                    velocity_open_3: '5334'
                    velocity_close_1: '32131'
                    velocity_close_2: '2159'
                    velocity_close_3: '4445'
                  -
                    group_by: '15'
                    device_id: 1016
                    grip: 6
                    velocity_open_1: '4064'
                    velocity_open_2: '4572'
                    velocity_open_3: '6858'
                    velocity_close_1: '27178'
                    velocity_close_2: '1270'
                    velocity_close_3: '1651'
                  -
                    group_by: '15'
                    device_id: 1016
                    grip: 7
                    velocity_open_1: '254'
                    velocity_open_2: '889'
                    velocity_open_3: '0'
                    velocity_close_1: '1651'
                    velocity_close_2: '127'
                    velocity_close_3: '0'
      tags:
        - Charts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                date_from:
                  type: string
                  description: 'Start date for data fetching. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2023-05-01'
                date_to:
                  type: string
                  description: 'End date for data fetching. Default: current date. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>. Must be a date after or equal to <code>date_from</code>.'
                  example: '2023-05-10'
                group:
                  type: string
                  description: 'Thanks to grouping, you can divide the results into a type of grip or a period of time. Default: none. Must be one of <code>hourly</code>, <code>day</code>, <code>week</code>, <code>month</code>, <code>grip</code>, or <code>none</code>.'
                  example: grip
                grips:
                  type: array
                  description: 'Select specified grips to display in chart.'
                  example:
                    - 1
                    - 2
                    - 5
                  items:
                    type: string
              required:
                - date_from
    parameters:
      -
        in: path
        name: deviceId
        description: 'Device Id'
        example: 16
        required: true
        schema:
          type: integer
  '/api/charts/time-spent/{deviceId}':
    get:
      summary: 'Get chart active and passive time spent'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: 'Success response for all data'
          content:
            application/json:
              schema:
                type: object
                example:
                  passive_time: 38600
                  active_time: 1000
                  percentage_passive_time: 97.47
                  percentage_active_time: 2.52
                  group_by: none
                properties:
                  passive_time:
                    type: integer
                    example: 38600
                  active_time:
                    type: integer
                    example: 1000
                  percentage_passive_time:
                    type: number
                    example: 97.47
                  percentage_active_time:
                    type: number
                    example: 2.52
                  group_by:
                    type: string
                    example: none
      tags:
        - Charts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                date_from:
                  type: string
                  description: 'The start date for the data range. Should be in <code>YYYY-MM-DD</code> format. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>.'
                  example: '2023-05-01'
                date_to:
                  type: string
                  description: 'The end date for the data range and must be the same as or after the <code>date_from</code>. Should be in <code>YYYY-MM-DD</code> format. Must be a valid date. Must be a valid date in the format <code>Y-m-d</code>. Must be a date after or equal to <code>date_from</code>. Must be a date before or equal to <code>now</code>.'
                  example: '2023-05-10'
                group:
                  type: string
                  description: 'The category or classification of the data. Allowed values are <code>day</code> or <code>none</code>. Must be one of <code>day</code> or <code>none</code>.'
                  example: day
              required:
                - date_from
    parameters:
      -
        in: path
        name: deviceId
        description: 'Device Id'
        example: 13
        required: true
        schema:
          type: integer
  /api/clean-data/emg-peaks:
    post:
      summary: 'Save EMG peak'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"sensor\": 0, \"emg_peak\": 92, \"datetime\": \"2022-05-30 12:00:00\"},\n        {\"sensor\": 1, \"emg_peak\": 50, \"datetime\": \"2022-05-30 12:00:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      sensor:
                        type: integer
                        description: 'Sensor number.'
                        example: 1
                      emg_peak:
                        type: integer
                        description: 'EMG peak value.'
                        example: 92
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - sensor
                      - emg_peak
                      - datetime
              required:
                - device_id
  /api/clean-data/grasp-count:
    post:
      summary: 'Save grasp count'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"grip\": 1, \"grasp_count\": 5, \"datetime\": \"2022-05-30 12:00:00\"},\n        {\"grip\": 2, \"grasp_count\": 30, \"datetime\": \"2022-05-30 12:00:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      grip:
                        type: integer
                        description: Grip.
                        example: 1
                      grasp_count:
                        type: integer
                        description: 'Grasp count.'
                        example: 5
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - grip
                      - grasp_count
                      - datetime
              required:
                - device_id
  /api/clean-data/grip-switches:
    post:
      summary: 'Save grip switches'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\n            \"switched_from_grip\": 1,\n            \"n_switches_to_1\": 1,\n            \"n_switches_to_2\": 0,\n            \"n_switches_to_3\": 0,\n            \"n_switches_to_4\": 0,\n            \"n_switches_to_5\": 1,\n            \"n_switches_to_6\": 0,\n            \"n_switches_to_7\": 3,\n            \"n_switches_to_8\": 1,\n            \"n_switches_to_9\": 1,\n            \"datetime\": \"2022-05-30 00:00:00\"\n        },\n        {\n            \"switched_from_grip\": 2,\n            \"n_switches_to_1\": 1,\n            \"n_switches_to_2\": 0,\n            \"n_switches_to_3\": 0,\n            \"n_switches_to_4\": 11,\n            \"n_switches_to_5\": 1,\n            \"n_switches_to_6\": 5,\n            \"n_switches_to_7\": 3,\n            \"n_switches_to_8\": 1,\n            \"n_switches_to_9\": 1,\n            \"datetime\": \"2022-05-30 00:00:00\"\n        },\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      switched_from_grip:
                        type: integer
                        description: 'Previous grip.'
                        example: 1
                      n_switches_to_1:
                        type: integer
                        description: 'Number of switches to grip 1.'
                        example: 1
                      n_switches_to_2:
                        type: integer
                        description: 'Number of switches to grip 2.'
                        example: 1
                      n_switches_to_3:
                        type: integer
                        description: 'umber of switches to grip 3.'
                        example: 1
                      n_switches_to_4:
                        type: integer
                        description: 'Number of switches to grip 4.'
                        example: 1
                      n_switches_to_5:
                        type: integer
                        description: 'Number of switches to grip 5.'
                        example: 1
                      n_switches_to_6:
                        type: integer
                        description: 'Number of switches to grip 6.'
                        example: 1
                      n_switches_to_7:
                        type: integer
                        description: 'Number of switches to grip 7.'
                        example: 1
                      n_switches_to_8:
                        type: integer
                        description: 'Number of switches to grip 8.'
                        example: 1
                      n_switches_to_9:
                        type: integer
                        description: 'Number of switches to grip 9.'
                        example: 1
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - switched_from_grip
                      - n_switches_to_1
                      - n_switches_to_2
                      - n_switches_to_3
                      - n_switches_to_4
                      - n_switches_to_5
                      - n_switches_to_6
                      - n_switches_to_7
                      - n_switches_to_8
                      - n_switches_to_9
                      - datetime
              required:
                - device_id
  /api/clean-data/grip-transitions:
    post:
      summary: 'Save grip transitions'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"grip\": 1, \"time_spent\": \"26.5\", \"datetime\": \"2022-05-30 12:00:00\"},\n        {\"grip\": 7, \"time_spent\": \"15.0\", \"datetime\": \"2022-05-30 12:23:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      grip:
                        type: integer
                        description: Grip.
                        example: 1
                      time_spent:
                        type: number
                        description: 'Time spent in seconds.'
                        example: 100.0
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - grip
                      - time_spent
                      - datetime
              required:
                - device_id
  /api/clean-data/motor-currents:
    post:
      summary: 'Save motor currents'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"avg_current_motor_1\": 220, \"avg_current_motor_2\": 199, \"avg_current_motor_3\": 185, \"avg_current_motor_4\": 195, \"avg_current_motor_5\": 201, \"datetime\": \"2022-05-30 12:00:00\"},\n        {\"avg_current_motor_1\": 201, \"avg_current_motor_2\": 195, \"avg_current_motor_3\": 220, \"avg_current_motor_4\": 185, \"avg_current_motor_5\": 199, \"datetime\": \"2022-05-30 13:00:00\"}\n    ]\n}\n</pre></code>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      avg_current_motor_1:
                        type: integer
                        description: 'Motor 1 average current.'
                        example: 220
                      avg_current_motor_2:
                        type: integer
                        description: 'Motor 2 average current.'
                        example: 220
                      avg_current_motor_3:
                        type: integer
                        description: 'Motor 3 average current.'
                        example: 220
                      avg_current_motor_4:
                        type: integer
                        description: 'Motor 4 average current.'
                        example: 220
                      avg_current_motor_5:
                        type: integer
                        description: 'Motor 5 average current.'
                        example: 220
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - avg_current_motor_1
                      - avg_current_motor_2
                      - avg_current_motor_3
                      - avg_current_motor_4
                      - avg_current_motor_5
                      - datetime
              required:
                - device_id
  /api/clean-data/oc-cycles:
    post:
      summary: 'Save open close cycles'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n       {\"grip_type\": 1, \"n_open_cycles\": 10, \"n_close_cycles\": 8, \"datetime\": \"2022-05-30 12:00:00\"},\n       {\"grip_type\": 5, \"n_open_cycles\": 15, \"n_close_cycles\": 18, \"datetime\": \"2022-05-30 12:00:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      grip_type:
                        type: integer
                        description: Grip.
                        example: 1
                      n_open_cycles:
                        type: integer
                        description: 'Number of open cycles.'
                        example: 10
                      n_close_cycles:
                        type: integer
                        description: 'Number of close cycles.'
                        example: 8
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - grip_type
                      - n_open_cycles
                      - n_close_cycles
                      - datetime
              required:
                - device_id
  /api/clean-data/stall-times:
    post:
      summary: 'Save stall times'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"stall_time_motor_1\": 10, \"stall_time_motor_2\": 10, \"stall_time_motor_3\": 10, \"stall_time_motor_4\": 10, \"stall_time_motor_5\": 10, \"datetime\": \"2022-05-30 12:00:00\"},\n        {\"stall_time_motor_1\": 10, \"stall_time_motor_2\": 10, \"stall_time_motor_3\": 10, \"stall_time_motor_4\": 10, \"stall_time_motor_5\": 10, \"datetime\": \"2022-05-30 13:00:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      stall_time_motor_1:
                        type: integer
                        description: 'Motor 1 stall time.'
                        example: 10
                      stall_time_motor_2:
                        type: integer
                        description: 'Motor 2 stall time.'
                        example: 10
                      stall_time_motor_3:
                        type: integer
                        description: 'Motor 3 stall time.'
                        example: 10
                      stall_time_motor_4:
                        type: integer
                        description: 'Motor 4 stall time.'
                        example: 10
                      stall_time_motor_5:
                        type: integer
                        description: 'Motor 5 stall time.'
                        example: 10
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - stall_time_motor_1
                      - stall_time_motor_2
                      - stall_time_motor_3
                      - stall_time_motor_4
                      - stall_time_motor_5
                      - datetime
              required:
                - device_id
  /api/clean-data/velocity-levels:
    post:
      summary: 'Save velocity levels'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\n            \"grip\": 1,\n            \"t_open_velocity_1\": 1024, \"t_open_velocity_2\": 256, \"t_open_velocity_3\": 0,\n            \"t_close_velocity_1\": 1024, \"t_close_velocity_2\": 256, \"t_close_velocity_3\": 0,\n            \"t_powermode\": 35, \"datetime\": \"2022-05-30 12:00:00\"\n        },\n        {\n            \"grip\": 2,\n            \"t_open_velocity_1\": 1024, \"t_open_velocity_2\": 256, \"t_open_velocity_3\": 0,\n            \"t_close_velocity_1\": 1024, \"t_close_velocity_2\": 256, \"t_close_velocity_3\": 0,\n            \"t_powermode\": 35, \"datetime\": \"2022-05-30 12:00:00\"\n        }\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      grip:
                        type: integer
                        description: Grip.
                        example: 1
                      t_open_velocity_1:
                        type: integer
                        description: 'Open velocity 1 usage time.'
                        example: 1024
                      t_open_velocity_2:
                        type: integer
                        description: 'Open velocity 2 usage time.'
                        example: 768
                      t_open_velocity_3:
                        type: integer
                        description: 'Open velocity 3 usage time.'
                        example: 512
                      t_close_velocity_1:
                        type: integer
                        description: 'Close velocity 1 usage time.'
                        example: 1024
                      t_close_velocity_2:
                        type: integer
                        description: 'Close velocity 2 usage time.'
                        example: 512
                      t_close_velocity_3:
                        type: integer
                        description: 'Close velocity 3 usage time.'
                        example: 256
                      t_powermode:
                        type: integer
                        description: 'Power mode.'
                        example: 35
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - grip
                      - t_open_velocity_1
                      - t_open_velocity_2
                      - t_open_velocity_3
                      - t_close_velocity_1
                      - t_close_velocity_2
                      - t_close_velocity_3
                      - t_powermode
                      - datetime
              required:
                - device_id
  /api/clean-data/errors:
    post:
      summary: 'Save data errors'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"error_code\": 256, \"datetime\": \"2022-05-30 12:00:00\"},\n        {\"error_code\": 30, \"datetime\": \"2022-05-30 13:00:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      error_code:
                        type: integer
                        description: 'Error code.'
                        example: 256
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - error_code
                      - datetime
              required:
                - device_id
  /api/clean-data/active-time:
    post:
      summary: 'Save active time'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"active_time\": 7, \"datetime\": \"2022-06-30 12:00:00\"},\n        {\"active_time\": 30, \"datetime\": \"2022-06-30 12:23:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      active_time:
                        type: integer
                        description: 'Active time in seconds.'
                        example: 30
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-06-30 12:00:00'
                    required:
                      - active_time
                      - datetime
              required:
                - device_id
  /api/clean-data/power:
    post:
      summary: 'Save power ups/downs'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"power\": 1, \"datetime\": \"2022-06-30 12:00:00\"},\n        {\"power\": 0, \"datetime\": \"2022-06-30 12:30:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      power:
                        type: integer
                        description: 'Device turn on/off status (0 - turn off, 1 - turn on). Must be one of <code>0</code> or <code>1</code>.'
                        example: 1
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-06-30 12:00:00'
                    required:
                      - power
                      - datetime
              required:
                - device_id
  /api/clean-data/wear-time:
    post:
      summary: 'Save wear time'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"wear_time\": 112, \"datetime\": \"2024-04-12 12:00:00\"},\n        {\"wear_time\": 212, \"datetime\": \"2024-04-13 12:00:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      wear_time:
                        type: integer
                        description: 'Wear time in seconds.'
                        example: 30
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-06-30 12:00:00'
                    required:
                      - wear_time
                      - datetime
              required:
                - device_id
  /api/clean-data/grip-transitions/v2:
    post:
      summary: 'Save grip transitions (V2)'
      description: "Request body should look like:\n<pre style=\"float: none; clear: none\"><code>\n{\n    \"device_id\": 1,\n    \"data\": [\n        {\"grip\": 1, \"transitions\": 50, \"time_spent\": \"26.5\", \"datetime\": \"2022-05-30 12:00:00\"},\n        {\"grip\": 7, \"transitions\": 30, \"time_spent\": \"15.0\", \"datetime\": \"2022-05-30 12:23:00\"}\n    ]\n}\n</code></pre>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        201:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Saved 100 entries'
                properties:
                  message:
                    type: string
                    example: 'Saved 100 entries'
      tags:
        - 'Clean data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                data:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      grip:
                        type: integer
                        description: Grip.
                        example: 1
                      transitions:
                        type: integer
                        description: 'Number of grip transitions per hour.'
                        example: 30
                      time_spent:
                        type: number
                        description: 'Time spent in seconds.'
                        example: 100.0
                      datetime:
                        type: string
                        description: 'Entry datetime. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                        example: '2022-05-30 12:00:00'
                    required:
                      - grip
                      - transitions
                      - time_spent
                      - datetime
              required:
                - device_id
  '/api/clean-data/grip-transition/v2/{id}':
    get:
      summary: 'Get latest grip transition (V2)'
      description: "<aside>Note: Response code 403 (\"Insufficient permission\") means that the device is not accessible by the current user\nfor one of two reasons: it is not assigned to the user or does not exist at all.</aside>"
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 36024
                  device_id: 132
                  grip: 7
                  transitions: 874
                  time_spent: 177.2
                  datetime: '2006-03-24T12:13:24.000000Z'
                properties:
                  id:
                    type: integer
                    example: 36024
                  device_id:
                    type: integer
                    example: 132
                  grip:
                    type: integer
                    example: 7
                  transitions:
                    type: integer
                    example: 874
                  time_spent:
                    type: number
                    example: 177.2
                  datetime:
                    type: string
                    example: '2006-03-24T12:13:24.000000Z'
        403:
          description: 'Insufficient permission'
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Insufficient permission'
                properties:
                  message:
                    type: string
                    example: 'Insufficient permission'
        404:
          description: 'No grip transitions for given device'
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No grip transitions (V2) for given device'
                properties:
                  message:
                    type: string
                    example: 'No grip transitions (V2) for given device'
      tags:
        - 'Clean data'
    parameters:
      -
        in: path
        name: id
        description: 'Device ID'
        example: 18
        required: true
        schema:
          type: integer
  /api/broadcasting/auth:
    get:
      summary: 'Authenticate the request for channel access.'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6Ii1JRElSdy42bGVMeUEifQ.eyJpYXQiOjE3NTU3OTE4NTcsImV4cCI6MTc1NTgyMDY1NywieC1hYmx5LWNsaWVudElkIjpudWxsLCJ4LWFibHktY2FwYWJpbGl0eSI6IntcInB1YmxpYzoqXCI6W1wic3Vic2NyaWJlXCIsXCJoaXN0b3J5XCIsXCJjaGFubmVsLW1ldGFkYXRhXCJdfSJ9.Eh_x8EXXy6pGwNB1M4cmjaRoB3-uTdJYVBMChTQuOE8
                properties:
                  token:
                    type: string
                    example: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6Ii1JRElSdy42bGVMeUEifQ.eyJpYXQiOjE3NTU3OTE4NTcsImV4cCI6MTc1NTgyMDY1NywieC1hYmx5LWNsaWVudElkIjpudWxsLCJ4LWFibHktY2FwYWJpbGl0eSI6IntcInB1YmxpYzoqXCI6W1wic3Vic2NyaWJlXCIsXCJoaXN0b3J5XCIsXCJjaGFubmVsLW1ldGFkYXRhXCJdfSJ9.Eh_x8EXXy6pGwNB1M4cmjaRoB3-uTdJYVBMChTQuOE8
      tags:
        - Endpoints
  /api/goals/status:
    get:
      summary: 'Get goals status'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  grips: []
                  switches: []
                  total:
                    grips: 0
                    switches: 0
                    time: 0
                properties:
                  grips:
                    type: array
                    example: []
                  switches:
                    type: array
                    example: []
                  total:
                    type: object
                    example:
                      grips: 0
                      switches: 0
                      time: 0
      tags:
        - Goals
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                devices:
                  type: array
                  description: 'Device ID.'
                  example:
                    - 1
                  items:
                    type: integer
                date_from:
                  type: string
                  description: 'Start date for data fetching. Default: current date. Must be a valid date.'
                  example: '2023-05-01'
                date_to:
                  type: string
                  description: 'End date for data fetching. Default: current date. Must be a valid date. Must be a date after or equal to <code>date_from</code>.'
                  example: '2023-05-10'
  /api/raw-data:
    post:
      summary: 'Send raw file'
      description: 'Save raw file with DUM data to process later'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: multipart/form-data
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 15885
                  device_id: 534
                  file: /tmp/fakerjg1ZLt
                  status: 0
                  is_corrupted: 0
                  version: null
                  type: fetching
                  platform: android
                  upload_date: '1986-05-26 15:05:36'
                  created_at: '2025-08-21T15:57:37.000000Z'
                  updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 15885
                  device_id:
                    type: integer
                    example: 534
                  file:
                    type: string
                    example: /tmp/fakerjg1ZLt
                  status:
                    type: integer
                    example: 0
                  is_corrupted:
                    type: integer
                    example: 0
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: fetching
                  platform:
                    type: string
                    example: android
                  upload_date:
                    type: string
                    example: '1986-05-26 15:05:36'
                  created_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
                  updated_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
      tags:
        - 'Raw data'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                file:
                  type: string
                  format: binary
                  description: 'Raw file to upload. Must be a file. Must not be greater than 10240 kilobytes.'
                type:
                  type: string
                  description: 'Raw file type. Must be one of <code>fetching</code>, <code>background</code>, or <code>manual</code>.'
                  example: fetching
                platform:
                  type: string
                  description: 'Raw file origin platform. Must be one of <code>ios</code> or <code>android</code>.'
                  example: ios
                upload_date:
                  type: string
                  description: 'Date and time of raw file upload. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                  example: '1979-08-04 21:51:24'
              required:
                - device_id
                - file
                - type
                - upload_date
    get:
      summary: 'Download raw file'
      description: 'Download raw file with DUM data to process. Once fetched data is marked as processed and will not be available on this endpoint anymore.'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 15886
                  device_id: 64
                  file: /tmp/faker1NaPBl
                  status: 0
                  is_corrupted: 0
                  version: null
                  type: background
                  platform: android
                  upload_date: '2008-11-26 20:39:48'
                  created_at: '2025-08-21T15:57:37.000000Z'
                  updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 15886
                  device_id:
                    type: integer
                    example: 64
                  file:
                    type: string
                    example: /tmp/faker1NaPBl
                  status:
                    type: integer
                    example: 0
                  is_corrupted:
                    type: integer
                    example: 0
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: background
                  platform:
                    type: string
                    example: android
                  upload_date:
                    type: string
                    example: '2008-11-26 20:39:48'
                  created_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
                  updated_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
        404:
          description: 'No data to process'
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No data to process'
                properties:
                  message:
                    type: string
                    example: 'No data to process'
      tags:
        - 'Raw data'
  /api/raw-files:
    get:
      summary: 'Show all raw files'
      description: ''
      parameters:
        -
          in: query
          name: order
          description: "Order elements by date in given direction (<code>asc</code> or <code>desc</code>).\nBy default, results are sorted from oldest (<code>asc</code>)."
          example: asc
          required: false
          schema:
            type: string
            description: "Order elements by date in given direction (<code>asc</code> or <code>desc</code>).\nBy default, results are sorted from oldest (<code>asc</code>)."
            example: asc
        -
          in: query
          name: perpage
          description: 'Elements per page (Default: 20).'
          example: 20
          required: false
          schema:
            type: integer
            description: 'Elements per page (Default: 20).'
            example: 20
        -
          in: query
          name: page
          description: 'Page number (Default: 1).'
          example: 1
          required: false
          schema:
            type: integer
            description: 'Page number (Default: 1).'
            example: 1
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  paginator:
                    total: 2
                    count: 2
                    perpage: 20
                    current_page: 1
                    last_page: 1
                  items:
                    -
                      id: 15887
                      device_id: 369
                      file: /tmp/fakerNg0hAR
                      status: 0
                      is_corrupted: 0
                      version: null
                      type: manual
                      platform: ios
                      upload_date: '2023-03-27 13:19:48'
                      created_at: '2025-08-21T15:57:37.000000Z'
                      updated_at: '2025-08-21T15:57:37.000000Z'
                    -
                      id: 15888
                      device_id: 309
                      file: /tmp/fakersVIbZD
                      status: 0
                      is_corrupted: 0
                      version: null
                      type: background
                      platform: ios
                      upload_date: '1991-01-09 00:28:17'
                      created_at: '2025-08-21T15:57:37.000000Z'
                      updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  paginator:
                    type: object
                    example:
                      total: 2
                      count: 2
                      perpage: 20
                      current_page: 1
                      last_page: 1
                  items:
                    type: array
                    example:
                      -
                        id: 15887
                        device_id: 369
                        file: /tmp/fakerNg0hAR
                        status: 0
                        is_corrupted: 0
                        version: null
                        type: manual
                        platform: ios
                        upload_date: '2023-03-27 13:19:48'
                        created_at: '2025-08-21T15:57:37.000000Z'
                        updated_at: '2025-08-21T15:57:37.000000Z'
                      -
                        id: 15888
                        device_id: 309
                        file: /tmp/fakersVIbZD
                        status: 0
                        is_corrupted: 0
                        version: null
                        type: background
                        platform: ios
                        upload_date: '1991-01-09 00:28:17'
                        created_at: '2025-08-21T15:57:37.000000Z'
                        updated_at: '2025-08-21T15:57:37.000000Z'
                    items:
                      type: object
      tags:
        - 'Raw data'
  '/api/raw-file/{id}':
    post:
      summary: 'Update raw file information'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 15891
                  device_id: 117
                  file: /tmp/fakerAMPChN
                  status: 0
                  is_corrupted: 0
                  version: null
                  type: background
                  platform: android
                  upload_date: '2015-01-13 23:38:40'
                  created_at: '2025-08-21T15:57:37.000000Z'
                  updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 15891
                  device_id:
                    type: integer
                    example: 117
                  file:
                    type: string
                    example: /tmp/fakerAMPChN
                  status:
                    type: integer
                    example: 0
                  is_corrupted:
                    type: integer
                    example: 0
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: background
                  platform:
                    type: string
                    example: android
                  upload_date:
                    type: string
                    example: '2015-01-13 23:38:40'
                  created_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
                  updated_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
        404:
          description: 'File not found'
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'File not found'
                properties:
                  message:
                    type: string
                    example: 'File not found'
      tags:
        - 'Raw data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_corrupted:
                  type: integer
                  description: 'File is corrupted. Must be one of <code>0</code> or <code>1</code>.'
                  example: 0
                version:
                  type: string
                  description: 'Release version on which file was converted (for example: release/1.6.0).'
                  example: release/1.6.0
              required:
                - is_corrupted
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the raw file.'
        example: 1
        required: true
        schema:
          type: integer
  /api/raw-data/v2:
    post:
      summary: 'Send raw file (V2)'
      description: 'Save raw file with DUM data to process later'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: multipart/form-data
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 8028
                  device_id: 379
                  file: /tmp/fakerz5g3Dz
                  status: 0
                  is_corrupted: 0
                  version: null
                  type: manual
                  platform: android
                  upload_date: '1980-06-14 06:06:05'
                  created_at: '2025-08-21T15:57:37.000000Z'
                  updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 8028
                  device_id:
                    type: integer
                    example: 379
                  file:
                    type: string
                    example: /tmp/fakerz5g3Dz
                  status:
                    type: integer
                    example: 0
                  is_corrupted:
                    type: integer
                    example: 0
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: manual
                  platform:
                    type: string
                    example: android
                  upload_date:
                    type: string
                    example: '1980-06-14 06:06:05'
                  created_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
                  updated_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
      tags:
        - 'Raw data'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                device_id:
                  type: integer
                  description: 'Device ID. Must be at least 1.'
                  example: 1
                file:
                  type: string
                  format: binary
                  description: 'Raw file to upload. Must be a file. Must not be greater than 10240 kilobytes.'
                type:
                  type: string
                  description: 'Raw file type. Must be one of <code>fetching</code>, <code>background</code>, or <code>manual</code>.'
                  example: fetching
                platform:
                  type: string
                  description: 'Raw file origin platform. Must be one of <code>ios</code> or <code>android</code>.'
                  example: ios
                upload_date:
                  type: string
                  description: 'Date and time of raw file upload. Must be a valid date in the format <code>Y-m-d H:i:s</code>.'
                  example: '1986-05-08 05:32:15'
              required:
                - device_id
                - file
                - type
                - upload_date
    get:
      summary: 'Download raw file (V2)'
      description: 'Download raw file with DUM data to process. Once fetched data is marked as processed and will not be available on this endpoint anymore.'
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 8029
                  device_id: 793
                  file: /tmp/fakerAOiv4n
                  status: 0
                  is_corrupted: 0
                  version: null
                  type: background
                  platform: ios
                  upload_date: '1973-03-27 15:23:33'
                  created_at: '2025-08-21T15:57:37.000000Z'
                  updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 8029
                  device_id:
                    type: integer
                    example: 793
                  file:
                    type: string
                    example: /tmp/fakerAOiv4n
                  status:
                    type: integer
                    example: 0
                  is_corrupted:
                    type: integer
                    example: 0
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: background
                  platform:
                    type: string
                    example: ios
                  upload_date:
                    type: string
                    example: '1973-03-27 15:23:33'
                  created_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
                  updated_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
        404:
          description: 'No data to process'
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'No data to process'
                properties:
                  message:
                    type: string
                    example: 'No data to process'
      tags:
        - 'Raw data'
  /api/raw-files/v2:
    get:
      summary: 'Show all raw files (V2)'
      description: ''
      parameters:
        -
          in: query
          name: order
          description: "Order elements by date in given direction (<code>asc</code> or <code>desc</code>).\nBy default, results are sorted from oldest (<code>asc</code>)."
          example: asc
          required: false
          schema:
            type: string
            description: "Order elements by date in given direction (<code>asc</code> or <code>desc</code>).\nBy default, results are sorted from oldest (<code>asc</code>)."
            example: asc
        -
          in: query
          name: perpage
          description: 'Elements per page (Default: 20).'
          example: 20
          required: false
          schema:
            type: integer
            description: 'Elements per page (Default: 20).'
            example: 20
        -
          in: query
          name: page
          description: 'Page number (Default: 1).'
          example: 1
          required: false
          schema:
            type: integer
            description: 'Page number (Default: 1).'
            example: 1
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  paginator:
                    total: 2
                    count: 2
                    perpage: 20
                    current_page: 1
                    last_page: 1
                  items:
                    -
                      id: 8030
                      device_id: 370
                      file: /tmp/fakerSOxW7q
                      status: 0
                      is_corrupted: 0
                      version: null
                      type: background
                      platform: ios
                      upload_date: '1993-07-13 09:57:03'
                      created_at: '2025-08-21T15:57:37.000000Z'
                      updated_at: '2025-08-21T15:57:37.000000Z'
                    -
                      id: 8031
                      device_id: 557
                      file: /tmp/fakerVDdUvk
                      status: 0
                      is_corrupted: 0
                      version: null
                      type: manual
                      platform: ios
                      upload_date: '1986-06-15 08:24:09'
                      created_at: '2025-08-21T15:57:37.000000Z'
                      updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  paginator:
                    type: object
                    example:
                      total: 2
                      count: 2
                      perpage: 20
                      current_page: 1
                      last_page: 1
                  items:
                    type: array
                    example:
                      -
                        id: 8030
                        device_id: 370
                        file: /tmp/fakerSOxW7q
                        status: 0
                        is_corrupted: 0
                        version: null
                        type: background
                        platform: ios
                        upload_date: '1993-07-13 09:57:03'
                        created_at: '2025-08-21T15:57:37.000000Z'
                        updated_at: '2025-08-21T15:57:37.000000Z'
                      -
                        id: 8031
                        device_id: 557
                        file: /tmp/fakerVDdUvk
                        status: 0
                        is_corrupted: 0
                        version: null
                        type: manual
                        platform: ios
                        upload_date: '1986-06-15 08:24:09'
                        created_at: '2025-08-21T15:57:37.000000Z'
                        updated_at: '2025-08-21T15:57:37.000000Z'
                    items:
                      type: object
      tags:
        - 'Raw data'
  '/api/raw-file/v2/{id}':
    post:
      summary: 'Update raw file information (V2)'
      description: ''
      parameters:
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 8032
                  device_id: 311
                  file: /tmp/fakerBQT4AY
                  status: 0
                  is_corrupted: 0
                  version: null
                  type: background
                  platform: android
                  upload_date: '2001-01-04 21:39:42'
                  created_at: '2025-08-21T15:57:37.000000Z'
                  updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 8032
                  device_id:
                    type: integer
                    example: 311
                  file:
                    type: string
                    example: /tmp/fakerBQT4AY
                  status:
                    type: integer
                    example: 0
                  is_corrupted:
                    type: integer
                    example: 0
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: background
                  platform:
                    type: string
                    example: android
                  upload_date:
                    type: string
                    example: '2001-01-04 21:39:42'
                  created_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
                  updated_at:
                    type: string
                    example: '2025-08-21T15:57:37.000000Z'
        404:
          description: 'File not found'
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'File not found'
                properties:
                  message:
                    type: string
                    example: 'File not found'
      tags:
        - 'Raw data'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_corrupted:
                  type: integer
                  description: 'File is corrupted. Must be one of <code>0</code> or <code>1</code>.'
                  example: 0
                version:
                  type: string
                  description: 'Release version on which file was converted (for example: release/1.6.0).'
                  example: release/1.6.0
              required:
                - is_corrupted
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the v2.'
        example: sed
        required: true
        schema:
          type: string
  '/api/raw-files/{deviceId}':
    get:
      summary: 'Get all raw files for device'
      description: ''
      parameters:
        -
          in: query
          name: order
          description: "Order elements by date in given direction (<code>asc</code> or <code>desc</code>).\nBy default, results are sorted from oldest (<code>asc</code>)."
          example: asc
          required: false
          schema:
            type: string
            description: "Order elements by date in given direction (<code>asc</code> or <code>desc</code>).\nBy default, results are sorted from oldest (<code>asc</code>)."
            example: asc
        -
          in: query
          name: perpage
          description: 'Elements per page (Default: 20).'
          example: 20
          required: false
          schema:
            type: integer
            description: 'Elements per page (Default: 20).'
            example: 20
        -
          in: query
          name: page
          description: 'Page number (Default: 1).'
          example: 1
          required: false
          schema:
            type: integer
            description: 'Page number (Default: 1).'
            example: 1
        -
          in: header
          name: Authorization
          description: ''
          example: 'Bearer {ACCESS_TOKEN}'
          schema:
            type: string
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: '0'
          content:
            application/json:
              schema:
                type: object
                example:
                  paginator:
                    total: 2
                    count: 2
                    perpage: 20
                    current_page: 1
                    last_page: 1
                  items:
                    -
                      id: 15889
                      device_id: 468
                      file: /tmp/fakerN1b3eE
                      status: 0
                      is_corrupted: 0
                      version: null
                      type: manual
                      platform: ios
                      upload_date: '2004-05-10 09:18:23'
                      created_at: '2025-08-21T15:57:37.000000Z'
                      updated_at: '2025-08-21T15:57:37.000000Z'
                    -
                      id: 15890
                      device_id: 685
                      file: /tmp/fakerF4eMty
                      status: 0
                      is_corrupted: 0
                      version: null
                      type: fetching
                      platform: android
                      upload_date: '2000-10-28 13:18:41'
                      created_at: '2025-08-21T15:57:37.000000Z'
                      updated_at: '2025-08-21T15:57:37.000000Z'
                properties:
                  paginator:
                    type: object
                    example:
                      total: 2
                      count: 2
                      perpage: 20
                      current_page: 1
                      last_page: 1
                  items:
                    type: array
                    example:
                      -
                        id: 15889
                        device_id: 468
                        file: /tmp/fakerN1b3eE
                        status: 0
                        is_corrupted: 0
                        version: null
                        type: manual
                        platform: ios
                        upload_date: '2004-05-10 09:18:23'
                        created_at: '2025-08-21T15:57:37.000000Z'
                        updated_at: '2025-08-21T15:57:37.000000Z'
                      -
                        id: 15890
                        device_id: 685
                        file: /tmp/fakerF4eMty
                        status: 0
                        is_corrupted: 0
                        version: null
                        type: fetching
                        platform: android
                        upload_date: '2000-10-28 13:18:41'
                        created_at: '2025-08-21T15:57:37.000000Z'
                        updated_at: '2025-08-21T15:57:37.000000Z'
                    items:
                      type: object
      tags:
        - 'Raw data'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Type of upload files. Allowed values are <code>fetching</code>, <code>background</code> or <code>manual</code>. Must be one of <code>fetching</code>, <code>background</code>, or <code>manual</code>.'
                  example: fetching
    parameters:
      -
        in: path
        name: deviceId
        description: ''
        example: 1
        required: true
        schema:
          type: integer
tags:
  -
    name: 'BLADE data'
    description: ''
  -
    name: Charts
    description: ''
  -
    name: 'Clean data'
    description: ''
  -
    name: Endpoints
    description: ''
  -
    name: Goals
    description: ''
  -
    name: 'Raw data'
    description: ''
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: ''
security:
  -
    default: []
