openapi: "3.0.1"
info:
  title: "Rasa Platform - Active Learning"
  version: "1.0.0"
  description: >-
    Rasa Platform active learning endpoints
servers:
- url: http://demo-bot.rasa.com/api
  description: Demo
paths:
  /projects/{project_id}/logs:
    get:
      tags:
      - Suggestions
      summary: Get suggestions
      operationId: getLogs
      parameters:
      - in: path
        name: project_id
        schema:
          type: string
        required: true
      - in: query
        name: q
        schema:
          type: string
      - in: query
        name: intent
        schema:
          type: string
      - in: query
        name: limit
        schema:
          type: integer
          default: null
      - in: query
        name: offset
        schema:
          type: integer
          default: 0
      responses:
        200:
          description: Suggestions for project
          headers:
            X-Total-Count:
              schema:
                type: integer
              description: Total responses ignoring limit and offset
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Suggestion'
    post:
      tags:
      - Parsing
      summary: Parse text and create a new log entry
      operationId: parseText
      parameters:
      - in: path
        name: project_id
        schema:
          type: string
        required: true
      - in: query
        name: q
        schema:
          type: string
        required: true
      responses:
        200:
          description: Created log entry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Suggestion'
  /projects/{project_id}/logs/{log_id}:
    delete:
      tags:
      - Logs
      summary: Archive log
      operationId: archiveLog
      parameters:
      - in: path
        name: project_id
        schema:
          type: string
        required: true
      - in: path
        name: log_id
        schema:
          type: string
        required: true
      responses:
        200:
          description: Successfully archived log
          content:
            text/plain:
              schema:
                type: string
                description: log {log_id} archived
        400:
          description: archiving of logs unsuccessful
components:
  schemas:
    ParseData:
      description: Note that this is a superset of the props in Core's ParseData
      type: object
      properties:
        project:
          type: string
        model:
          type: string
        entites:
          type: array
          items:
            $ref: '#/components/schemas/Entity'
        intent:
          $ref: '#/components/schemas/Intent'
        intent_ranking:
          type: array
          items:
            $ref: '#/components/schemas/Intent'
        text:
          type: string
    Entity:
      type: object
      properties:
        start:
          type: number
        end:
          type: number
        value:
          type: string
        entity:
          type: string
        extractor:
          type: string
    Intent:
      type: object
      properties:
        confidence:
          type: integer
        name:
          type: string
    Suggestion:
      type: object
      properties:
        user_input:
          type: object
          properties:
            text:
              type: string
            intent:
              type: object
              properties:
                name:
                  type: string
                confidence:
                  type: number
            entities:
              type: array
              items:
                type: object
        project_id:
          type: string
        model:
          type: string
        time:
          type: number
        team:
          type: string
