openapi: 3.0.3
info:
  title: 'Aether DUM API'
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://dum-staging.aetherdigitaltherapy.com'
paths:
  '/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: 2
        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: 8
        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: 9
        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: 4
        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: 19
        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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 3491
                  device_id: 774
                  grip: '8'
                  transitions: '162'
                  time_spent: '662.50'
                  datetime: '1995-04-25 00:55:02'
                properties:
                  id:
                    type: integer
                    example: 3491
                  device_id:
                    type: integer
                    example: 774
                  grip:
                    type: string
                    example: '8'
                  transitions:
                    type: string
                    example: '162'
                  time_spent:
                    type: string
                    example: '662.50'
                  datetime:
                    type: string
                    example: '1995-04-25 00:55:02'
        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: 16
        required: true
        schema:
          type: integer
  /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:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Unauthenticated (invalid token)'
                properties:
                  message:
                    type: string
                    example: 'Unauthenticated (invalid token)'
      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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 15606
                  device_id: 877
                  file: /tmp/fakernbOchp
                  status: '0'
                  is_corrupted: '0'
                  version: null
                  type: manual
                  upload_date: '1999-08-01 01:24:13'
                  created_at: '2024-12-13T13:37:37.000000Z'
                  updated_at: '2024-12-13T13:37:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 15606
                  device_id:
                    type: integer
                    example: 877
                  file:
                    type: string
                    example: /tmp/fakernbOchp
                  status:
                    type: string
                    example: '0'
                  is_corrupted:
                    type: string
                    example: '0'
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: manual
                  upload_date:
                    type: string
                    example: '1999-08-01 01:24:13'
                  created_at:
                    type: string
                    example: '2024-12-13T13:37:37.000000Z'
                  updated_at:
                    type: string
                    example: '2024-12-13T13:37: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: background
                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: '1971-01-09 21:30:06'
              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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 15607
                  device_id: 659
                  file: /tmp/fakerae2JR0
                  status: '0'
                  is_corrupted: '0'
                  version: null
                  type: manual
                  upload_date: '1972-12-22 10:49:44'
                  created_at: '2024-12-13T13:37:37.000000Z'
                  updated_at: '2024-12-13T13:37:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 15607
                  device_id:
                    type: integer
                    example: 659
                  file:
                    type: string
                    example: /tmp/fakerae2JR0
                  status:
                    type: string
                    example: '0'
                  is_corrupted:
                    type: string
                    example: '0'
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: manual
                  upload_date:
                    type: string
                    example: '1972-12-22 10:49:44'
                  created_at:
                    type: string
                    example: '2024-12-13T13:37:37.000000Z'
                  updated_at:
                    type: string
                    example: '2024-12-13T13:37: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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  paginator:
                    total: 2
                    count: 2
                    perpage: 20
                    current_page: 1
                    last_page: 1
                  items:
                    -
                      id: 15608
                      device_id: 579
                      file: /tmp/fakerCtCGef
                      status: '0'
                      is_corrupted: '0'
                      version: null
                      type: fetching
                      upload_date: '1980-11-13 13:28:52'
                      created_at: '2024-12-13T13:37:37.000000Z'
                      updated_at: '2024-12-13T13:37:37.000000Z'
                    -
                      id: 15609
                      device_id: 132
                      file: /tmp/fakerLOEsLm
                      status: '0'
                      is_corrupted: '0'
                      version: null
                      type: fetching
                      upload_date: '2021-12-27 09:40:08'
                      created_at: '2024-12-13T13:37:37.000000Z'
                      updated_at: '2024-12-13T13:37:37.000000Z'
                properties:
                  paginator:
                    type: object
                    example:
                      total: 2
                      count: 2
                      perpage: 20
                      current_page: 1
                      last_page: 1
                  items:
                    type: array
                    example:
                      -
                        id: 15608
                        device_id: 579
                        file: /tmp/fakerCtCGef
                        status: '0'
                        is_corrupted: '0'
                        version: null
                        type: fetching
                        upload_date: '1980-11-13 13:28:52'
                        created_at: '2024-12-13T13:37:37.000000Z'
                        updated_at: '2024-12-13T13:37:37.000000Z'
                      -
                        id: 15609
                        device_id: 132
                        file: /tmp/fakerLOEsLm
                        status: '0'
                        is_corrupted: '0'
                        version: null
                        type: fetching
                        upload_date: '2021-12-27 09:40:08'
                        created_at: '2024-12-13T13:37:37.000000Z'
                        updated_at: '2024-12-13T13:37: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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 15610
                  device_id: 795
                  file: /tmp/fakerykUNrV
                  status: '0'
                  is_corrupted: '0'
                  version: null
                  type: fetching
                  upload_date: '1981-05-07 11:27:53'
                  created_at: '2024-12-13T13:37:37.000000Z'
                  updated_at: '2024-12-13T13:37:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 15610
                  device_id:
                    type: integer
                    example: 795
                  file:
                    type: string
                    example: /tmp/fakerykUNrV
                  status:
                    type: string
                    example: '0'
                  is_corrupted:
                    type: string
                    example: '0'
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: fetching
                  upload_date:
                    type: string
                    example: '1981-05-07 11:27:53'
                  created_at:
                    type: string
                    example: '2024-12-13T13:37:37.000000Z'
                  updated_at:
                    type: string
                    example: '2024-12-13T13:37: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: cumque
        required: true
        schema:
          type: string
  /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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 4083
                  device_id: 210
                  file: /tmp/fakerHP1w6D
                  status: '0'
                  is_corrupted: '0'
                  version: null
                  type: manual
                  upload_date: '2015-11-30 10:00:06'
                  created_at: '2024-12-13T13:37:37.000000Z'
                  updated_at: '2024-12-13T13:37:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 4083
                  device_id:
                    type: integer
                    example: 210
                  file:
                    type: string
                    example: /tmp/fakerHP1w6D
                  status:
                    type: string
                    example: '0'
                  is_corrupted:
                    type: string
                    example: '0'
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: manual
                  upload_date:
                    type: string
                    example: '2015-11-30 10:00:06'
                  created_at:
                    type: string
                    example: '2024-12-13T13:37:37.000000Z'
                  updated_at:
                    type: string
                    example: '2024-12-13T13:37: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: background
                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: '2014-11-26 23:32:58'
              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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 4084
                  device_id: 934
                  file: /tmp/fakerRjSs3P
                  status: '0'
                  is_corrupted: '0'
                  version: null
                  type: fetching
                  upload_date: '1985-01-27 15:36:03'
                  created_at: '2024-12-13T13:37:37.000000Z'
                  updated_at: '2024-12-13T13:37:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 4084
                  device_id:
                    type: integer
                    example: 934
                  file:
                    type: string
                    example: /tmp/fakerRjSs3P
                  status:
                    type: string
                    example: '0'
                  is_corrupted:
                    type: string
                    example: '0'
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: fetching
                  upload_date:
                    type: string
                    example: '1985-01-27 15:36:03'
                  created_at:
                    type: string
                    example: '2024-12-13T13:37:37.000000Z'
                  updated_at:
                    type: string
                    example: '2024-12-13T13:37: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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  paginator:
                    total: 2
                    count: 2
                    perpage: 20
                    current_page: 1
                    last_page: 1
                  items:
                    -
                      id: 4085
                      device_id: 793
                      file: /tmp/fakerBaEULa
                      status: '0'
                      is_corrupted: '0'
                      version: null
                      type: manual
                      upload_date: '1981-04-27 01:51:33'
                      created_at: '2024-12-13T13:37:37.000000Z'
                      updated_at: '2024-12-13T13:37:37.000000Z'
                    -
                      id: 4086
                      device_id: 805
                      file: /tmp/fakerDijf1U
                      status: '0'
                      is_corrupted: '0'
                      version: null
                      type: fetching
                      upload_date: '1995-11-07 05:20:51'
                      created_at: '2024-12-13T13:37:37.000000Z'
                      updated_at: '2024-12-13T13:37:37.000000Z'
                properties:
                  paginator:
                    type: object
                    example:
                      total: 2
                      count: 2
                      perpage: 20
                      current_page: 1
                      last_page: 1
                  items:
                    type: array
                    example:
                      -
                        id: 4085
                        device_id: 793
                        file: /tmp/fakerBaEULa
                        status: '0'
                        is_corrupted: '0'
                        version: null
                        type: manual
                        upload_date: '1981-04-27 01:51:33'
                        created_at: '2024-12-13T13:37:37.000000Z'
                        updated_at: '2024-12-13T13:37:37.000000Z'
                      -
                        id: 4086
                        device_id: 805
                        file: /tmp/fakerDijf1U
                        status: '0'
                        is_corrupted: '0'
                        version: null
                        type: fetching
                        upload_date: '1995-11-07 05:20:51'
                        created_at: '2024-12-13T13:37:37.000000Z'
                        updated_at: '2024-12-13T13:37: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: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 4087
                  device_id: 538
                  file: /tmp/fakerXXrhou
                  status: '0'
                  is_corrupted: '0'
                  version: null
                  type: fetching
                  upload_date: '1981-05-07 15:50:42'
                  created_at: '2024-12-13T13:37:37.000000Z'
                  updated_at: '2024-12-13T13:37:37.000000Z'
                properties:
                  id:
                    type: integer
                    example: 4087
                  device_id:
                    type: integer
                    example: 538
                  file:
                    type: string
                    example: /tmp/fakerXXrhou
                  status:
                    type: string
                    example: '0'
                  is_corrupted:
                    type: string
                    example: '0'
                  version:
                    type: string
                    example: null
                  type:
                    type: string
                    example: fetching
                  upload_date:
                    type: string
                    example: '1981-05-07 15:50:42'
                  created_at:
                    type: string
                    example: '2024-12-13T13:37:37.000000Z'
                  updated_at:
                    type: string
                    example: '2024-12-13T13:37: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: in
        required: true
        schema:
          type: string
tags:
  -
    name: Charts
    description: ''
  -
    name: 'Clean data'
    description: ''
  -
    name: Goals
    description: ''
  -
    name: 'Raw data'
    description: ''
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: ''
security:
  -
    default: []
