openapi: 3.0.3
info:
  title: Nabist API
  description: |
    REST API for controlling Nabist screen capture application.

    ## Authentication
    The API supports optional Basic Authentication. If credentials are configured in the app settings,
    all requests must include the `Authorization` header with Base64-encoded credentials.

    ## Base URL
    By default, the API runs on `http://localhost:47832`. The port can be configured in app settings.

    ## Coordinate System
    Screen coordinates are absolute across all displays. Use `GET /api/displays` to understand the
    display layout. The primary display typically starts at (0, 0), while secondary monitors may
    have negative coordinates depending on their arrangement.
  version: 1.0.0
  contact:
    name: Nabist
    url: https://docs-nabist.rinthlabs.com/
servers:
  - url: http://localhost:47832
    description: Local development server

tags:
  - name: Status
    description: Application status and health
  - name: System
    description: System information (windows, displays)
  - name: Screenshots
    description: Capture screenshots
  - name: Recording
    description: Video recording controls
  - name: Captures
    description: Manage captured files
  - name: Tags
    description: Capture tags management
  - name: Export Presets
    description: Video export preset management
  - name: Settings
    description: Application settings
  - name: Annotation
    description: Annotation overlay controls
  - name: Window
    description: Application window controls

paths:
  # ==================== STATUS ====================
  /api/status:
    get:
      tags: [Status]
      summary: Get app status
      description: Get current application status including recording state and annotation state.
      responses:
        '200':
          description: Current status
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: object
                    properties:
                      recording:
                        type: boolean
                        description: Whether currently recording
                      recordingDuration:
                        type: integer
                        nullable: true
                        description: Recording duration in milliseconds
                      recordingSettings:
                        type: object
                        nullable: true
                        properties:
                          webcamEnabled:
                            type: boolean
                          microphoneEnabled:
                            type: boolean
                          systemAudioEnabled:
                            type: boolean
                      annotationActive:
                        type: boolean
                        description: Whether annotation overlay is active

  # ==================== SYSTEM ====================
  /api/windows:
    get:
      tags: [System]
      summary: List all windows
      description: Get a list of all visible windows on the system. Useful for finding window titles for window-specific capture.
      responses:
        '200':
          description: List of windows
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  windows:
                    type: array
                    items:
                      $ref: '#/components/schemas/Window'

  /api/displays:
    get:
      tags: [System]
      summary: Get all displays
      description: |
        Get information about all connected displays. Useful for understanding the coordinate system for region captures.

        The primary display typically starts at (0, 0). Secondary monitors can have negative x/y values if positioned left/above the primary display.
      responses:
        '200':
          description: List of displays
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  displays:
                    type: array
                    items:
                      $ref: '#/components/schemas/Display'

  # ==================== SCREENSHOTS ====================
  /api/screenshot/full:
    post:
      tags: [Screenshots]
      summary: Full screen screenshot
      description: Take a screenshot of the entire screen.
      responses:
        '200':
          description: Screenshot captured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaptureResponse'

  /api/screenshot/region:
    post:
      tags: [Screenshots]
      summary: Region screenshot
      description: |
        Take a screenshot of a specific region.

        **Two modes:**
        1. **With coordinates** - Capture directly using absolute screen coordinates
        2. **Without body** - Opens the region selector UI for manual selection
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                x:
                  type: integer
                  description: X coordinate (absolute screen position)
                y:
                  type: integer
                  description: Y coordinate (absolute screen position)
                width:
                  type: integer
                  description: Width in pixels
                height:
                  type: integer
                  description: Height in pixels
              example:
                x: 0
                y: 0
                width: 800
                height: 600
      responses:
        '200':
          description: Screenshot captured or selector opened
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/CaptureResponse'
                  - $ref: '#/components/schemas/MessageResponse'

  /api/screenshot/window:
    post:
      tags: [Screenshots]
      summary: Window screenshot
      description: |
        Take a screenshot of a specific window.

        **Two modes:**
        1. **With title** - Capture window matching the title (partial, case-insensitive)
        2. **Without body** - Opens the window selector UI for manual selection

        Use `GET /api/windows` to list available windows and their titles.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Window title to match (partial, case-insensitive)
              example:
                title: "Visual Studio Code"
      responses:
        '200':
          description: Screenshot captured or selector opened
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/CaptureResponse'
                  - $ref: '#/components/schemas/MessageResponse'

  # ==================== RECORDING ====================
  /api/recording/start/full:
    post:
      tags: [Recording]
      summary: Start full screen recording
      description: Start recording the entire screen.
      responses:
        '200':
          description: Recording started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Already recording
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/recording/start/region:
    post:
      tags: [Recording]
      summary: Start region recording
      description: |
        Start recording a specific region of the screen.

        **Two modes:**
        1. **With coordinates** - Start recording directly
        2. **Without body** - Opens the region selector UI
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                x:
                  type: integer
                y:
                  type: integer
                width:
                  type: integer
                height:
                  type: integer
              example:
                x: 0
                y: 0
                width: 1920
                height: 1080
      responses:
        '200':
          description: Recording started or selector opened
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Already recording
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/recording/start/window:
    post:
      tags: [Recording]
      summary: Start window recording
      description: |
        Start recording a specific window.

        **Two modes:**
        1. **With title** - Start recording window matching the title
        2. **Without body** - Opens the window selector UI
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Window title to match
              example:
                title: "Google Chrome"
      responses:
        '200':
          description: Recording started or selector opened
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Already recording
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/recording/stop:
    post:
      tags: [Recording]
      summary: Stop recording
      description: Stop the current recording and save the video file.
      responses:
        '200':
          description: Recording stopped
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaptureResponse'
        '400':
          description: Not currently recording
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/recording/webcam:
    post:
      tags: [Recording]
      summary: Toggle webcam
      description: Enable or disable webcam overlay during an active recording.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [enabled]
              properties:
                enabled:
                  type: boolean
                  description: Whether to enable webcam
              example:
                enabled: true
      responses:
        '200':
          description: Webcam toggled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Not currently recording
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/recording/microphone:
    post:
      tags: [Recording]
      summary: Toggle microphone
      description: Enable or disable microphone audio during an active recording.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [enabled]
              properties:
                enabled:
                  type: boolean
              example:
                enabled: true
      responses:
        '200':
          description: Microphone toggled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Not currently recording
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/recording/system-audio:
    post:
      tags: [Recording]
      summary: Toggle system audio
      description: Enable or disable system audio capture during an active recording.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [enabled]
              properties:
                enabled:
                  type: boolean
              example:
                enabled: true
      responses:
        '200':
          description: System audio toggled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Not currently recording
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  # ==================== CAPTURES ====================
  /api/captures:
    get:
      tags: [Captures]
      summary: Get all captures
      description: Get all captures with optional filtering and pagination.
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
            default: 100
          description: Maximum number of captures to return
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
          description: Number of captures to skip
        - name: type
          in: query
          schema:
            type: string
            enum: [screenshot, video]
          description: Filter by capture type
      responses:
        '200':
          description: List of captures
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  captures:
                    type: array
                    items:
                      $ref: '#/components/schemas/Capture'
                  total:
                    type: integer

  /api/captures/stats:
    get:
      tags: [Captures]
      summary: Get capture statistics
      description: Get statistics about all captures (counts, total size, etc.)
      responses:
        '200':
          description: Capture statistics
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  stats:
                    type: object
                    properties:
                      total:
                        type: integer
                      screenshots:
                        type: integer
                      videos:
                        type: integer
                      totalSize:
                        type: integer
                        description: Total size in bytes

  /api/captures/search:
    post:
      tags: [Captures]
      summary: Search captures
      description: Search captures by filename, title, or tags.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [query]
              properties:
                query:
                  type: string
                  description: Search term
                limit:
                  type: integer
                  default: 100
                offset:
                  type: integer
                  default: 0
              example:
                query: "screenshot"
                limit: 50
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  captures:
                    type: array
                    items:
                      $ref: '#/components/schemas/Capture'
                  total:
                    type: integer

  /api/captures/{id}:
    get:
      tags: [Captures]
      summary: Get capture by ID
      description: Get a specific capture by its ID.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Capture details
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  capture:
                    $ref: '#/components/schemas/Capture'
        '404':
          description: Capture not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

    patch:
      tags: [Captures]
      summary: Update capture
      description: Update a capture's title and/or tags.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: New title
                tags:
                  type: array
                  items:
                    type: string
                  description: New tags
              example:
                title: "My Screenshot"
                tags: ["work", "important"]
      responses:
        '200':
          description: Updated capture
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  capture:
                    $ref: '#/components/schemas/Capture'
        '404':
          description: Capture not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

    delete:
      tags: [Captures]
      summary: Delete capture
      description: Delete a capture and its associated file.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Capture deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '404':
          description: Capture not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/captures/{id}/reveal:
    post:
      tags: [Captures]
      summary: Reveal in explorer
      description: Open the folder containing the capture file and select it.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: File revealed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '404':
          description: Capture not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/captures/{id}/copy:
    post:
      tags: [Captures]
      summary: Copy to clipboard
      description: Copy the capture file to the system clipboard.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: File copied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '404':
          description: Capture not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/captures/{id}/upload:
    post:
      tags: [Captures]
      summary: Upload capture
      description: |
        Upload a capture to a configured cloud destination.

        The destination must be enabled and configured in app settings before use.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [destination]
              properties:
                destination:
                  type: string
                  enum: [ftp, s3, imgur]
                  description: Upload destination
              example:
                destination: "imgur"
      responses:
        '200':
          description: Upload result
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
        '404':
          description: Capture not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  # ==================== TAGS ====================
  /api/tags:
    get:
      tags: [Tags]
      summary: Get all tags
      description: Get all unique tags used across captures.
      responses:
        '200':
          description: List of tags
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  tags:
                    type: array
                    items:
                      type: string

  # ==================== EXPORT PRESETS ====================
  /api/export-presets:
    get:
      tags: [Export Presets]
      summary: Get all presets
      description: Get all video export presets (both built-in and custom).
      responses:
        '200':
          description: List of presets
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  presets:
                    type: array
                    items:
                      $ref: '#/components/schemas/ExportPreset'

    post:
      tags: [Export Presets]
      summary: Create preset
      description: Create a new custom export preset.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportPresetInput'
      responses:
        '200':
          description: Created preset
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  preset:
                    $ref: '#/components/schemas/ExportPreset'

  /api/export-presets/{id}:
    get:
      tags: [Export Presets]
      summary: Get preset by ID
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Preset details
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  preset:
                    $ref: '#/components/schemas/ExportPreset'
        '404':
          description: Preset not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

    put:
      tags: [Export Presets]
      summary: Update preset
      description: Update a custom export preset. Built-in presets cannot be modified.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportPresetInput'
      responses:
        '200':
          description: Updated preset
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  preset:
                    $ref: '#/components/schemas/ExportPreset'
        '400':
          description: Cannot modify built-in preset
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Preset not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

    delete:
      tags: [Export Presets]
      summary: Delete preset
      description: Delete a custom export preset. Built-in presets cannot be deleted.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Preset deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Cannot delete built-in preset
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Preset not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  # ==================== SETTINGS ====================
  /api/settings:
    get:
      tags: [Settings]
      summary: Get settings
      description: Get current application settings. Sensitive fields (passwords, keys) are excluded.
      responses:
        '200':
          description: Current settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  settings:
                    $ref: '#/components/schemas/Settings'

    put:
      tags: [Settings]
      summary: Update settings
      description: Update application settings. License and trial fields cannot be modified via API.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Settings'
      responses:
        '200':
          description: Updated settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  settings:
                    $ref: '#/components/schemas/Settings'

  # ==================== ANNOTATION ====================
  /api/annotation/show:
    post:
      tags: [Annotation]
      summary: Show annotation
      description: Show the annotation toolbar overlay for drawing on screen.
      responses:
        '200':
          description: Annotation shown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Annotation already active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/annotation/hide:
    post:
      tags: [Annotation]
      summary: Hide annotation
      description: Hide the annotation toolbar overlay.
      responses:
        '200':
          description: Annotation hidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Annotation not active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/annotation/settings:
    get:
      tags: [Annotation]
      summary: Get annotation settings
      description: Get current annotation tool settings including active tool, color, thickness, and fill mode.
      responses:
        '200':
          description: Current annotation settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  active:
                    type: boolean
                    description: Whether annotation overlay is currently active
                  settings:
                    $ref: '#/components/schemas/AnnotationSettings'
    put:
      tags: [Annotation]
      summary: Update annotation settings
      description: Update one or more annotation settings. All fields are optional - only provided fields will be updated.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tool:
                  type: string
                  enum: [pointer, select, pen, highlighter, arrow, rectangle, ellipse, line, text, eraser, marker]
                  description: The annotation tool to activate
                color:
                  type: string
                  pattern: '^#[0-9A-Fa-f]{6}$'
                  description: Hex color code (e.g., #ff0000 for red)
                thickness:
                  type: integer
                  minimum: 1
                  maximum: 50
                  description: Stroke thickness in pixels
                fill:
                  type: boolean
                  description: Whether to fill shapes (rectangle, ellipse)
            example:
              tool: pen
              color: "#ff0000"
              thickness: 5
              fill: false
      responses:
        '200':
          description: Settings updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  settings:
                    $ref: '#/components/schemas/AnnotationSettings'
        '400':
          description: Invalid settings provided
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  errors:
                    type: array
                    items:
                      type: string

  /api/annotation/undo:
    post:
      tags: [Annotation]
      summary: Undo annotation
      description: Undo the last annotation action.
      responses:
        '200':
          description: Undo executed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Annotation not active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/annotation/redo:
    post:
      tags: [Annotation]
      summary: Redo annotation
      description: Redo the last undone annotation action.
      responses:
        '200':
          description: Redo executed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Annotation not active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  /api/annotation/clear:
    post:
      tags: [Annotation]
      summary: Clear annotations
      description: Clear all annotations from the canvas.
      responses:
        '200':
          description: Annotations cleared
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: Annotation not active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'

  # ==================== WINDOW ====================
  /api/window/capture-menu:
    post:
      tags: [Window]
      summary: Show capture menu
      description: Show the main capture menu window.
      responses:
        '200':
          description: Window shown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'

  /api/window/history:
    post:
      tags: [Window]
      summary: Show history
      description: Show the capture history window.
      responses:
        '200':
          description: Window shown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'

  /api/window/settings:
    post:
      tags: [Window]
      summary: Show settings
      description: Show the settings window.
      responses:
        '200':
          description: Window shown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'

components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Optional Basic Authentication (configured in app settings)

  schemas:
    AnnotationSettings:
      type: object
      properties:
        tool:
          type: string
          enum: [pointer, select, pen, highlighter, arrow, rectangle, ellipse, line, text, eraser, marker]
          description: Currently active annotation tool
        color:
          type: string
          pattern: '^#[0-9A-Fa-f]{6}$'
          description: Current stroke color (hex format)
          example: "#ff0000"
        thickness:
          type: integer
          minimum: 1
          maximum: 50
          description: Current stroke thickness in pixels
        fill:
          type: boolean
          description: Whether shapes are filled

    Window:
      type: object
      properties:
        hwnd:
          type: integer
          description: Window handle (unique identifier)
        title:
          type: string
          description: Window title
        x:
          type: integer
          description: X position (absolute screen coordinates)
        y:
          type: integer
          description: Y position (absolute screen coordinates)
        width:
          type: integer
        height:
          type: integer
        minimized:
          type: boolean

    Display:
      type: object
      properties:
        id:
          type: integer
        bounds:
          type: object
          properties:
            x:
              type: integer
            y:
              type: integer
            width:
              type: integer
            height:
              type: integer
        scaleFactor:
          type: number
          description: Display scaling (1.0 = 100%, 1.5 = 150%)
        isPrimary:
          type: boolean

    Capture:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum: [screenshot, video]
        filepath:
          type: string
        filename:
          type: string
        timestamp:
          type: integer
          description: Unix timestamp (milliseconds)
        width:
          type: integer
          nullable: true
        height:
          type: integer
          nullable: true
        duration:
          type: integer
          nullable: true
          description: Video duration in milliseconds
        filesize:
          type: integer
          description: File size in bytes
        isRegion:
          type: boolean
        regionX:
          type: integer
          nullable: true
        regionY:
          type: integer
          nullable: true
        regionWidth:
          type: integer
          nullable: true
        regionHeight:
          type: integer
          nullable: true
        thumbnail:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        tags:
          type: string
          nullable: true
          description: Comma-separated tags

    ExportPreset:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        isBuiltIn:
          type: boolean
        resolution:
          type: string
          enum: [original, '2160p', '1080p', '720p', '480p', '360p', custom]
        customWidth:
          type: integer
          nullable: true
        customHeight:
          type: integer
          nullable: true
        scale:
          type: integer
          description: Scale percentage (100, 75, 50, 25)
        format:
          type: string
          enum: [mp4, webm, mkv, mov, avi, gif]
        quality:
          type: string
          enum: [high, medium, low, verylow]
        fps:
          oneOf:
            - type: string
              enum: [original]
            - type: integer
              enum: [60, 30, 24, 15]
        encodingPreset:
          type: string
          enum: [ultrafast, superfast, fast, medium, slow]
        audioBitrate:
          type: string
          enum: [none, '96k', '128k', '192k', '256k', '320k']
        gifFps:
          type: integer
          nullable: true
        gifColors:
          type: integer
          nullable: true
        gifDithering:
          type: integer
          nullable: true
        gifLossy:
          type: integer
          nullable: true

    ExportPresetInput:
      type: object
      required: [name]
      properties:
        name:
          type: string
        resolution:
          type: string
          enum: [original, '2160p', '1080p', '720p', '480p', '360p', custom]
        customWidth:
          type: integer
        customHeight:
          type: integer
        scale:
          type: integer
        format:
          type: string
          enum: [mp4, webm, mkv, mov, avi, gif]
        quality:
          type: string
          enum: [high, medium, low, verylow]
        fps:
          oneOf:
            - type: string
            - type: integer
        encodingPreset:
          type: string
          enum: [ultrafast, superfast, fast, medium, slow]
        audioBitrate:
          type: string
          enum: [none, '96k', '128k', '192k', '256k', '320k']

    Settings:
      type: object
      description: Application settings (partial list of common fields)
      properties:
        videoQuality:
          type: string
          enum: [low, medium, high, lossless]
        videoFrameRate:
          type: integer
          enum: [30, 60]
        showCursor:
          type: boolean
        recordSystemAudio:
          type: boolean
        recordMicrophone:
          type: boolean
        webcamEnabled:
          type: boolean
        capturesPath:
          type: string
        screenshotFormat:
          type: string
          enum: [png, jpg]
        screenshotQuality:
          type: integer
        autoOpenVideoEditor:
          type: boolean
        autoOpenScreenshotEditor:
          type: boolean
        webServerEnabled:
          type: boolean
        webServerPort:
          type: integer

    CaptureResponse:
      type: object
      properties:
        success:
          type: boolean
        capture:
          $ref: '#/components/schemas/Capture'

    MessageResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string

    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string

security:
  - basicAuth: []
