info:
  title: Interactions API
  version: 0.1.0
tags:
- name: V1.Interactions
servers:
  - url: https://live.luigisbox.com
paths:
  /v1/interactions/{tracker_id}/files:
    post:
      parameters:
      - in: path
        name: tracker_id
        schema:
          type: string
        required: true
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Success
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Validation error
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Invalid authentication credentials
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Not found
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: The uploaded file has an invalid structure
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Insufficient access privileges
      tags:
      - V1.Interactions
      summary: Upload user interactions
      description: Upload a file containing user interactions. Accepted data types
        for the uploaded file are `.json` and `.csv`. The maximum allowed size of
        the uploaded file is 1 GB.
      requestBody:
        description: |
          Provide data for one historical interaction per line. Examples: 
          
          In JSON Lines:
          
           ```jsonlines
            {"order_id": "1","identity": "/p/123","user_id": "4", "created_at": "2023-04-22 15:04:30.12312"}
            {"order_id": "1","identity": "/p/234","user_id": "4", "created_at": "2023-04-22 15:01:33.12345"}
            {"order_id": "2","identity": "/p/123","user_id": "3", "created_at": "2023-04-21 00:04:38.12121"}
            {"order_id": "2","identity": "/p/345","user_id": "3"}
           ```
          
          In CSV:
           ```plaintext
            1,/p/123,4,"2023-04-22 15:04:30.12312"
            1,/p/234,4,"2023-04-22 15:01:33.12345"
            2,/p/123,3,"2023-04-21 00:04:38.12121"
            2,/p/345,3
          ```
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/InteractionFile'
      security:
      - BearerAuth: []
openapi: 3.0.3
components:
  schemas:
    ValidationError:
      properties:
        reason:
          type: string
        exception_details:
          type: object
      type: object
    HTTPError:
      properties:
        reason:
          type: string
        exception_details:
          type: object
      type: object
    InteractionFile:
      type: object
      properties:
        file:
          type: string
          format: binary
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
