openapi: 3.0.0
info:
  title: Agenticey AI API
  description: AI-powered business intelligence platform API for accessing business information, FAQs, products, and services
  version: 1.0.0
  contact:
    email: support@agenticey.com
servers:
  - url: https://agenticey.com
    description: Production server
paths:
  /api/v1/agentic/chat:
    post:
      operationId: agent_chat
      summary: Chat with AI agent
      description: Send a query to the AI agent and get intelligent responses about business information
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  description: The user's query or message
                site:
                  type: string
                  description: Site identifier for the business
                context:
                  type: object
                  description: Optional context for the conversation
              required:
                - message
                - site
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  answer:
                    type: string
                    description: AI-generated response
                  sources:
                    type: array
                    items:
                      type: object
                      properties:
                        title:
                          type: string
                        url:
                          type: string
                        content:
                          type: string
                  actions:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        label:
                          type: string
                        url:
                          type: string
        '400':
          description: Bad request
        '429':
          description: Rate limit exceeded
  /api/v1/agentic/search:
    post:
      operationId: semantic_search
      summary: Semantic search
      description: Perform semantic search through business knowledge base
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  description: Search query
                site:
                  type: string
                  description: Site identifier
                limit:
                  type: integer
                  default: 10
                  description: Maximum number of results
              required:
                - query
                - site
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        title:
                          type: string
                        content:
                          type: string
                        score:
                          type: number
                        source:
                          type: string
  /api/v1/agentic/status:
    get:
      operationId: get_status
      summary: Get API status
      description: Get current API status and health information
      parameters:
        - name: site
          in: query
          required: true
          schema:
            type: string
          description: Site identifier
      responses:
        '200':
          description: Status information
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  site_id:
                    type: string
                  capabilities:
                    type: array
                    items:
                      type: string
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Agent-Key
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string