basePath: /api/v1
definitions:
  models.CancelTrainingResponse:
    description: Cancelled job response
    properties:
      jobId:
        type: string
      status:
        $ref: '#/definitions/models.TrainingStatus'
    type: object
  models.Chat:
    description: Chat conversation details
    properties:
      archived:
        example: false
        type: boolean
      createdAt:
        example: "2024-01-01T00:00:00Z"
        type: string
      deletedAt:
        type: string
      id:
        example: 1
        type: integer
      lastMessageAt:
        type: string
      messages:
        items:
          $ref: '#/definitions/models.Message'
        type: array
      organizationId:
        example: org_123abc
        type: string
      pinned:
        example: false
        type: boolean
      title:
        example: Training Session Discussion
        type: string
      updatedAt:
        example: "2024-01-01T00:00:00Z"
        type: string
      userId:
        example: user_456def
        type: string
      uuid:
        example: 550e8400-e29b-41d4-a716-446655440000
        type: string
    type: object
  models.Clip:
    description: Video clip for a session
    properties:
      createdAt:
        type: string
      id:
        type: string
      sessionID:
        type: string
    type: object
  models.EnterpriseContract:
    properties:
      annualFeeCents:
        type: integer
      expiryDate:
        type: string
      features:
        items:
          type: string
        type: array
      teamLimit:
        type: integer
    type: object
  models.ErrorResponse:
    description: Training error response
    properties:
      detail:
        type: string
    type: object
  models.FieldType:
    description: Field type enum
    enum:
    - text
    - textarea
    - number
    - select
    - multiselect
    - date
    - time
    - datetime
    - boolean
    - rating
    - keyvalue
    type: string
    x-enum-varnames:
    - TextField
    - TextAreaField
    - NumberField
    - SelectField
    - MultiSelect
    - DateField
    - TimeField
    - DateTimeField
    - BooleanField
    - RatingField
    - KeyValueField
  models.FieldValidation:
    description: Field validation rules
    properties:
      max:
        example: 100
        type: number
      maxLen:
        example: 500
        type: integer
      min:
        example: 0
        type: number
      minLen:
        example: 1
        type: integer
      pattern:
        example: ^[a-zA-Z0-9]+$
        type: string
    type: object
  models.FormField:
    description: Individual form field configuration
    properties:
      defaultValue: {}
      id:
        example: play_type
        type: string
      label:
        example: Play Type
        type: string
      metadata:
        additionalProperties: {}
        type: object
      options:
        example:
        - run
        - pass
        - kick
        items:
          type: string
        type: array
      required:
        example: false
        type: boolean
      type:
        allOf:
        - $ref: '#/definitions/models.FieldType'
        example: select
      validation:
        $ref: '#/definitions/models.FieldValidation'
    type: object
  models.FormSchema:
    description: Form schema with fields definition
    properties:
      fields:
        items:
          $ref: '#/definitions/models.FormField'
        type: array
      version:
        example: "1.0"
        type: string
    type: object
  models.LicenseType:
    enum:
    - stripe
    - enterprise-license
    type: string
    x-enum-varnames:
    - LicenseStripe
    - LicenseEnterprise
  models.ListJobsResponse:
    description: Available jobs
    properties:
      jobs:
        items:
          $ref: '#/definitions/models.TrainingJobSummary'
        type: array
    type: object
  models.Log:
    description: Data log for a sesion
    properties:
      createdAt:
        type: string
      data:
        additionalProperties: {}
        type: object
      id:
        type: string
      sessionId:
        type: string
    type: object
  models.LoggingSession:
    description: A logging sessiosn
    properties:
      clips:
        items:
          $ref: '#/definitions/models.Clip'
        type: array
      createdAt:
        type: string
      endedAt:
        type: string
      formId:
        type: integer
      id:
        type: string
      logs:
        items:
          $ref: '#/definitions/models.Log'
        type: array
      name:
        type: string
      organizationId:
        type: string
      startedAt:
        type: string
      status:
        type: string
      teamId:
        type: string
      type:
        type: string
    type: object
  models.Message:
    description: Chat message details
    properties:
      chatId:
        example: 1
        type: integer
      content:
        example: What were the key plays in yesterday's game?
        type: string
      createdAt:
        example: "2024-01-01T00:00:00Z"
        type: string
      deletedAt:
        type: string
      editedAt:
        type: string
      id:
        example: 1
        type: integer
      metadata:
        $ref: '#/definitions/models.MessageMeta'
      parentId:
        type: integer
      role:
        allOf:
        - $ref: '#/definitions/models.MessageRole'
        example: user
      updatedAt:
        example: "2024-01-01T00:00:00Z"
        type: string
      uuid:
        example: 550e8400-e29b-41d4-a716-446655440001
        type: string
    type: object
  models.MessageMeta:
    description: Message metadata
    properties:
      customData:
        additionalProperties: {}
        type: object
      finishReason:
        example: stop
        type: string
      model:
        example: gpt-4
        type: string
      temperature:
        example: 0.7
        type: number
      tokenCount:
        example: 150
        type: integer
    type: object
  models.MessageRole:
    description: Message role enum
    enum:
    - user
    - assistant
    - system
    type: string
    x-enum-varnames:
    - UserRole
    - AssistantRole
    - SystemRole
  models.ModelFile:
    description: Details on model file
    properties:
      filename:
        type: string
      sizeBytes:
        type: integer
    type: object
  models.OrgConfig:
    description: Organization configuration managed by the Go backend
    properties:
      createdAt:
        type: string
      enterpriseContract:
        $ref: '#/definitions/models.EnterpriseContract'
      licenseType:
        $ref: '#/definitions/models.LicenseType'
      memberId:
        type: string
      name:
        type: string
      orgId:
        type: string
      organizationType:
        $ref: '#/definitions/models.OrganizationType'
      serverHostURL:
        type: string
      slug:
        type: string
      updatedAt:
        type: string
      userId:
        type: string
    type: object
  models.OrganizationType:
    enum:
    - subscription
    - enterprise
    type: string
    x-enum-varnames:
    - OrgTypeSubscription
    - OrgTypeEnterprise
  models.RollbackResponse:
    description: Rollback response for training job
    properties:
      modelPath:
        type: string
      newJobId:
        type: string
      rollbackFromJob:
        type: string
      status:
        type: string
    type: object
  models.SessionForm:
    description: SessionForm details
    properties:
      createdAt:
        example: "2024-01-01T00:00:00Z"
        type: string
      deletedAt:
        type: string
      description:
        example: Form for logging game details
        type: string
      id:
        example: 1
        type: integer
      name:
        example: Game Log Form
        type: string
      organizationId:
        example: "1"
        type: string
      schema:
        $ref: '#/definitions/models.FormSchema'
      updatedAt:
        example: "2024-01-01T00:00:00Z"
        type: string
    type: object
  models.StartTrainingResponse:
    description: Response object for succesful training
    properties:
      jobId:
        type: string
      status:
        $ref: '#/definitions/models.TrainingStatus'
      statusUrl:
        type: string
    type: object
  models.TeamConfig:
    description: Team configuration managed by the Go backend
    properties:
      createdAt:
        type: string
      name:
        type: string
      orgId:
        type: string
      teamId:
        type: string
      updatedAt:
        type: string
      userId:
        type: string
    type: object
  models.TimelineItem:
    description: Data type for either log or clip for a session
    properties:
      data:
        additionalProperties: {}
        type: object
      id:
        type: string
      timestamp:
        type: string
      type:
        type: string
      url:
        type: string
    type: object
  models.TrainingJobConfig:
    description: Config for a training job
    properties:
      batchSize:
        type: integer
      datasetFilename:
        type: string
      epochs:
        type: integer
      learningRate:
        type: number
      modelId:
        type: string
      useLora:
        type: boolean
    type: object
  models.TrainingJobStatus:
    description: Training status for a job
    properties:
      adapterPath:
        type: string
      completedAt:
        type: string
      config:
        $ref: '#/definitions/models.TrainingJobConfig'
      currentEpoch:
        type: integer
      error:
        type: string
      jobId:
        type: string
      metrics:
        $ref: '#/definitions/models.TrainingMetrics'
      modelFiles:
        items:
          $ref: '#/definitions/models.ModelFile'
        type: array
      modelPath:
        type: string
      progress:
        type: number
      startedAt:
        type: string
      status:
        $ref: '#/definitions/models.TrainingStatus'
      totalEpochs:
        type: integer
    type: object
  models.TrainingJobSummary:
    description: Training status for a job
    properties:
      completed:
        type: string
      created:
        type: string
      jobId:
        type: string
      modelId:
        type: string
      progress:
        type: number
      status:
        $ref: '#/definitions/models.TrainingStatus'
    type: object
  models.TrainingMetrics:
    description: Available metrics for a training job
    properties:
      additional:
        additionalProperties: {}
        type: object
      evalLoss:
        items:
          type: number
        type: array
      trainingLoss:
        items:
          type: number
        type: array
    type: object
  models.TrainingStatus:
    description: Enum for training status
    enum:
    - pending
    - running
    - completed
    - failed
    - cancelled
    type: string
    x-enum-varnames:
    - TrainingStatusPending
    - TrainingStatusRunning
    - TrainingStatusCompleted
    - TrainingStatusFailed
    - TrainingStatusCancelled
host: localhost:8080
info:
  contact:
    email: support@coordinator.com
    name: API Support
  description: API for GPU operations, ML training, vision processing, and session
    logging
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: COORDINATOR GPU Pipeline API
  version: "2.0"
paths:
  /api/v1/actions/chats:
    get:
      consumes:
      - application/json
      description: Get all chat conversations for the authenticated user in their
        active organization
      parameters:
      - description: Page number
        in: query
        name: page
        type: integer
      - description: Items per page
        in: query
        name: limit
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/models.Chat'
            type: array
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: List user chats
      tags:
      - chats
    post:
      consumes:
      - application/json
      description: Create a new chat conversation for the authenticated user in their
        active organization
      parameters:
      - description: Chat creation details
        in: body
        name: chat
        required: true
        schema:
          properties:
            prompt:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "201":
          description: Created
          schema:
            $ref: '#/definitions/models.Chat'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
        "503":
          description: Service Unavailable
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: Create new chat
      tags:
      - chats
  /api/v1/actions/chats/{chatID}:
    delete:
      consumes:
      - application/json
      description: Soft delete a chat conversation for the authenticated user
      parameters:
      - description: Chat ID
        in: path
        name: chatID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties:
              type: string
            type: object
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "404":
          description: Not Found
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: Delete chat
      tags:
      - chats
    get:
      consumes:
      - application/json
      description: Get a specific chat conversation with all its messages for the
        authenticated user
      parameters:
      - description: Chat ID
        in: path
        name: chatID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/models.Chat'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "404":
          description: Not Found
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: Get chat by ID
      tags:
      - chats
  /api/v1/actions/chats/{chatID}/archieve:
    post:
      consumes:
      - application/json
      description: Update chat archive status for the authenticated user
      parameters:
      - description: Chat ID
        in: path
        name: chatID
        required: true
        type: string
      - description: Archive status
        in: body
        name: archived
        required: true
        schema:
          properties:
            archived:
              type: boolean
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/models.Chat'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "404":
          description: Not Found
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: Update chat archive state
      tags:
      - chats
  /api/v1/actions/chats/{chatID}/messages:
    get:
      consumes:
      - application/json
      description: Get all messages for a specific chat conversation for the authenticated
        user
      parameters:
      - description: Chat ID
        in: path
        name: chatID
        required: true
        type: string
      - default: 50
        description: Number of messages to return
        in: query
        name: limit
        type: integer
      - default: 0
        description: Offset for pagination
        in: query
        name: offset
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/models.Message'
            type: array
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "404":
          description: Not Found
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: Get chat messages
      tags:
      - chats
    post:
      consumes:
      - application/json
      description: Add a new user message to a chat conversation and get assistant
        response
      parameters:
      - description: Chat ID
        in: path
        name: chatID
        required: true
        type: string
      - description: Message details
        in: body
        name: message
        required: true
        schema:
          properties:
            prompt:
              type: string
          type: object
      produces:
      - text/event-stream
      responses:
        "200":
          description: SSE stream of chunks
          schema:
            type: string
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "404":
          description: Not Found
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
        "503":
          description: Service Unavailable
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: Add message to chat
      tags:
      - chats
  /api/v1/actions/chats/{chatID}/pin:
    post:
      consumes:
      - application/json
      description: Update chat pinned status for the authenticated user
      parameters:
      - description: Chat ID
        in: path
        name: chatID
        required: true
        type: string
      - description: Pinning status
        in: body
        name: pinning
        required: true
        schema:
          properties:
            pinned:
              type: boolean
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/models.Chat'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "404":
          description: Not Found
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: Update chat pinning
      tags:
      - chats
  /api/v1/actions/chats/{chatID}/update-title:
    post:
      consumes:
      - application/json
      description: Update chat title for the authenticated user
      parameters:
      - description: Chat ID
        in: path
        name: chatID
        required: true
        type: string
      - description: Chat title
        in: body
        name: title
        required: true
        schema:
          properties:
            title:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/models.Chat'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "404":
          description: Not Found
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: Update chat title
      tags:
      - chats
  /api/v1/actions/chats/pinned:
    get:
      consumes:
      - application/json
      description: Get all chat conversations for the authenticated user in their
        active organization
      parameters:
      - description: Page number
        in: query
        name: page
        type: integer
      - description: Items per page
        in: query
        name: limit
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items:
              $ref: '#/definitions/models.Chat'
            type: array
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - BearerAuth: []
      summary: List user chats
      tags:
      - chats
  /api/v1/actions/embedding/{embeddingID}:
    delete:
      consumes:
      - application/json
      description: Delete a specific embedding from the vector database for the authenticated
        user's organization
      parameters:
      - description: Embedding ID to delete
        in: path
        name: embeddingID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Deletion confirmation
          schema:
            type: object
        "400":
          description: Missing embedding ID
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Embedding not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Delete embedding by ID
      tags:
      - embedding
    get:
      consumes:
      - application/json
      description: Retrieve a specific embedding and its associated media from the
        vector database for the authenticated user's organization
      parameters:
      - description: Embedding ID to retrieve
        in: path
        name: embeddingID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Embedding data with media information
          schema:
            type: object
        "400":
          description: Missing embedding ID
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Embedding not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get embedding by ID
      tags:
      - embedding
  /api/v1/actions/embedding/{embeddingID}/media:
    get:
      consumes:
      - application/json
      description: Retrieve the actual media file (image, video, etc.) associated
        with an embedding from storage for the authenticated user's organization
      parameters:
      - description: Embedding ID
        in: path
        name: embeddingID
        required: true
        type: string
      produces:
      - application/octet-stream
      responses:
        "200":
          description: Media file content
          schema:
            type: file
        "400":
          description: Missing embedding ID
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Media file not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get embedding media file
      tags:
      - embedding
  /api/v1/actions/embedding/data:
    get:
      consumes:
      - application/json
      description: Retrieve all embeddings from the embedding service vector database
        for the authenticated user's organization
      parameters:
      - description: 'Maximum number of embeddings to retrieve (default: 100)'
        in: query
        name: limit
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: Embedded data from vector database
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Retrieve all embeddings
      tags:
      - embedding
  /api/v1/actions/embedding/search:
    get:
      consumes:
      - application/json
      description: Find similar content in the vector database based on text query
        for the authenticated user's organization
      parameters:
      - description: Search query text
        in: query
        name: query
        required: true
        type: string
      - description: 'Maximum number of results (default: 10)'
        in: query
        name: limit
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: Search results from vector database
          schema:
            type: object
        "400":
          description: Missing query parameter
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Search embeddings by text query
      tags:
      - embedding
  /api/v1/actions/embedding/search-by-file:
    get:
      consumes:
      - application/json
      description: Find embeddings related to a specific file already in the system
        for the authenticated user's organization
      parameters:
      - description: Filename to search for
        in: query
        name: filename
        required: true
        type: string
      - description: 'Maximum number of results (default: 10)'
        in: query
        name: limit
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: Search results from vector database
          schema:
            type: object
        "400":
          description: Missing filename parameter
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Search for similar content by filename
      tags:
      - embedding
  /api/v1/actions/embedding/search-similar-content:
    get:
      consumes:
      - application/json
      description: Find content based on content type and football relevance for the
        authenticated user's organization
      parameters:
      - description: Content type filter (e.g., video, image)
        in: query
        name: contentType
        type: string
      - description: 'Filter by football relevance (default: true)'
        in: query
        name: footballRelated
        type: boolean
      - description: 'Maximum number of results (default: 10)'
        in: query
        name: limit
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: Search results from vector database
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Search for similar content by type and relevance
      tags:
      - embedding
  /api/v1/actions/embedding/upload:
    post:
      consumes:
      - multipart/form-data
      description: Upload multimodal files (images, videos, PDFs, docs) to be processed
        and embedded by the embedding service
      parameters:
      - description: Files to be embedded (supports images, PDFs, videos, documents)
        in: formData
        name: file
        required: true
        type: file
      produces:
      - application/json
      responses:
        "200":
          description: Upload result with embedding confirmation
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Upload embedded data
      tags:
      - embedding
  /api/v1/actions/forms:
    get:
      consumes:
      - application/json
      description: List all custom session forms for the authenticated user's organization
      produces:
      - application/json
      responses:
        "200":
          description: List of session forms
          schema:
            items:
              $ref: '#/definitions/models.SessionForm'
            type: array
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: List session forms
      tags:
      - session-forms
    post:
      consumes:
      - application/json
      description: Create a custom form template for logging sessions in the authenticated
        user's organization
      parameters:
      - description: Form configuration
        in: body
        name: form
        required: true
        schema:
          properties:
            description:
              type: string
            name:
              type: string
            schema:
              type: object
          type: object
      produces:
      - application/json
      responses:
        "201":
          description: Form created
          schema:
            $ref: '#/definitions/models.SessionForm'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "409":
          description: Form name already exists
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Create new session form
      tags:
      - session-forms
  /api/v1/actions/forms/{formID}:
    delete:
      consumes:
      - application/json
      description: Soft delete a custom session form for the authenticated user's
        organization
      parameters:
      - description: Form ID
        in: path
        name: formID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Deletion confirmation
          schema:
            type: object
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Form not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Delete session form
      tags:
      - session-forms
    put:
      consumes:
      - application/json
      description: Update a custom session form for the authenticated user's organization
      parameters:
      - description: Form ID
        in: path
        name: formID
        required: true
        type: string
      - description: Updated form data
        in: body
        name: form
        required: true
        schema:
          properties:
            description:
              type: string
            name:
              type: string
            schema:
              type: object
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: Updated form
          schema:
            $ref: '#/definitions/models.SessionForm'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Form not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Update session form
      tags:
      - session-forms
  /api/v1/actions/ping:
    post:
      consumes:
      - application/json
      description: Checks the health endpoint of a service running on the configured
        server host for the authenticated user's organization
      parameters:
      - description: Port configuration
        in: body
        name: port
        required: true
        schema:
          properties:
            port:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: Health check result from the service
          schema:
            type: object
        "400":
          description: Invalid request body
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Ping server port health check
      tags:
      - actions
  /api/v1/actions/sessions:
    post:
      consumes:
      - application/json
      description: Create a new logging session (game, practice, etc.) for the authenticated
        user's organization
      parameters:
      - description: Session configuration
        in: body
        name: request
        schema:
          properties:
            formId:
              type: integer
            name:
              type: string
            type:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "201":
          description: Session created
          schema:
            $ref: '#/definitions/models.LoggingSession'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Form not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Create new session
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}:
    get:
      consumes:
      - application/json
      description: Retrieve session by session ID for the authenticated user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Session
          schema:
            $ref: '#/definitions/models.LoggingSession'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get session
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/clips:
    get:
      consumes:
      - application/json
      description: Retrieve all video clips associated with a specific session for
        the authenticated user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: List of clips with metadata
          schema:
            items:
              $ref: '#/definitions/models.Clip'
            type: array
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get session clips
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/clips/{clipId}:
    get:
      consumes:
      - application/json
      description: Retrieve detailed information about a specific clip from a session
        for the authenticated user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      - description: Clip ID
        in: path
        name: clipId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Clip data with metadata
          schema:
            type: object
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session or clip not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get clip by ID
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/clips/{clipId}/video:
    get:
      description: Stream the actual MP4 video file for a clip from the Vision API
        for the authenticated user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      - description: Clip ID
        in: path
        name: clipId
        required: true
        type: string
      produces:
      - video/mp4
      responses:
        "200":
          description: OK
          schema:
            type: file
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session or clip not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get clip video
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/clips/create:
    post:
      consumes:
      - application/json
      description: Generate a video clip and automatically link it to a session for
        the authenticated user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      - description: Clip request
        in: body
        name: clipRequest
        required: true
        schema:
          properties:
            camera_id:
              type: string
            duration_seconds:
              type: integer
            fps:
              type: integer
            start_time:
              type: number
            title:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "201":
          description: Clip created and associated with session
          schema:
            type: object
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Create clip from session
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/delete:
    post:
      consumes:
      - application/json
      description: Soft delete a session for the authenticated user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Session deleted
          schema:
            $ref: '#/definitions/models.LoggingSession'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Delete session
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/end:
    post:
      consumes:
      - application/json
      description: End session logging and embed into vector database for the authenticated
        user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Session ended and embedded
          schema:
            type: object
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: End session logging
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/logs:
    get:
      consumes:
      - application/json
      description: Retrieve all log entries from a session for the authenticated user's
        organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: List of log entries
          schema:
            items:
              $ref: '#/definitions/models.Log'
            type: array
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get session logs
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/logs/{logId}:
    get:
      consumes:
      - application/json
      description: Retrieve a specific log entry from a session by its log ID for
        the authenticated user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      - description: Log ID
        in: path
        name: logId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Log entry data
          schema:
            $ref: '#/definitions/models.Log'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session or log not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get log by ID
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/logs/create:
    post:
      consumes:
      - application/json
      description: Add a log entry to an active session for the authenticated user's
        organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      - description: Log data (any key-value pairs)
        in: body
        name: log
        required: true
        schema:
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: Log added
          schema:
            $ref: '#/definitions/models.Log'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Add log entry
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/start:
    post:
      consumes:
      - application/json
      description: Start logging for a session (marks as active) for the authenticated
        user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Session started
          schema:
            $ref: '#/definitions/models.LoggingSession'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Start session logging
      tags:
      - sessions
  /api/v1/actions/sessions/{sessionID}/timeline:
    get:
      consumes:
      - application/json
      description: Retrieve a unified timeline of all logs and clips sorted chronologically
        for the authenticated user's organization
      parameters:
      - description: Session ID
        in: path
        name: sessionID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Array of timeline items representing logs and clips
          schema:
            items:
              $ref: '#/definitions/models.TimelineItem'
            type: array
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Session not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get session timeline
      tags:
      - sessions
  /api/v1/actions/train:
    post:
      consumes:
      - multipart/form-data
      description: Start a new LLM fine-tuning job with uploaded dataset for the authenticated
        user's organization
      parameters:
      - description: Training dataset file (JSONL or TXT)
        in: formData
        name: dataset_file
        required: true
        type: file
      - default: TinyLlama/TinyLlama-1.1B-Chat-v1.0
        description: HuggingFace model ID
        in: formData
        name: model_id
        type: string
      - default: finetuned
        description: Output model name
        in: formData
        name: output_name
        type: string
      - default: 1
        description: Number of training epochs
        in: formData
        name: epochs
        type: integer
      - default: 1
        description: Training batch size
        in: formData
        name: batch_size
        type: integer
      - default: 1e-05
        description: Learning rate
        in: formData
        name: learning_rate
        type: number
      - default: true
        description: Use LoRA for fine-tuning
        in: formData
        name: use_lora
        type: boolean
      - default: 8
        description: LoRA rank
        in: formData
        name: lora_r
        type: integer
      - default: 32
        description: LoRA alpha
        in: formData
        name: lora_alpha
        type: integer
      - default: 256
        description: Maximum sequence length
        in: formData
        name: max_seq_length
        type: integer
      - default: 0.1
        description: Evaluation split ratio
        in: formData
        name: eval_split
        type: number
      produces:
      - application/json
      responses:
        "200":
          description: Training job started
          schema:
            $ref: '#/definitions/models.StartTrainingResponse'
        "400":
          description: Invalid request
          schema:
            $ref: '#/definitions/models.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Start LLM training
      tags:
      - training
  /api/v1/actions/train/jobs:
    get:
      consumes:
      - application/json
      description: Fetch all training jobs for the authenticated user's organization
      produces:
      - application/json
      responses:
        "200":
          description: List of training jobs
          schema:
            $ref: '#/definitions/models.ListJobsResponse'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get training jobs
      tags:
      - training
  /api/v1/actions/train/jobs/{jobID}:
    delete:
      consumes:
      - application/json
      description: Cancel a running training job by ID for the authenticated user's
        organization
      parameters:
      - description: Training Job ID
        in: path
        name: jobID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Job cancelled
          schema:
            $ref: '#/definitions/models.CancelTrainingResponse'
        "400":
          description: Invalid request or cannot cancel
          schema:
            $ref: '#/definitions/models.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Job not found
          schema:
            $ref: '#/definitions/models.ErrorResponse'
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Cancel training job
      tags:
      - training
    get:
      consumes:
      - application/json
      description: Fetch a specific training job status by ID for the authenticated
        user's organization
      parameters:
      - description: Training Job ID
        in: path
        name: jobID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Training job status
          schema:
            $ref: '#/definitions/models.TrainingJobStatus'
        "400":
          description: Invalid request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Job not found
          schema:
            $ref: '#/definitions/models.ErrorResponse'
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get training job status
      tags:
      - training
  /api/v1/actions/train/rollback/{jobID}:
    post:
      consumes:
      - application/json
      description: Overwrite and rollback to a previous job for the authenticated
        user's organization
      parameters:
      - description: Training Job ID
        in: path
        name: jobID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Job rolledback
          schema:
            $ref: '#/definitions/models.RollbackResponse'
        "400":
          description: Invalid request or cannot rollback
          schema:
            $ref: '#/definitions/models.ErrorResponse'
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Job not found
          schema:
            $ref: '#/definitions/models.ErrorResponse'
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Rollback a job
      tags:
      - training
  /api/v1/actions/vision/buffer/{cameraID}:
    delete:
      consumes:
      - application/json
      description: Delete all buffered frames for a specific camera for the authenticated
        user's organization
      parameters:
      - description: Camera ID
        in: path
        name: cameraID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Buffer deleted successfully
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "500":
          description: Failed to delete buffer
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Delete camera buffer
      tags:
      - vision
  /api/v1/actions/vision/buffer/{cameraID}/frames/last/{seconds}:
    get:
      consumes:
      - application/json
      description: Retrieve frame metadata from the last N seconds for a camera for
        the authenticated user's organization
      parameters:
      - description: Camera ID
        in: path
        name: cameraID
        required: true
        type: string
      - description: Number of seconds (1-600)
        in: path
        name: seconds
        required: true
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: Frame metadata from last N seconds
          schema:
            type: object
        "400":
          description: Invalid seconds parameter
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: No frames found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get last N seconds of frames
      tags:
      - vision
  /api/v1/actions/vision/buffer/{cameraID}/frames/range:
    get:
      consumes:
      - application/json
      description: Retrieve frame metadata within a specific Unix timestamp range
        for the authenticated user's organization
      parameters:
      - description: Camera ID
        in: path
        name: cameraID
        required: true
        type: string
      - description: Start Unix timestamp
        in: query
        name: start_time
        required: true
        type: number
      - description: End Unix timestamp
        in: query
        name: end_time
        required: true
        type: number
      produces:
      - application/json
      responses:
        "200":
          description: Frame metadata within time range
          schema:
            type: object
        "400":
          description: Invalid time range
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: No frames found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get frames by time range
      tags:
      - vision
  /api/v1/actions/vision/buffer/{cameraID}/info:
    get:
      consumes:
      - application/json
      description: Get frame buffer information including stream length and entry
        IDs for the authenticated user's organization
      parameters:
      - description: Camera ID
        in: path
        name: cameraID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Buffer information with length and entry IDs
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Buffer not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get buffer information
      tags:
      - vision
  /api/v1/actions/vision/cameras/active:
    get:
      consumes:
      - application/json
      description: Retrieve the currently active camera from the vision service for
        the authenticated user's organization
      produces:
      - application/json
      responses:
        "200":
          description: Active camera retrieved
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get active camera
      tags:
      - vision
  /api/v1/actions/vision/cameras/change:
    post:
      consumes:
      - application/json
      description: Switch the active camera being used for streaming in the vision
        service for the authenticated user's organization
      parameters:
      - description: Camera selection
        in: body
        name: camera
        required: true
        schema:
          properties:
            camera_id:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: Camera switched successfully
          schema:
            type: object
        "400":
          description: Invalid request body
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Switch camera
      tags:
      - vision
  /api/v1/actions/vision/cameras/connected:
    get:
      consumes:
      - application/json
      description: Retrieve a list of currently connected cameras from the vision
        service for the authenticated user's organization
      produces:
      - application/json
      responses:
        "200":
          description: Connected cameras retrieved
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get connected cameras
      tags:
      - vision
  /api/v1/actions/vision/cameras/list:
    get:
      consumes:
      - application/json
      description: Retrieve a list of all available cameras from the vision service
        for the authenticated user's organization
      produces:
      - application/json
      responses:
        "200":
          description: Available cameras retrieved
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get available cameras
      tags:
      - vision
  /api/v1/actions/vision/clips:
    get:
      consumes:
      - application/json
      description: List all video clips for the authenticated user's organization,
        optionally filtered by camera ID
      parameters:
      - description: Filter by camera ID
        in: query
        name: camera_id
        type: string
      - description: 'Maximum number of clips to return (default: 50)'
        in: query
        name: limit
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: List of clips with metadata
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: List clips
      tags:
      - vision
  /api/v1/actions/vision/clips/{clipID}:
    delete:
      consumes:
      - application/json
      description: Delete a video clip and its associated file from storage for the
        authenticated user's organization
      parameters:
      - description: Clip ID
        in: path
        name: clipID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Clip deleted successfully
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Clip not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Delete clip
      tags:
      - vision
    get:
      consumes:
      - application/json
      description: Retrieve metadata and information for a specific video clip for
        the authenticated user's organization
      parameters:
      - description: Clip ID
        in: path
        name: clipID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Clip metadata with tags, notes, and associated events
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Clip not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get clip by ID
      tags:
      - vision
  /api/v1/actions/vision/clips/{clipID}/associations:
    patch:
      consumes:
      - application/json
      description: Update tags, notes, and associated events for an existing clip
        for the authenticated user's organization
      parameters:
      - description: Clip ID
        in: path
        name: clipID
        required: true
        type: string
      - description: Association updates
        in: body
        name: associations
        required: true
        schema:
          properties:
            associated_events:
              type: array
            notes:
              type: string
            tags:
              type: array
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: Updated clip metadata
          schema:
            type: object
        "400":
          description: Invalid request body
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "404":
          description: Clip not found
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Update clip associations
      tags:
      - vision
  /api/v1/actions/vision/clips/create:
    post:
      consumes:
      - application/json
      description: Generate a video clip from buffered frames for a specific camera
        for the authenticated user's organization
      parameters:
      - description: Clip request
        in: body
        name: clipRequest
        required: true
        schema:
          properties:
            associated_events:
              type: array
            camera_id:
              type: string
            duration_seconds:
              type: integer
            fps:
              type: integer
            notes:
              type: string
            start_time:
              type: number
            tags:
              type: array
            title:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: Clip created successfully with clip_id and metadata
          schema:
            type: object
        "400":
          description: Invalid request body
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Create video clip
      tags:
      - vision
  /api/v1/actions/vision/detection/disable:
    post:
      consumes:
      - application/json
      description: Disable YOLO object detection for the authenticated user's organization
        - frames still buffered but no inference runs
      produces:
      - application/json
      responses:
        "200":
          description: Detection disabled
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Disable object detection
      tags:
      - vision
  /api/v1/actions/vision/detection/enable:
    post:
      consumes:
      - application/json
      description: Enable YOLO object detection for all incoming video frames for
        the authenticated user's organization
      produces:
      - application/json
      responses:
        "200":
          description: Detection enabled
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Enable object detection
      tags:
      - vision
  /api/v1/actions/vision/detection/status:
    get:
      consumes:
      - application/json
      description: Get current object detection status (enabled or disabled) for the
        authenticated user's organization
      produces:
      - application/json
      responses:
        "200":
          description: Detection status with enabled boolean
          schema:
            type: object
        "400":
          description: Bad request
          schema:
            type: string
        "401":
          description: Unauthorized
          schema:
            type: string
        "503":
          description: Service unavailable
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get detection status
      tags:
      - vision
  /api/v1/internal/config/org:
    delete:
      consumes:
      - application/json
      description: Remove an organization configuration from the system
      parameters:
      - description: Organization ID
        in: body
        name: input
        required: true
        schema:
          properties:
            orgId:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "204":
          description: Organization configuration deleted successfully
        "400":
          description: Invalid request body or missing orgId
          schema:
            type: string
        "404":
          description: Org config not found
          schema:
            type: string
        "500":
          description: Failed to delete org config
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Delete organization configuration
      tags:
      - configs
    post:
      consumes:
      - application/json
      description: Store necessary information about an organization including license
        type and enterprise contract details
      parameters:
      - description: Organization configuration details
        in: body
        name: input
        required: true
        schema:
          properties:
            enterpriseContract:
              type: object
            licenseType:
              type: string
            memberId:
              type: string
            name:
              type: string
            orgId:
              type: string
            organizationType:
              type: string
            serverHostUrl:
              type: string
            slug:
              type: string
            userId:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "201":
          description: Successfully created organization configuration
          schema:
            $ref: '#/definitions/models.OrgConfig'
        "400":
          description: Invalid request body or missing required fields
          schema:
            type: string
        "500":
          description: Failed to create org config
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Create organization configuration
      tags:
      - configs
    put:
      consumes:
      - application/json
      description: Update server host URL and other organization settings
      parameters:
      - description: Organization configuration update details
        in: body
        name: input
        required: true
        schema:
          properties:
            enterpriseContract:
              type: object
            licenseType:
              type: string
            orgId:
              type: string
            organizationType:
              type: string
            serverHostUrl:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: Successfully updated organization configuration
          schema:
            $ref: '#/definitions/models.OrgConfig'
        "400":
          description: Invalid request body or missing required fields
          schema:
            type: string
        "404":
          description: Org config not found
          schema:
            type: string
        "500":
          description: Failed to update org config
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Update organization configuration
      tags:
      - configs
  /api/v1/internal/config/team:
    delete:
      consumes:
      - application/json
      description: Remove a team configuration from the system
      parameters:
      - description: Team ID
        in: body
        name: input
        required: true
        schema:
          properties:
            teamId:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "204":
          description: Team configuration deleted successfully
        "400":
          description: Invalid request body or missing teamId
          schema:
            type: string
        "404":
          description: Team config not found
          schema:
            type: string
        "500":
          description: Failed to delete team config
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Delete team configuration
      tags:
      - configs
    post:
      consumes:
      - application/json
      description: Store information about a team within an organization
      parameters:
      - description: Team configuration details
        in: body
        name: input
        required: true
        schema:
          properties:
            name:
              type: string
            orgId:
              type: string
            userId:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "201":
          description: Successfully created team configuration
          schema:
            $ref: '#/definitions/models.TeamConfig'
        "400":
          description: Invalid request body or missing orgId
          schema:
            type: string
        "500":
          description: Failed to create team config
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Create team configuration
      tags:
      - configs
    put:
      consumes:
      - application/json
      description: Update team name and other settings
      parameters:
      - description: Team configuration update details
        in: body
        name: input
        required: true
        schema:
          properties:
            name:
              type: string
            teamId:
              type: string
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: Successfully updated team configuration
          schema:
            $ref: '#/definitions/models.TeamConfig'
        "400":
          description: Invalid request body or missing teamId
          schema:
            type: string
        "404":
          description: Team config not found
          schema:
            type: string
        "500":
          description: Failed to update team config
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Update team configuration
      tags:
      - configs
  /organizations/{organizationSlug}/pipeline/forms/{formID}:
    get:
      consumes:
      - application/json
      description: Retrieve a session form by its ID
      parameters:
      - description: Organization Slug
        in: path
        name: organizationSlug
        required: true
        type: string
      - description: Form ID
        in: path
        name: formID
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: Session form
          schema:
            $ref: '#/definitions/models.SessionForm'
        "404":
          description: Form not found
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: Get session form
      tags:
      - session-forms
  /organizations/{organizationSlug}/pipeline/sessions:
    get:
      consumes:
      - application/json
      description: List all logging sessions for an organization
      parameters:
      - description: Organization Slug
        in: path
        name: organizationSlug
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: List of sessions
          schema:
            items:
              $ref: '#/definitions/models.LoggingSession'
            type: array
        "400":
          description: Invalid request
          schema:
            type: string
        "500":
          description: Internal server error
          schema:
            type: string
      security:
      - BearerAuth: []
      summary: List all sessions
      tags:
      - sessions
schemes:
- http
- https
securityDefinitions:
  BearerAuth:
    description: Type "Bearer" followed by a space and JWT token from Better Auth.
    in: header
    name: Authorization
    type: apiKey
swagger: "2.0"
