---
openapi: 3.1.0
paths:
  /api/admin/capabilities:
    get:
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CapabilityDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: List Capabilities
      tags:
      - Capability Catalog Resource
      security:
      - SecurityScheme:
        - fsaap-admin
    post:
      parameters:
      - name: x-correlation-id
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateCapabilityDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapabilityDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Capability
      tags:
      - Capability Catalog Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/admin/capabilities/{capabilityId}:
    put:
      parameters:
      - name: capabilityId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: x-correlation-id
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateCapabilityDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapabilityDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Capability
      tags:
      - Capability Catalog Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/admin/capabilities/{capabilityId}/audit-events:
    get:
      parameters:
      - name: capabilityId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: List Audit Events
      tags:
      - Capability Catalog Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/admin/capabilities/{capabilityId}/publish:
    post:
      parameters:
      - name: capabilityId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: x-correlation-id
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CapabilityTransitionDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapabilityDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Publish Capability
      tags:
      - Capability Catalog Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/admin/capabilities/{capabilityId}/unpublish:
    post:
      parameters:
      - name: capabilityId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: x-correlation-id
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CapabilityTransitionDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapabilityDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Unpublish Capability
      tags:
      - Capability Catalog Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/admin/graphql:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: {}
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Query
      tags:
      - Admin Capability Graphql Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/business:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateBusinessInput"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateBusinessOutput"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create
      tags:
      - Business Resource
      security:
      - SecurityScheme: []
  /api/config/frontend:
    get:
      parameters:
      - name: env
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json: {}
      summary: Get Frontend Config
      tags:
      - Frontend Config Resource
  /api/conversations:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateConversationDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ConversationDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Conversation
      tags:
      - Conversation Resource
      security:
      - SecurityScheme:
        - fsaap-admin
        - business-owner
        - business-attendant
  /api/conversations/{conversationId}/messages:
    post:
      parameters:
      - name: conversationId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateMessageDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Send Message
      tags:
      - Message Resource
      security:
      - SecurityScheme:
        - fsaap-admin
        - business-owner
        - business-attendant
  /api/conversations/{id}/history:
    get:
      parameters:
      - name: id
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Conversation History
      tags:
      - Conversation Resource
      security:
      - SecurityScheme:
        - fsaap-admin
        - business-owner
        - business-attendant
  /api/conversations/{id}/stream:
    get:
      parameters:
      - name: id
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            text/event-stream:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/SseEventDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Stream
      tags:
      - Conversation Resource
      security:
      - SecurityScheme:
        - fsaap-admin
        - business-owner
        - business-attendant
  /api/flowise/available-variables:
    get:
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AvailableVariablesResponseDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Available Variables
      tags:
      - Flowise Node Configuration Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/flowise/credentials:
    get:
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/FlowiseCredentialDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Credentials
      tags:
      - Flowise Node Configuration Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/flowise/detect-nodes:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DetectNodesRequestDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DetectNodesResponseDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Detect Nodes
      tags:
      - Flowise Node Configuration Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/n8n/execute:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/N8nWebhookRequestDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "400":
          description: Bad Request
      summary: Execute Webhook
      tags:
      - N 8n Webhook Controller
  /api/n8n/tool-templates:
    get:
      parameters:
      - name: category
        in: query
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ToolTemplateDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: List Tool Templates
      tags:
      - Tool Template Resource
      security:
      - SecurityScheme: []
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateToolTemplateDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ToolTemplateDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Tool Template
      tags:
      - Tool Template Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/n8n/tool-templates/{templateId}:
    put:
      parameters:
      - name: templateId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateToolTemplateDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ToolTemplateDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Tool Template
      tags:
      - Tool Template Resource
      security:
      - SecurityScheme:
        - fsaap-admin
    get:
      parameters:
      - name: templateId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Tool Template
      tags:
      - Tool Template Resource
      security:
      - SecurityScheme: []
    delete:
      parameters:
      - name: templateId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Delete Tool Template
      tags:
      - Tool Template Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/n8n/tools:
    get:
      parameters:
      - name: category
        in: query
        schema:
          type: string
      - name: search
        in: query
        schema:
          type: string
      - name: useCaseId
        in: query
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: List Tools
      tags:
      - N 8n Webhook Controller
      security:
      - SecurityScheme: []
  /api/onboarding/initialize:
    post:
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Initialize
      tags:
      - Onboarding Resource
      security:
      - SecurityScheme: []
  /api/public/pages/{publicSlug}/session:
    post:
      parameters:
      - name: publicSlug
        in: path
        required: true
        schema:
          type: string
      - name: x-correlation-id
        in: header
        schema:
          type: string
      - name: x-idempotency-key
        in: header
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicSessionResponse"
      summary: Create Page Session
      tags:
      - Public Use Case Access Resource
  /api/public/sessions/{sessionId}/messages:
    post:
      parameters:
      - name: sessionId
        in: path
        required: true
        schema:
          type: string
      - name: x-api-key
        in: header
        schema:
          type: string
      - name: x-correlation-id
        in: header
        schema:
          type: string
      - name: x-idempotency-key
        in: header
        schema:
          type: string
      - name: x-public-session-token
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PublicMessageRequest"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicMessageResponse"
        "400":
          description: Bad Request
      summary: Send Public Message
      tags:
      - Public Use Case Access Resource
  /api/public/sessions/{sessionId}/stream:
    get:
      parameters:
      - name: sessionId
        in: path
        required: true
        schema:
          type: string
      - name: x-api-key
        in: header
        schema:
          type: string
      - name: x-correlation-id
        in: header
        schema:
          type: string
      - name: x-public-session-token
        in: header
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            text/event-stream:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/SseEventDto"
      summary: Stream Public Session
      tags:
      - Public Use Case Access Resource
  /api/public/use-cases/{publicSlug}/sessions:
    post:
      parameters:
      - name: publicSlug
        in: path
        required: true
        schema:
          type: string
      - name: x-api-key
        in: header
        schema:
          type: string
      - name: x-correlation-id
        in: header
        schema:
          type: string
      - name: x-idempotency-key
        in: header
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicSessionResponse"
      summary: Create Api Session
      tags:
      - Public Use Case Access Resource
  /api/public/widget/session:
    post:
      parameters:
      - name: x-correlation-id
        in: header
        schema:
          type: string
      - name: x-idempotency-key
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WidgetSessionRequest"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicSessionResponse"
        "400":
          description: Bad Request
      summary: Create Widget Session
      tags:
      - Public Use Case Access Resource
  /api/tenant/graphql:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: {}
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Query
      tags:
      - Tenant Capability Graphql Resource
      security:
      - SecurityScheme: []
  /api/tools:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateToolDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ToolDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Tool
      tags:
      - Tool Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/tools/base-workflow:
    put:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateBaseWorkflowConfigurationDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BaseWorkflowConfigurationDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Base Workflow
      tags:
      - Base Workflow Configuration Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/tools/{toolId}:
    put:
      parameters:
      - name: toolId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateToolDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ToolDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Tool
      tags:
      - Tool Resource
      security:
      - SecurityScheme:
        - fsaap-admin
    delete:
      parameters:
      - name: toolId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Delete Tool
      tags:
      - Tool Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/use-case-templates:
    get:
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/UseCaseTemplateDto"
      summary: List Templates
      tags:
      - Use Case Template Resource
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateUseCaseTemplateDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseTemplateDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Template
      tags:
      - Use Case Template Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/use-case-templates/default:
    get:
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseTemplateDto"
      summary: Get Default Template
      tags:
      - Use Case Template Resource
  /api/use-case-templates/{templateId}:
    put:
      parameters:
      - name: templateId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateUseCaseTemplateDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseTemplateDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Template
      tags:
      - Use Case Template Resource
      security:
      - SecurityScheme:
        - fsaap-admin
    get:
      parameters:
      - name: templateId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseTemplateDto"
      summary: Get Template
      tags:
      - Use Case Template Resource
    delete:
      parameters:
      - name: templateId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Delete Template
      tags:
      - Use Case Template Resource
      security:
      - SecurityScheme:
        - fsaap-admin
  /api/use-cases/from-template/{templateId}:
    post:
      parameters:
      - name: templateId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateUseCaseFromTemplateDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Use Case From Template
      tags:
      - Use Case Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}:
    put:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateUseCaseDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Use Case
      tags:
      - Use Case Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/agent-instructions:
    put:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgentInstructionsDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentInstructionsDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Agent Instructions
      tags:
      - Agent Instructions Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/agent-instructions/active-versions:
    put:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ActiveVersionsDto"
        required: true
      responses:
        "204":
          description: No Content
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Set Active Versions
      tags:
      - Agent Instructions Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/agent-instructions/sync:
    post:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "201":
          description: Created
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Synchronize Prompts
      tags:
      - Agent Instructions Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/agent-instructions/versions:
    post:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreatePromptVersionDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PromptVersionDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Version
      tags:
      - Agent Instructions Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/agent-instructions/versions/{version}/draft:
    put:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: version
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdatePromptVersionDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PromptVersionDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Draft Version
      tags:
      - Agent Instructions Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/agent-instructions/versions/{version}/publish:
    post:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: version
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PromptVersionDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Publish Version
      tags:
      - Agent Instructions Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/agent-instructions/versions/{version}/test:
    post:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: version
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestDraftVersionDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Test Draft Version
      tags:
      - Agent Instructions Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/chatflows:
    get:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: List Chatflows
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme:
        - fsaap-admin
    post:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FlowiseChatflowDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Chatflow
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme: []
  /api/use-cases/{useCaseId}/chatflows/associate-manual:
    post:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ManualChatflowAssociationDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Associate Chatflow Manually
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme: []
  /api/use-cases/{useCaseId}/chatflows/{chatflowId}:
    put:
      parameters:
      - name: chatflowId
        in: path
        required: true
        schema:
          type: string
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FlowiseChatflowDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Chatflow
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme: []
    get:
      parameters:
      - name: chatflowId
        in: path
        required: true
        schema:
          type: string
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Chatflow
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme: []
    delete:
      parameters:
      - name: chatflowId
        in: path
        required: true
        schema:
          type: string
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Delete Chatflow
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme: []
  /api/use-cases/{useCaseId}/chatflows/{chatflowId}/chat:
    post:
      parameters:
      - name: chatflowId
        in: path
        required: true
        schema:
          type: string
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FlowiseChatRequestDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Execute Chatflow
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme: []
  /api/use-cases/{useCaseId}/chatflows/{chatflowId}/configure-override-config:
    post:
      parameters:
      - name: chatflowId
        in: path
        required: true
        schema:
          type: string
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Configure Override Config
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme: []
  /api/use-cases/{useCaseId}/chatflows/{chatflowId}/replace:
    put:
      parameters:
      - name: chatflowId
        in: path
        required: true
        schema:
          type: string
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChatflowUpdateDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Replace Chatflow
      tags:
      - Chatflow Resource
      security:
      - SecurityScheme: []
  /api/use-cases/{useCaseId}/configuration:
    put:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: x-correlation-id
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UseCaseConfigurationDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseConfigurationDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Configuration
      tags:
      - Use Case Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/n8n/workflows:
    get:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: List Workflows
      tags:
      - N 8n Workflow Resource
      security:
      - SecurityScheme:
        - fsaap-admin
    post:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/N8nWorkflowDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Workflow
      tags:
      - N 8n Workflow Resource
      security:
      - SecurityScheme: []
  /api/use-cases/{useCaseId}/n8n/workflows/{workflowId}:
    put:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: workflowId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/N8nWorkflowDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Workflow
      tags:
      - N 8n Workflow Resource
      security:
      - SecurityScheme: []
    get:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: workflowId
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Workflow
      tags:
      - N 8n Workflow Resource
      security:
      - SecurityScheme: []
    delete:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: workflowId
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json: {}
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Delete Workflow
      tags:
      - N 8n Workflow Resource
      security:
      - SecurityScheme: []
  /api/use-cases/{useCaseId}/public-access-policy:
    put:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: x-correlation-id
        in: header
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdatePublicAccessPolicyDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicAccessPolicyDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Public Access Policy
      tags:
      - Use Case Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
    get:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PublicAccessPolicyDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Public Access Policy
      tags:
      - Use Case Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/runtime-published-version-diagnostics:
    get:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: x-correlation-id
        in: header
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RuntimePublishedVersionDiagnosticsDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Runtime Published Version Diagnostics
      tags:
      - Use Case Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/tools:
    get:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/UseCaseToolDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: List Tools For Use Case
      tags:
      - Use Case Tool Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
    post:
      parameters:
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AddToolToUseCaseDto"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseConfigurationDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Add Tool To Use Case
      tags:
      - Use Case Tool Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
  /api/use-cases/{useCaseId}/tools/{toolTemplateId}:
    delete:
      parameters:
      - name: toolTemplateId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      - name: useCaseId
        in: path
        required: true
        schema:
          $ref: "#/components/schemas/UUID"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UseCaseConfigurationDto"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Remove Tool From Use Case
      tags:
      - Use Case Tool Resource
      security:
      - SecurityScheme:
        - business-owner
        - business-admin
components:
  schemas:
    ActiveVersionsDto:
      type: object
      properties:
        versions:
          type: array
          items:
            type: string
    AddToolToUseCaseDto:
      type: object
      properties:
        toolTemplateId:
          $ref: "#/components/schemas/UUID"
    AgentInstructionsDto:
      type: object
      properties:
        versions:
          type: array
          items:
            $ref: "#/components/schemas/PromptVersionDto"
        activeVersions:
          type: array
          items:
            type: string
        defaultVersion:
          type: string
        distributionMethod:
          type: string
    AvailableVariableDto:
      type: object
      properties:
        name:
          type: string
        displayName:
          type: string
        description:
          type: string
        type:
          type: string
        example:
          type: string
    AvailableVariablesResponseDto:
      type: object
      properties:
        availableVariables:
          type: array
          items:
            $ref: "#/components/schemas/AvailableVariableDto"
    BaseWorkflowConfigurationDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        name:
          type: string
        n8nWorkflowConfiguration:
          type: object
          additionalProperties: {}
        version:
          type: integer
          format: int32
        createdBy:
          $ref: "#/components/schemas/UUID"
    BusinessDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        name:
          type: string
        contactEmail:
          type: string
        contactPhone:
          type: string
        timezone:
          type: string
        defaultLanguage:
          type: string
        subscriptionTier:
          type: string
        ownerUserId:
          $ref: "#/components/schemas/UUID"
    CapabilityDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        key:
          type: string
        name:
          type: string
        description:
          type: string
        authType:
          type: string
        authMetadata:
          type: object
          additionalProperties: {}
        publicationState:
          type: string
        governance:
          $ref: "#/components/schemas/CapabilityGovernanceDto"
    CapabilityGovernanceDto:
      type: object
      properties:
        createdBy:
          $ref: "#/components/schemas/UUID"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        publishedBy:
          $ref: "#/components/schemas/UUID"
        publishedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        unpublishedBy:
          $ref: "#/components/schemas/UUID"
        unpublishedAt:
          $ref: "#/components/schemas/OffsetDateTime"
    CapabilityTransitionDto:
      type: object
      properties:
        reason:
          type: string
    ChatflowUpdateDto:
      type: object
      properties:
        newChatflowId:
          type: string
        newChatflowName:
          type: string
    ConversationDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        organizationId:
          $ref: "#/components/schemas/UUID"
        useCaseId:
          $ref: "#/components/schemas/UUID"
        userId:
          $ref: "#/components/schemas/UUID"
        status:
          type: string
        metadata:
          type: object
          additionalProperties: {}
    CreateBusinessInput:
      type: object
      properties:
        name:
          type: string
        contactEmail:
          type: string
        contactPhone:
          type: string
        timezone:
          type: string
        defaultLanguage:
          type: string
        subscriptionTier:
          type: string
    CreateBusinessOutput:
      type: object
      properties:
        business:
          $ref: "#/components/schemas/BusinessDto"
        auditLogId:
          $ref: "#/components/schemas/UUID"
    CreateCapabilityDto:
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        description:
          type: string
        authType:
          type: string
        authMetadata:
          type: object
          additionalProperties: {}
    CreateConversationDto:
      type: object
      properties:
        useCaseId:
          $ref: "#/components/schemas/UUID"
    CreateMessageDto:
      type: object
      properties:
        content:
          type: string
        fileUploads:
          type: array
          items:
            $ref: "#/components/schemas/FileUploadDto"
    CreatePromptVersionDto:
      type: object
      properties:
        systemPrompt:
          type: string
        usePrompt:
          type: string
        customizations:
          type: object
          additionalProperties: {}
        baseVersion:
          type: string
    CreateToolDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        category:
          type: string
        n8nWorkflowConfiguration:
          type: object
          additionalProperties: {}
        isPublic:
          type: boolean
        businessId:
          $ref: "#/components/schemas/UUID"
    CreateToolTemplateDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        category:
          type: string
        workflowName:
          type: string
        workflowJson:
          type: object
          additionalProperties: {}
        isPublic:
          type: boolean
        businessId:
          $ref: "#/components/schemas/UUID"
    CreateUseCaseFromTemplateDto:
      type: object
      properties:
        useCaseName:
          type: string
        customVariables:
          type: object
          additionalProperties:
            type: string
        customizations:
          type: object
          additionalProperties: {}
    CreateUseCaseTemplateDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        useCaseType:
          type: string
        configuration:
          type: object
          additionalProperties: {}
        businessId:
          $ref: "#/components/schemas/UUID"
    DetectNodesRequestDto:
      type: object
      properties:
        workflowJson: {}
    DetectNodesResponseDto:
      type: object
      properties:
        detectedNodes:
          type: array
          items:
            $ref: "#/components/schemas/DetectedNodeDto"
    DetectedNodeDto:
      type: object
      properties:
        nodeId:
          type: string
        nodeType:
          type: string
        nodeName:
          type: string
        requiresCredential:
          type: boolean
        currentCredentialId:
          type: string
        credentialNames:
          type: array
          items:
            type: string
        preferredCredentialName:
          type: string
    FileUploadDto:
      type: object
      properties:
        fileId:
          $ref: "#/components/schemas/UUID"
        filename:
          type: string
        contentType:
          type: string
        size:
          type: integer
          format: int64
        base64Data:
          type: string
        assetId:
          $ref: "#/components/schemas/UUID"
    FileUploadItem:
      type: object
      properties:
        data:
          type: string
        type:
          type: string
        name:
          type: string
        mime:
          type: string
    FlowiseChatRequestDto:
      type: object
      properties:
        question:
          type: string
        overrideConfig:
          type: object
          additionalProperties: {}
        chatId:
          type: string
        streaming:
          type: boolean
        uploads:
          type: array
          items:
            $ref: "#/components/schemas/FileUploadItem"
    FlowiseChatflowDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        flowData:
          type: object
          additionalProperties: {}
        metadata:
          type: object
          additionalProperties: {}
        isPublic:
          type: boolean
        type:
          type: string
        apiConfig:
          type: string
    FlowiseCredentialDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        credentialName:
          type: string
        workspaceId:
          type: string
    ManualChatflowAssociationDto:
      type: object
      properties:
        chatflowId:
          type: string
        chatflowName:
          type: string
    MessageDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        conversationId:
          $ref: "#/components/schemas/UUID"
        role:
          type: string
        content:
          type: string
        metadata:
          type: object
          additionalProperties: {}
    N8nContextDto:
      type: object
      properties:
        useCaseId:
          $ref: "#/components/schemas/UUID"
        conversationId:
          $ref: "#/components/schemas/UUID"
        organizationId:
          $ref: "#/components/schemas/UUID"
    N8nWebhookRequestDto:
      type: object
      properties:
        action:
          type: string
        workflowId:
          type: string
        parameters:
          type: object
          additionalProperties: {}
        context:
          $ref: "#/components/schemas/N8nContextDto"
    N8nWorkflowDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        nodes:
          type: array
          items:
            type: object
            additionalProperties: {}
        connections:
          type: object
          additionalProperties: {}
        active:
          type: boolean
        settings:
          type: object
          additionalProperties: {}
        tags:
          type: array
          items:
            type: string
    OffsetDateTime:
      type: string
      format: date-time
      examples:
      - 2022-03-10T12:15:50-04:00
    PromptVersionDto:
      type: object
      properties:
        version:
          type: string
        status:
          type: string
        systemPrompt:
          type: string
        usePrompt:
          type: string
        customizations:
          type: object
          additionalProperties: {}
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdBy:
          $ref: "#/components/schemas/UUID"
        publishedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        publishedBy:
          $ref: "#/components/schemas/UUID"
    PublicAccessPolicyDto:
      type: object
      properties:
        useCaseId:
          $ref: "#/components/schemas/UUID"
        publicAccessEnabled:
          type: boolean
        publicSlug:
          type: string
        publicGreeting:
          type: string
        publicSessionDuration:
          type: integer
          format: int32
        publicFileUploadAllowed:
          type: boolean
        publicWidgetConfig:
          type: object
          additionalProperties: {}
        publicApiKeyEnabled:
          type: boolean
        publicPageUrl:
          type: string
        widgetEmbedSnippet:
          type: string
    PublicMessageItem:
      type: object
      properties:
        id:
          type: string
        role:
          type: string
        content:
          type: string
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
    PublicMessageRequest:
      type: object
      properties:
        useCaseSlug:
          type: string
        content:
          type: string
    PublicMessageResponse:
      type: object
      properties:
        sessionId:
          type: string
        messageId:
          type: string
        response:
          $ref: "#/components/schemas/PublicMessageItem"
        correlationId:
          type: string
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        metadata:
          type: object
          additionalProperties: {}
    PublicSessionResponse:
      type: object
      properties:
        sessionId:
          type: string
        useCaseId:
          $ref: "#/components/schemas/UUID"
        useCaseSlug:
          type: string
        entryPoint:
          type: string
        correlationId:
          type: string
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        sessionTtlSeconds:
          type: integer
          format: int32
        publicGreeting:
          type: string
        agentDisplayName:
          type: string
        metadata:
          type: object
          additionalProperties: {}
    RuntimePublishedVersionDiagnosticsDto:
      type: object
      properties:
        useCaseId:
          $ref: "#/components/schemas/UUID"
        tenantId:
          $ref: "#/components/schemas/UUID"
        actor:
          type: string
        activePublishedVersion:
          type: string
        versionStatus:
          type: string
        publishedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        publishedBy:
          $ref: "#/components/schemas/UUID"
        occurredAt:
          $ref: "#/components/schemas/OffsetDateTime"
        correlationId:
          type: string
    SseEventDto:
      type: object
      properties:
        type:
          type: string
        message:
          $ref: "#/components/schemas/MessageDto"
        errorMessage:
          type: string
        errorCode:
          type: string
        remediation:
          type: string
        messageText:
          type: string
        streamId:
          type: string
        conversationId:
          type: string
        messageId:
          type: string
    TestDraftVersionDto:
      type: object
      properties:
        message:
          type: string
    ToolDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        name:
          type: string
        description:
          type: string
        category:
          type: string
        n8nWorkflowConfiguration:
          type: object
          additionalProperties: {}
        isPublic:
          type: boolean
        businessId:
          $ref: "#/components/schemas/UUID"
        createdBy:
          $ref: "#/components/schemas/UUID"
    ToolTemplateDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        name:
          type: string
        description:
          type: string
        category:
          type: string
        workflowName:
          type: string
        workflowJson:
          type: object
          additionalProperties: {}
        isPublic:
          type: boolean
        businessId:
          $ref: "#/components/schemas/UUID"
        createdBy:
          $ref: "#/components/schemas/UUID"
    UUID:
      type: string
      format: uuid
      pattern: "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"
    UpdateBaseWorkflowConfigurationDto:
      type: object
      properties:
        name:
          type: string
        n8nWorkflowConfiguration:
          type: object
          additionalProperties: {}
    UpdateCapabilityDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        authType:
          type: string
        authMetadata:
          type: object
          additionalProperties: {}
    UpdatePromptVersionDto:
      type: object
      properties:
        systemPrompt:
          type: string
        usePrompt:
          type: string
        customizations:
          type: object
          additionalProperties: {}
    UpdatePublicAccessPolicyDto:
      type: object
      properties:
        publicAccessEnabled:
          type: boolean
        publicSlug:
          type: string
        publicGreeting:
          type: string
        publicSessionDuration:
          type: integer
          format: int32
        publicFileUploadAllowed:
          type: boolean
        publicWidgetConfig:
          type: object
          additionalProperties: {}
        publicApiKeyEnabled:
          type: boolean
    UpdateToolDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        category:
          type: string
        n8nWorkflowConfiguration:
          type: object
          additionalProperties: {}
        isPublic:
          type: boolean
        businessId:
          $ref: "#/components/schemas/UUID"
    UpdateToolTemplateDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        category:
          type: string
        workflowName:
          type: string
        workflowJson:
          type: object
          additionalProperties: {}
        isPublic:
          type: boolean
        businessId:
          $ref: "#/components/schemas/UUID"
    UpdateUseCaseDto:
      type: object
      properties:
        name:
          type: string
    UpdateUseCaseTemplateDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        configuration:
          type: object
          additionalProperties: {}
        businessId:
          $ref: "#/components/schemas/UUID"
    UseCaseConfigurationDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        useCaseId:
          $ref: "#/components/schemas/UUID"
        features:
          type: object
          additionalProperties: {}
        agentInstructions:
          type: object
          additionalProperties: {}
        flowiseWorkflowId:
          type: string
        n8nBaseWorkflowId:
          type: string
        n8nWorkflowIds:
          type: object
          additionalProperties:
            type: string
    UseCaseDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        businessId:
          $ref: "#/components/schemas/UUID"
        name:
          type: string
        useCaseType:
          type: string
        flowiseChatflowId:
          type: string
        publicAccessEnabled:
          type: boolean
        publicSlug:
          type: string
        publicGreeting:
          type: string
        publicSessionDuration:
          type: integer
          format: int32
        publicFileUploadAllowed:
          type: boolean
        publicWidgetConfig:
          type: object
          additionalProperties: {}
        publicApiKeyEnabled:
          type: boolean
        configuration:
          $ref: "#/components/schemas/UseCaseConfigurationDto"
    UseCaseTemplateDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        updatedAt:
          $ref: "#/components/schemas/OffsetDateTime"
        createdAt:
          $ref: "#/components/schemas/OffsetDateTime"
        name:
          type: string
        description:
          type: string
        useCaseType:
          type: string
        configuration:
          type: object
          additionalProperties: {}
        isSystemTemplate:
          type: boolean
        createdBy:
          $ref: "#/components/schemas/UUID"
        businessId:
          $ref: "#/components/schemas/UUID"
    UseCaseToolDto:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/UUID"
        name:
          type: string
        description:
          type: string
        n8nWorkflowId:
          type: string
        category:
          type: string
    WidgetSessionRequest:
      type: object
      properties:
        useCaseSlug:
          type: string
        userId:
          type: string
  securitySchemes:
    SecurityScheme:
      type: openIdConnect
      description: Authentication
info:
  title: fsaap-agent-api API
  version: 1.0-SNAPSHOT
servers:
- url: http://localhost:8080
  description: Auto generated value
- url: http://0.0.0.0:8080
  description: Auto generated value
