openapi: 3.0.0
paths:
  /health:
    get:
      operationId: HealthController_check
      parameters: []
      responses:
        '200':
          description: Health check status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthCheckRO'
      summary: Check service health status
      tags:
        - Health
  /app/config:
    get:
      operationId: AppController_getSystemConfig
      parameters: []
      responses:
        '200':
          description: System configuration
      summary: Get default system configuration
      tags:
        - App
  /app/features:
    get:
      operationId: AppController_getFeatures
      parameters: []
      responses:
        '200':
          description: Feature flags
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeaturesRO'
      summary: Get enabled features
      tags:
        - App
  /pipeline/frames:
    get:
      operationId: PipelineController_getFramesPipeline
      parameters: []
      responses:
        '200':
          description: Get the current status of the frame processing pipeline
      summary: Get frame pipeline status
      tags:
        - Pipeline
  /pipeline/evam:
    get:
      operationId: PipelineController_getEvamPipeline
      parameters: []
      responses:
        '200':
          description: Get the current status of the EVAM pipeline
      summary: Get EVAM pipeline status
      tags:
        - Pipeline
  /metrics/status:
    get:
      operationId: TelemetryController_status
      parameters: []
      responses:
        '200':
          description: Telemetry collector status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelemetryStatusRO'
      summary: Get telemetry collector connection status
      tags:
        - Metrics
  /audio/models:
    get:
      operationId: AudioController_getAudioModels
      parameters: []
      responses:
        '200':
          description: Fetch available audio models
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudioModelROSwagger'
      summary: Get available audio models
      tags:
        - Audio
  /tags:
    get:
      operationId: TagsController_getTags
      parameters: []
      responses:
        '200':
          description: Returns a list of all tags
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
      summary: Get all tags
      tags:
        - Tags
  /tags/{tagId}:
    delete:
      operationId: TagsController_removeTag
      parameters:
        - name: tagId
          required: true
          in: path
          description: ID of the tag to remove
          schema:
            type: number
      responses:
        '200':
          description: Tag removed successfully
      summary: Remove a tag by ID
      tags:
        - Tags
  /videos:
    post:
      operationId: VideoController_videoUpload
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VideoDTOSwagger'
      responses:
        '201':
          description: Video uploaded successfully
      summary: Upload a video file
      tags:
        - Video
    get:
      operationId: VideoController_getVideos
      parameters: []
      responses:
        '200':
          description: Returns a list of videos
      summary: Get all videos
      tags:
        - Video
  /videos/{videoId}:
    get:
      operationId: VideoController_getVideo
      parameters:
        - name: videoId
          required: true
          in: path
          description: ID of the video
          schema:
            type: string
      responses:
        '200':
          description: Video details
      summary: Get a video by ID
      tags:
        - Video
  /videos/search-embeddings/{videoId}:
    post:
      operationId: VideoController_createSearchEmbeddings
      parameters:
        - name: videoId
          required: true
          in: path
          description: ID of the video to create search embeddings for
          schema:
            type: string
      responses:
        '201':
          description: Search embeddings creation started
      summary: Create search embeddings for a video
      tags:
        - Video
  /search:
    get:
      operationId: SearchController_getQueries
      parameters: []
      responses:
        '200':
          description: Returns a list of all search queries
      summary: Get all search queries
      tags:
        - Search
    post:
      operationId: SearchController_addQuery
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchQueryDTO'
      responses:
        '201':
          description: Search query created
      summary: Add a new search query
      tags:
        - Search
  /search/watched:
    get:
      operationId: SearchController_getWatchedQueries
      parameters: []
      responses:
        '200':
          description: Returns a list of watched queries
      summary: Get all watched search queries
      tags:
        - Search
  /search/query:
    post:
      operationId: SearchController_searchQuery
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchQueryDTO'
      responses:
        '201':
          description: Search results
      summary: Execute a one-off search query
      tags:
        - Search
  /search/{queryId}:
    get:
      operationId: SearchController_getQuery
      parameters:
        - name: queryId
          required: true
          in: path
          description: ID of the search query
          schema:
            type: string
      responses:
        '200':
          description: Search query details
      summary: Get a search query by ID
      tags:
        - Search
    delete:
      operationId: SearchController_deleteQuery
      parameters:
        - name: queryId
          required: true
          in: path
          description: ID of the search query to delete
          schema:
            type: string
      responses:
        '200':
          description: Search query deleted
      summary: Delete a search query
      tags:
        - Search
  /search/{queryId}/refetch:
    post:
      operationId: SearchController_refetchQuery
      parameters:
        - name: queryId
          required: true
          in: path
          description: ID of the search query to refetch
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                timeFilter:
                  $ref: '#/components/schemas/TimeFilterSelection'
      responses:
        '200':
          description: Search query refetched
      summary: Refetch search results for a query
      tags:
        - Search
  /search/{queryId}/watch:
    patch:
      operationId: SearchController_watchQuery
      parameters:
        - name: queryId
          required: true
          in: path
          description: ID of the search query
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                watch:
                  type: boolean
                  description: Whether to watch this query
              required:
                - watch
      responses:
        '200':
          description: Watch status updated
      summary: Toggle watch status for a search query
      tags:
        - Search
  /summary:
    get:
      operationId: SummaryController_getSummary
      parameters: []
      responses:
        '200':
          description: Get all summary states raw
      summary: Get all summary states
      tags:
        - Summary
    post:
      operationId: SummaryController_startSummaryPipeline
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SummaryPipelineDTOSwagger'
      responses:
        '201':
          description: Summary pipeline started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SummaryPipelineRO'
      summary: Start a video summary pipeline
      tags:
        - Summary
  /summary/ui:
    get:
      operationId: SummaryController_getSummaryList
      parameters: []
      responses:
        '200':
          description: Get a list of summary states in UI-friendly format
      summary: Get summary list for UI
      tags:
        - Summary
  /summary/{stateId}:
    get:
      operationId: SummaryController_getSummaryById
      parameters:
        - name: stateId
          required: true
          in: path
          description: ID of the summary state
          schema:
            type: string
      responses:
        '200':
          description: Get UI Friendly summary state by ID
      summary: Get summary state by ID
      tags:
        - Summary
    delete:
      operationId: SummaryController_deleteSummaryById
      parameters:
        - name: stateId
          required: true
          in: path
          description: ID of the summary state to delete
          schema:
            type: string
      responses:
        '200':
          description: Summary state deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
      summary: Delete a summary state
      tags:
        - Summary
  /summary/{stateId}/raw:
    get:
      operationId: SummaryController_getSummaryRawById
      parameters:
        - name: stateId
          required: true
          in: path
          description: ID of the summary state to fetch raw data
          schema:
            type: string
      responses:
        '200':
          description: Get raw summary state data by ID
      summary: Get raw summary state by ID
      tags:
        - Summary
info:
  title: Pipeline Manager
  description: Pipeline Manager API for Video Search and Summarization
  version: '1.1'
  contact: {}
tags:
  - name: Health
    description: Service health endpoints
  - name: App
    description: Application configuration endpoints
  - name: Pipeline
    description: Pipeline status endpoints
  - name: Metrics
    description: Telemetry and metrics endpoints
  - name: Audio
    description: Audio model endpoints
  - name: Tags
    description: Tag management endpoints
  - name: Video
    description: Video upload and management endpoints
  - name: Search
    description: Video search endpoints
  - name: Summary
    description: Video summarization endpoints
servers: []
components:
  schemas:
    HealthCheckRO:
      type: object
      properties:
        status:
          type: string
          description: Overall health status
          enum:
            - ok
            - error
            - shutting_down
        info:
          type: object
          description: Health check details
        error:
          type: object
          description: Error details if any
        details:
          type: object
          description: Detailed health information
    FeaturesRO:
      type: object
      properties:
        summary:
          type: string
          description: Summary feature status
        search:
          type: string
          description: Search feature status
          readOnly: true
      required:
        - summary
        - search
    TelemetryStatusRO:
      type: object
      properties:
        collectorConnected:
          type: boolean
          description: Whether the telemetry collector is connected
        message:
          type: string
          description: Status message
    AudioModelSwagger:
      type: object
      properties:
        model_id:
          type: string
          description: Unique identifier for the audio model
        display_name:
          type: string
          description: Display name of the audio model
        description:
          type: string
          description: Description of the audio model
      required:
        - model_id
        - display_name
        - description
    AudioModelROSwagger:
      type: object
      properties:
        default_model:
          type: string
          description: Default audio model ID
        models:
          description: List of available audio models
          type: array
          items:
            $ref: '#/components/schemas/AudioModelSwagger'
      required:
        - default_model
        - models
    VideoDTOSwagger:
      type: object
      properties:
        video:
          type: string
          description: Video file to upload
          format: binary
        name:
          type: string
          description: Name of the video file
        tags:
          type: string
          description: Tags separated by commas
      required:
        - video
    TimeFilterSelection:
      type: object
      properties:
        type:
          type: string
          enum:
            - relative
            - absolute
          description: Type of time filter
        relative:
          type: object
          properties:
            value:
              type: number
            unit:
              type: string
              enum:
                - minutes
                - hours
                - days
                - weeks
        absolute:
          type: object
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
    SearchQueryDTO:
      type: object
      properties:
        query:
          type: string
          description: Search query text
        tags:
          type: string
          description: Comma-separated tags to filter by
        timeFilter:
          $ref: '#/components/schemas/TimeFilterSelection'
      required:
        - query
    SummaryPipelineSamplingSwagger:
      type: object
      properties:
        chunkDuration:
          type: number
          description: Duration for a chunk in seconds
        samplingFrame:
          type: number
          description: Number of frames to sample per chunk
        frameOverlap:
          type: number
          description: Frame overlap count
        multiFrame:
          type: number
          description: Multi frame count (batch size)
      required:
        - chunkDuration
        - samplingFrame
        - frameOverlap
        - multiFrame
    EvamPipeline:
      type: string
      enum:
        - object_detection
        - video_ingestion
      description: EVAM pipeline type
    SummaryPipelineEvamSwagger:
      type: object
      properties:
        evamPipeline:
          $ref: '#/components/schemas/EvamPipeline'
      required:
        - evamPipeline
    SummaryPipelinePromptsSwagger:
      type: object
      properties:
        framePrompt:
          type: string
          description: Prompt for frame captioning
        summaryMapPrompt:
          type: string
          description: Prompt for summary map processing
        summaryReducePrompt:
          type: string
          description: Prompt for summary reduce processing
        summarySinglePrompt:
          type: string
          description: Prompt for single summary processing
        audioSummaryMapPrompt:
          type: string
          description: Prompt for audio transcript summary map processing
        audioSummaryReducePrompt:
          type: string
          description: Prompt for audio transcript summary reduce processing
        audioSummarySinglePrompt:
          type: string
          description: Prompt for audio transcript single summary processing
    SummaryPipelineAudioSwagger:
      type: object
      properties:
        audioModel:
          type: string
          description: Audio model ID for transcription
        useFullTranscriptSummary:
          type: boolean
          description: >-
            When true, the full audio transcript is summarized by the LLM and
            included in the final video summary. Overrides the server default
            set by AUDIO_USE_FULL_TRANSCRIPT_SUMMARY.
      required:
        - audioModel
    SummaryPipelineDTOSwagger:
      type: object
      properties:
        videoId:
          type: string
          description: ID of the video to summarize
        title:
          type: string
          description: Title for the summary
        sampling:
          description: Sampling configuration for the summary
          $ref: '#/components/schemas/SummaryPipelineSamplingSwagger'
        evam:
          description: EVAM pipeline configuration
          $ref: '#/components/schemas/SummaryPipelineEvamSwagger'
        prompts:
          description: Optional prompts override
          $ref: '#/components/schemas/SummaryPipelinePromptsSwagger'
        audio:
          description: Optional audio model configuration
          $ref: '#/components/schemas/SummaryPipelineAudioSwagger'
      required:
        - videoId
        - title
        - sampling
        - evam
    SummaryPipelineRO:
      type: object
      properties:
        summaryPipelineId:
          type: string
          description: ID of the created summary pipeline state
      required:
        - summaryPipelineId
