openapi: 3.0.3
info:
  title: 'Guardian Hub API'
  description: |
    REST API for the Guardian Hub platform. Manage WordPress sites, run Autopilot operations,
    handle billing/subscriptions, monitor performance, and integrate with the Guardian Plugin agent.

    ## Authentication
    Most endpoints require a **Bearer token** obtained via `POST /api/v1/login`.
    Include the token in the `Authorization` header: `Bearer {token}`.

    Public endpoints (health, ping, registration, catalog) do not require authentication.

    ## Rate Limiting
    API requests are rate-limited. Default: 60 requests/minute per authenticated user.
    Monitoring endpoints: 120 requests/minute.

    ## Base URL
    Production: `https://guardianplug.com/api/v1`
    Staging: `https://guardian.bluix.net/api/v1`
  version: 1.1.0
  contact:
    name: Guardian Hub Support
    email: support@guardianplug.com
  license:
    name: Proprietary
servers:
  -
    url: 'https://guardianplug.com'
    description: Production
  -
    url: 'https://guardian.bluix.net'
    description: Staging
tags:
  -
    name: 'AI Platform'
    description: 'AI-powered site analysis, predictions, optimization, anomaly detection, vulnerability scanning, log analysis, and credit management.'
  -
    name: Authentication
    description: 'User login, registration, social auth, and session management.'
  -
    name: 'Backup Management'
    description: 'Snapshot creation, file restoration, backup filters, file versioning, and integrity attestations.'
  -
    name: Billing
    description: 'Plan management, add-on purchases, bundle billing, payment processing, and invoice retrieval.'
  -
    name: Endpoints
    description: 'General-purpose and miscellaneous API endpoints.'
  -
    name: 'Feature Management'
    description: 'Feature flag checks, available features listing, usage statistics, and trial activation for the Guardian plugin.'
  -
    name: Monitoring
    description: 'Site health checks, metrics, alerts, risk scores, anomaly detection, and uptime monitoring.'
  -
    name: 'Partner Management'
    description: 'Reseller and partner account management, tenant assignment, and white-label administration.'
  -
    name: 'Performance Optimization'
    description: 'Automated and AI-driven performance tuning, caching configuration, and resource optimization.'
  -
    name: Security
    description: 'Vulnerability scanning, containment controls, file monitoring, integrity attestations, and incident management.'
  -
    name: 'Site Initialization'
    description: 'Secure connection handshake, token generation, and initial site registration with the Guardian Hub platform.'
  -
    name: Sites
    description: 'CRUD operations for managed WordPress sites, site refresh, scan, maintenance toggle, and member management.'
  -
    name: Subscriptions
    description: 'Subscription lifecycle management including creation, cancellation, resumption, and plan changes.'
  -
    name: 'Upgrade Management'
    description: 'Subscription upgrade initiation, payment processing, confirmation, and upgrade history.'
  -
    name: Autopilot
    description: 'Autopilot site registration, telemetry, spoke/bundle configuration, chat threads, and admin management.'
  -
    name: Notifications
    description: 'Push notification delivery, read status tracking, and notification lifecycle management.'
paths:
  '/api/v1/ai-platform/analyze/{site_id}':
    post:
      summary: 'Analyze site with AI'
      operationId: analyzeSiteWithAI
      description: 'Run a comprehensive AI-powered analysis on the specified site covering performance, security, and health metrics.'
      parameters: []
      responses:
        200:
          description: 'Analysis started successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error or insufficient credits.'
      tags:
        - 'AI Platform'
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/ai-platform/predict/{site_id}':
    post:
      summary: 'Predict issues with AI'
      operationId: predictIssuesWithAI
      description: 'Generate AI-based predictions for potential future issues on the specified site using historical data analysis.'
      parameters: []
      responses:
        200:
          description: 'Predictions generated successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error or insufficient credits.'
      tags:
        - 'AI Platform'
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/ai-platform/optimize/{site_id}':
    post:
      summary: 'Optimize site with AI'
      operationId: optimizeSiteWithAI
      description: 'Apply AI-driven optimizations to the specified site including caching, database tuning, and asset compression.'
      parameters: []
      responses:
        200:
          description: 'Optimization started successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error or insufficient credits.'
      tags:
        - 'AI Platform'
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/ai-platform/anomaly/{site_id}':
    post:
      summary: 'Detect anomalies'
      operationId: detectAnomalies
      description: 'Run anomaly detection on the specified site to identify unusual traffic patterns, error spikes, or performance degradation.'
      parameters: []
      responses:
        200:
          description: 'Anomaly detection completed.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error or insufficient credits.'
      tags:
        - 'AI Platform'
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/ai-platform/vulnerability/{site_id}':
    post:
      summary: 'Assess vulnerabilities'
      operationId: assessVulnerabilities
      description: 'Perform a vulnerability assessment on the specified site scanning for known CVEs, misconfigurations, and outdated components.'
      parameters: []
      responses:
        200:
          description: 'Vulnerability assessment completed.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error or insufficient credits.'
      tags:
        - 'AI Platform'
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/ai-platform/logs/{site_id}':
    post:
      summary: 'Analyze logs'
      operationId: analyzeLogs
      description: 'Analyze access, error, and system logs for the specified site using NLP to identify critical issues and patterns.'
      parameters: []
      responses:
        200:
          description: 'Log analysis completed.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error or insufficient credits.'
      tags:
        - 'AI Platform'
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/ai-platform/usage:
    get:
      summary: 'Get usage statistics'
      operationId: getUsageStatistics
      description: 'Retrieve AI platform usage statistics for the authenticated user including operation counts and credit consumption.'
      security:
        - bearerAuth: []
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'AI Platform'
  /api/v1/ai-platform/credits:
    get:
      summary: 'Get user credits'
      operationId: getUserCredits
      description: 'Retrieve the current credit balance and usage breakdown for the authenticated user.'
      security:
        - bearerAuth: []
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'AI Platform'
  /api/v1/ai-platform/credits/purchase:
    post:
      summary: 'Purchase credits'
      operationId: purchaseCredits
      description: 'Purchase additional AI platform credits using the selected payment method.'
      parameters: []
      responses:
        200:
          description: 'Credits purchased successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Invalid purchase request or payment failure.'
      tags:
        - 'AI Platform'
      security:
        - bearerAuth: []
  /api/v1/ai-platform/pricing:
    get:
      summary: 'Get pricing plans'
      operationId: getPricingPlans
      description: 'Retrieve available AI platform pricing plans and credit packages.'
      security:
        - bearerAuth: []
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'AI Platform'
  /api/v1/ai-platform/batch/analyze:
    post:
      summary: 'Batch analyze multiple sites'
      operationId: batchAnalyzeMultipleSites
      description: 'Submit a batch analysis job to run AI analysis across multiple sites simultaneously.'
      parameters: []
      responses:
        200:
          description: 'Batch job queued successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error or insufficient credits for batch.'
      tags:
        - 'AI Platform'
      security:
        - bearerAuth: []
  '/api/v1/ai-platform/batch/status/{jobId}':
    get:
      summary: 'Get batch job status'
      operationId: getBatchJobStatus
      description: 'Check the current status and progress of a previously submitted batch analysis job.'
      security:
        - bearerAuth: []
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'AI Platform'
    parameters:
      -
        in: path
        name: jobId
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  /api/v1/ai/analyze:
    post:
      summary: 'External API - Analyze'
      operationId: externalAPIAnalyze
      description: 'Public API endpoint to trigger an AI analysis on a site using an X-API-Key header for authentication.'
      parameters: []
      responses: {  }
      tags:
        - 'AI Platform'
      security: []
  /api/v1/ai/predict:
    post:
      summary: 'External API - Predict'
      operationId: externalAPIPredict
      description: 'Public API endpoint to generate AI predictions for a site using an X-API-Key header for authentication.'
      parameters: []
      responses: {  }
      tags:
        - 'AI Platform'
      security: []
  /api/v1/ai/optimize:
    post:
      summary: 'External API - Optimize'
      operationId: externalAPIOptimize
      description: 'Public API endpoint to trigger AI optimization on a site using an X-API-Key header for authentication.'
      parameters: []
      responses: {  }
      tags:
        - 'AI Platform'
      security: []
  '/api/guardian/sites/{site_id}/backup/snapshots':
    get:
      summary: 'Get snapshots'
      operationId: getSnapshots
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    post:
      summary: 'Create snapshot'
      operationId: createSnapshot
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot_type:
                  type: string
                  description: ''
                  example: scheduled
                  enum:
                    - manual
                    - pre_operation
                    - post_operation
                    - scheduled
                operation_type:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                operation_id:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                retention_days:
                  type: integer
                  description: 'Must be at least 1. Must not be greater than 365.'
                  example: 22
                  nullable: true
              required:
                - snapshot_type
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/backup/filters':
    post:
      summary: 'Create backup filter'
      operationId: createBackupFilter
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filter_type:
                  type: string
                  description: ''
                  example: blacklist
                  enum:
                    - whitelist
                    - blacklist
                filter_target:
                  type: string
                  description: ''
                  example: directory
                  enum:
                    - file
                    - directory
                    - pattern
                    - extension
                    - size
                filter_value:
                  type: string
                  description: 'Must not be greater than 500 characters.'
                  example: g
                description:
                  type: string
                  description: ''
                  example: 'Eius et animi quos velit et.'
                  nullable: true
                priority:
                  type: integer
                  description: 'Must be at least 0. Must not be greater than 100.'
                  example: 1
                  nullable: true
              required:
                - filter_type
                - filter_target
                - filter_value
      security: []
    delete:
      summary: 'Delete backup filter'
      operationId: deleteBackupFilter
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filter_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_backup_filters table.'
                  example: 16
              required:
                - filter_id
    get:
      summary: 'Get backup filters'
      operationId: getBackupFilters
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/backup/restore/file':
    post:
      summary: 'Restore file to version'
      operationId: restoreFileToVersion
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_path:
                  type: string
                  description: ''
                  example: architecto
                version_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_file_versions table.'
                  example: 16
              required:
                - file_path
                - version_id
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/backup/restore/full':
    post:
      summary: 'Restore full snapshot'
      operationId: restoreFullSnapshot
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_backup_snapshots table.'
                  example: 16
              required:
                - snapshot_id
      security: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/backup/file-versions':
    get:
      summary: 'Get file versions for a site'
      operationId: getFileVersionsForASite
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/backup/file-diff':
    get:
      summary: 'Get file diff'
      operationId: getFileDiff
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/backup/file-diffs':
    get:
      summary: 'Get file diffs history'
      operationId: getFileDiffsHistory
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/backup/compare-snapshots':
    get:
      summary: 'Compare snapshots'
      operationId: compareSnapshots
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  /api/guardian/backup/snapshots:
    get:
      summary: 'Get snapshots'
      operationId: getSnapshots
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    post:
      summary: 'Create snapshot'
      operationId: createSnapshot
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot_type:
                  type: string
                  description: ''
                  example: scheduled
                  enum:
                    - manual
                    - pre_operation
                    - post_operation
                    - scheduled
                operation_type:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                operation_id:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                retention_days:
                  type: integer
                  description: 'Must be at least 1. Must not be greater than 365.'
                  example: 22
                  nullable: true
              required:
                - snapshot_type
  /api/guardian/backup/restore/file:
    post:
      summary: 'Restore file to version'
      operationId: restoreFileToVersion
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_path:
                  type: string
                  description: ''
                  example: architecto
                version_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_file_versions table.'
                  example: 16
              required:
                - file_path
                - version_id
  /api/guardian/backup/restore/full:
    post:
      summary: 'Restore full snapshot'
      operationId: restoreFullSnapshot
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_backup_snapshots table.'
                  example: 16
              required:
                - snapshot_id
      security: []
  '/api/v1/sites/{site_id}/backup/snapshots':
    get:
      summary: 'Get snapshots'
      operationId: getSnapshots
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    post:
      summary: 'Create snapshot'
      operationId: createSnapshot
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot_type:
                  type: string
                  description: ''
                  example: scheduled
                  enum:
                    - manual
                    - pre_operation
                    - post_operation
                    - scheduled
                operation_type:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                operation_id:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                retention_days:
                  type: integer
                  description: 'Must be at least 1. Must not be greater than 365.'
                  example: 22
                  nullable: true
              required:
                - snapshot_type
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/backup/filters':
    post:
      summary: 'Create backup filter'
      operationId: createBackupFilter
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filter_type:
                  type: string
                  description: ''
                  example: blacklist
                  enum:
                    - whitelist
                    - blacklist
                filter_target:
                  type: string
                  description: ''
                  example: directory
                  enum:
                    - file
                    - directory
                    - pattern
                    - extension
                    - size
                filter_value:
                  type: string
                  description: 'Must not be greater than 500 characters.'
                  example: g
                description:
                  type: string
                  description: ''
                  example: 'Eius et animi quos velit et.'
                  nullable: true
                priority:
                  type: integer
                  description: 'Must be at least 0. Must not be greater than 100.'
                  example: 1
                  nullable: true
              required:
                - filter_type
                - filter_target
                - filter_value
      security: []
    delete:
      summary: 'Delete backup filter'
      operationId: deleteBackupFilter
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filter_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_backup_filters table.'
                  example: 16
              required:
                - filter_id
    get:
      summary: 'Get backup filters'
      operationId: getBackupFilters
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/backup/restore/file':
    post:
      summary: 'Restore file to version'
      operationId: restoreFileToVersion
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_path:
                  type: string
                  description: ''
                  example: architecto
                version_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_file_versions table.'
                  example: 16
              required:
                - file_path
                - version_id
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/backup/restore/full':
    post:
      summary: 'Restore full snapshot'
      operationId: restoreFullSnapshot
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_backup_snapshots table.'
                  example: 16
              required:
                - snapshot_id
      security: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/backup/file-versions':
    get:
      summary: 'Get file versions for a site'
      operationId: getFileVersionsForASite
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/backup/file-diff':
    get:
      summary: 'Get file diff'
      operationId: getFileDiff
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/backup/file-diffs':
    get:
      summary: 'Get file diffs history'
      operationId: getFileDiffsHistory
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/backup/compare-snapshots':
    get:
      summary: 'Compare snapshots'
      operationId: compareSnapshots
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/backup/snapshots:
    get:
      summary: 'Get snapshots'
      operationId: getSnapshots
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Backup Management'
    post:
      summary: 'Create snapshot'
      operationId: createSnapshot
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot_type:
                  type: string
                  description: ''
                  example: scheduled
                  enum:
                    - manual
                    - pre_operation
                    - post_operation
                    - scheduled
                operation_type:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                operation_id:
                  type: string
                  description: ''
                  example: architecto
                  nullable: true
                retention_days:
                  type: integer
                  description: 'Must be at least 1. Must not be greater than 365.'
                  example: 22
                  nullable: true
              required:
                - snapshot_type
  /api/v1/backup/restore/file:
    post:
      summary: 'Restore file to version'
      operationId: restoreFileToVersion
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_path:
                  type: string
                  description: ''
                  example: architecto
                version_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_file_versions table.'
                  example: 16
              required:
                - file_path
                - version_id
  /api/v1/backup/restore/full:
    post:
      summary: 'Restore full snapshot'
      operationId: restoreFullSnapshot
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Backup Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                snapshot_id:
                  type: integer
                  description: 'The <code>id</code> of an existing record in the guardian_backup_snapshots table.'
                  example: 16
              required:
                - snapshot_id
      security: []
  /api/guardian/health:
    get:
      summary: 'Check the health of the application.'
      operationId: checkTheHealthOfTheApplication
      description: ''
      parameters: []
      responses:
        503:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  status: error
                  message: 'Service unavailable'
                  errors:
                    status: error
                    timestamp: '2026-01-26T15:57:50+00:00'
                    services:
                      database: false
                      cache: true
                    version: 1.0.0
                properties:
                  success:
                    type: boolean
                    example: false
                  status:
                    type: string
                    example: error
                  message:
                    type: string
                    example: 'Service unavailable'
                  errors:
                    type: object
                    properties:
                      status:
                        type: string
                        example: error
                      timestamp:
                        type: string
                        example: '2026-01-26T15:57:50+00:00'
                      services:
                        type: object
                        properties:
                          database:
                            type: boolean
                            example: false
                          cache:
                            type: boolean
                            example: true
                      version:
                        type: string
                        example: 1.0.0
      tags:
        - Endpoints
      security: []
  /api/guardian/login:
    post:
      summary: 'Login user and create token'
      operationId: loginUserAndCreateToken
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/guardian/tenants:
    post:
      summary: 'Crea nuovo tenant'
      operationId: creaNuovoTenant
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  '/api/guardian/tenants/{id}':
    get:
      summary: 'Mostra tenant'
      operationId: mostraTenant
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/tenants/{tenant_id}/migrate-to-standalone':
    post:
      summary: 'Migra tenant da SaaS a Standalone'
      operationId: migraTenantDaSaaSAStandalone
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/tenants/{tenant_id}/export':
    post:
      summary: 'Export dati tenant'
      operationId: exportDatiTenant
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  /api/guardian/subscriptions:
    post:
      summary: 'Crea nuova subscription'
      operationId: creaNuovaSubscription
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  '/api/guardian/subscriptions/{subscription_id}/cancel':
    post:
      summary: 'Cancella subscription'
      operationId: cancellaSubscription
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: subscription_id
        description: 'The ID of the subscription.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/white-label/{id}':
    put:
      summary: 'Aggiorna white-label'
      operationId: aggiornaWhiteLabel
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the white label.'
        example: 16
        required: true
        schema:
          type: integer
  /api/guardian/white-label/config:
    get:
      summary: 'Get white label configuration for webapp'
      operationId: getWhiteLabelConfigurationForWebapp
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/guardian/white-label/manifest:
    get:
      summary: 'Get PWA manifest.json'
      operationId: getPWAManifestjson
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/guardian/tickets:
    get:
      summary: 'List tickets'
      operationId: listTickets
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    post:
      summary: 'Create new ticket'
      operationId: createNewTicket
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/guardian/tickets/statistics:
    get:
      summary: 'Get ticket statistics'
      operationId: getTicketStatistics
      description: 'Retrieve aggregate ticket statistics including open/closed counts and average resolution time.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  '/api/guardian/tickets/{ticket_id}':
    get:
      summary: 'Get ticket details'
      operationId: getTicketDetails
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    put:
      summary: 'Update ticket'
      operationId: updateTicket
      description: 'Update a ticket status, priority, or assignee.'
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: ticket_id
        description: 'The ID of the ticket.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/tickets/{ticket_id}/messages':
    post:
      summary: 'Add message to ticket'
      operationId: addMessageToTicket
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: ticket_id
        description: 'The ID of the ticket.'
        example: 16
        required: true
        schema:
          type: integer
  /api/guardian/notifications:
    get:
      summary: 'Get user notifications'
      operationId: getUserNotifications
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/guardian/notifications/unread-count:
    get:
      summary: 'Get unread count'
      operationId: getUnreadCount
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  '/api/guardian/notifications/{id}/read':
    post:
      summary: 'Mark notification as read'
      operationId: markNotificationAsRead
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the notification.'
        example: architecto
        required: true
        schema:
          type: string
  /api/guardian/notifications/read-all:
    post:
      summary: 'Mark all notifications as read'
      operationId: markAllNotificationsAsRead
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  '/api/guardian/notifications/{id}':
    delete:
      summary: 'Delete notification'
      operationId: deleteNotification
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the notification.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/guardian/sites/{site_id}/backup/restore-operations':
    get:
      summary: 'Get restore operations'
      operationId: getRestoreOperations
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/commands':
    get:
      summary: 'Lista comandi per sito'
      operationId: listaComandiPerSito
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    post:
      summary: 'Execute remote command'
      operationId: executeRemoteCommand
      description: 'Dispatch a remote command to the Guardian plugin agent running on the specified WordPress site.'
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site}/commands/{command_id}':
    get:
      summary: 'Get command status'
      operationId: getCommandStatus
      description: 'Check the execution status and output of a previously dispatched remote command.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: command_id
        description: 'The ID of the command.'
        example: 16
        required: true
        schema:
          type: integer
  /api/guardian/backup/restore-operations:
    get:
      summary: 'Get restore operations'
      operationId: getRestoreOperations
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/guardian/demo/create:
    post:
      summary: 'Create demo instance'
      operationId: createDemoInstance
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/guardian/demo/status:
    post:
      summary: 'Get demo instance status'
      operationId: getDemoInstanceStatus
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/guardian/demo/extend:
    post:
      summary: 'Extend demo instance'
      operationId: extendDemoInstance
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/guardian/demo/stats:
    post:
      summary: 'Get demo usage statistics'
      operationId: getDemoUsageStatistics
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/guardian/demo/convert:
    post:
      summary: 'Convert demo to paid'
      operationId: convertDemoToPaid
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/guardian/demo/delete:
    delete:
      summary: 'Delete demo instance'
      operationId: deleteDemoInstance
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/guardian/demo/plans:
    get:
      summary: 'Get available demo plans'
      operationId: getAvailableDemoPlans
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/webhooks/whmcs:
    post:
      summary: 'Gestisce webhook da WHMCS'
      operationId: gestisceWebhookDaWHMCS
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/v1/licenses:
    post:
      summary: ''
      operationId: postApiV1Licenses
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  '/api/v1/licenses/{licenseKey}/validate':
    post:
      summary: ''
      operationId: postApiV1LicensesLicenseKeyValidate
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: licenseKey
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/licenses/{licenseKey}':
    get:
      summary: ''
      operationId: getApiV1LicensesLicenseKey
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: licenseKey
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/licenses/{licenseKey}/activate':
    post:
      summary: ''
      operationId: postApiV1LicensesLicenseKeyActivate
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: licenseKey
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/licenses/{licenseKey}/suspend':
    post:
      summary: ''
      operationId: postApiV1LicensesLicenseKeySuspend
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: licenseKey
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/licenses/{licenseKey}/revoke':
    post:
      summary: ''
      operationId: postApiV1LicensesLicenseKeyRevoke
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: licenseKey
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/licenses/{licenseKey}/renew':
    post:
      summary: ''
      operationId: postApiV1LicensesLicenseKeyRenew
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: licenseKey
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/licenses/{licenseKey}/generate-offline':
    post:
      summary: ''
      operationId: postApiV1LicensesLicenseKeyGenerateOffline
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: licenseKey
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  /api/v1/health:
    get:
      summary: 'Get system health status'
      operationId: getSystemHealthStatus
      description: 'Public endpoint that returns the health status of the Guardian Hub API including database and cache connectivity.'
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/login:
    post:
      summary: 'Login user and create token'
      operationId: loginUserAndCreateToken
      description: 'Authenticate a user with email and password credentials and return a Sanctum bearer token for subsequent API calls.'
      parameters: []
      responses:
        200:
          description: 'Login successful, bearer token returned.'
        401:
          description: 'Invalid credentials.'
        422:
          description: 'Validation error (missing email or password).'
      tags:
        - Authentication
      security: []
  /api/v1/tenants:
    post:
      summary: 'Create new tenant'
      operationId: createNewTenant
      description: 'Create a new tenant organization within the Guardian Hub platform.'
      parameters: []
      responses:
        201:
          description: 'Tenant created successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error.'
      tags:
        - Endpoints
      security:
        - bearerAuth: []
  '/api/v1/tenants/{id}':
    get:
      summary: 'Show tenant'
      operationId: showTenant
      description: 'Retrieve detailed information about a specific tenant by its ID.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/migrate-to-standalone':
    post:
      summary: 'Migrate tenant from SaaS to Standalone'
      operationId: migrateTenantToStandalone
      description: 'Migrate a tenant from the shared SaaS environment to a standalone deployment.'
      parameters: []
      responses:
        200:
          description: 'Migration initiated successfully.'
        401:
          description: 'Unauthenticated.'
      tags:
        - Endpoints
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/export':
    post:
      summary: 'Export tenant data'
      operationId: exportTenantData
      description: 'Export all tenant data including sites, configurations, and historical records.'
      parameters: []
      responses:
        200:
          description: 'Export initiated successfully.'
        401:
          description: 'Unauthenticated.'
      tags:
        - Endpoints
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/subscriptions:
    post:
      summary: 'Create new subscription'
      operationId: createNewSubscription
      description: 'Create a new subscription for a tenant selecting a plan, billing cycle, and payment method.'
      parameters: []
      responses:
        201:
          description: 'Subscription created successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error or payment failure.'
      tags:
        - Subscriptions
      security:
        - bearerAuth: []
  '/api/v1/subscriptions/{subscription_id}/cancel':
    post:
      summary: 'Cancel subscription'
      operationId: cancelSubscription
      description: 'Cancel an active subscription; the subscription remains active until the end of the current billing period.'
      parameters: []
      responses:
        200:
          description: 'Subscription cancelled.'
        401:
          description: 'Unauthenticated.'
        404:
          description: 'Subscription not found.'
      tags:
        - Subscriptions
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: subscription_id
        description: 'The ID of the subscription.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/white-label/{id}':
    put:
      summary: 'Update white-label configuration'
      operationId: updateWhiteLabel
      description: 'Update white-label branding settings including logo, colors, and domain configuration for a tenant.'
      parameters: []
      responses:
        200:
          description: 'White-label updated successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error.'
      tags:
        - Endpoints
      security:
        - bearerAuth: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the white label.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/white-label/config:
    get:
      summary: 'Get white label configuration for webapp'
      operationId: getWhiteLabelConfigurationForWebapp
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/v1/white-label/manifest:
    get:
      summary: 'Get PWA manifest.json'
      operationId: getPWAManifestjson
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/v1/tickets:
    get:
      summary: 'List tickets'
      operationId: listTickets
      description: 'Retrieve a paginated list of support tickets for the authenticated user.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    post:
      summary: 'Create new ticket'
      operationId: createNewTicket
      description: 'Open a new support ticket with a subject, description, priority, and optional file attachments.'
      parameters: []
      responses:
        201:
          description: 'Ticket created successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error.'
      tags:
        - Endpoints
      security:
        - bearerAuth: []
  /api/v1/tickets/statistics:
    get:
      summary: 'Get ticket statistics'
      operationId: getTicketStatistics
      description: 'Retrieve aggregate ticket statistics including open/closed counts and average resolution time.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  '/api/v1/tickets/{ticket_id}':
    get:
      summary: 'Get ticket details'
      operationId: getTicketDetails
      description: 'Retrieve full details of a specific ticket including messages, attachments, and status history.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    put:
      summary: 'Update ticket'
      operationId: updateTicket
      description: 'Update a ticket status, priority, or assignee.'
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: ticket_id
        description: 'The ID of the ticket.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tickets/{ticket_id}/messages':
    post:
      summary: 'Add message to ticket'
      operationId: addMessageToTicket
      description: 'Add a reply or internal note to an existing support ticket.'
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: ticket_id
        description: 'The ID of the ticket.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/notifications:
    get:
      summary: 'Get user notifications'
      operationId: getUserNotifications
      description: 'Retrieve a paginated list of notifications for the authenticated user.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/v1/notifications/unread-count:
    get:
      summary: 'Get unread count'
      operationId: getUnreadCount
      description: 'Return the count of unread notifications for the authenticated user.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  '/api/v1/notifications/{id}/read':
    post:
      summary: 'Mark notification as read'
      operationId: markNotificationAsRead
      description: 'Mark a specific notification as read for the authenticated user.'
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the notification.'
        example: architecto
        required: true
        schema:
          type: string
  /api/v1/notifications/read-all:
    post:
      summary: 'Mark all notifications as read'
      operationId: markAllNotificationsAsRead
      description: 'Mark all unread notifications as read in a single operation.'
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  '/api/v1/notifications/{id}':
    delete:
      summary: 'Delete notification'
      operationId: deleteNotification
      description: 'Permanently delete a specific notification.'
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the notification.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/sites/{site_id}/backup/restore-operations':
    get:
      summary: 'Get restore operations'
      operationId: getRestoreOperations
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/commands':
    get:
      summary: 'List commands for site'
      operationId: listSiteCommands
      description: 'List all remote commands dispatched to the specified site with their execution status.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    post:
      summary: 'Execute remote command'
      operationId: executeRemoteCommand
      description: 'Dispatch a remote command to the Guardian plugin agent running on the specified WordPress site.'
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site}/commands/{command_id}':
    get:
      summary: 'Get command status'
      operationId: getCommandStatus
      description: 'Check the execution status and output of a previously dispatched remote command.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: command_id
        description: 'The ID of the command.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/backup/restore-operations:
    get:
      summary: 'Get restore operations'
      operationId: getRestoreOperations
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/v1/demo/create:
    post:
      summary: 'Create demo instance'
      operationId: createDemoInstance
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/v1/demo/status:
    post:
      summary: 'Get demo instance status'
      operationId: getDemoInstanceStatus
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/v1/demo/extend:
    post:
      summary: 'Extend demo instance'
      operationId: extendDemoInstance
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/v1/demo/stats:
    post:
      summary: 'Get demo usage statistics'
      operationId: getDemoUsageStatistics
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/v1/demo/convert:
    post:
      summary: 'Convert demo to paid'
      operationId: convertDemoToPaid
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/v1/demo/delete:
    delete:
      summary: 'Delete demo instance'
      operationId: deleteDemoInstance
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
  /api/v1/demo/plans:
    get:
      summary: 'Get available demo plans'
      operationId: getAvailableDemoPlans
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/languages:
    get:
      summary: 'Get all available languages.'
      operationId: getAllAvailableLanguages
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    post:
      summary: 'Create a new language.'
      operationId: createANewLanguage
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: 'Must not be greater than 10 characters.'
                  example: bngzmi
                name:
                  type: string
                  description: 'Must not be greater than 100 characters.'
                  example: 'y'
                native_name:
                  type: string
                  description: 'Must not be greater than 100 characters.'
                  example: v
                is_default:
                  type: boolean
                  description: ''
                  example: false
                is_active:
                  type: boolean
                  description: ''
                  example: false
                is_rtl:
                  type: boolean
                  description: ''
                  example: false
                flag:
                  type: string
                  description: 'Must not be greater than 10 characters.'
                  example: nikhwa
                  nullable: true
                sort_order:
                  type: integer
                  description: 'Must be at least 0.'
                  example: 50
                settings:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
              required:
                - code
                - name
                - native_name
      security: []
  /api/v1/languages/statistics:
    get:
      summary: 'Get translation statistics.'
      operationId: getTranslationStatistics
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/languages/translation-progress:
    get:
      summary: 'Get translation progress for all languages.'
      operationId: getTranslationProgressForAllLanguages
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  '/api/v1/languages/{language_id}':
    get:
      summary: 'Get a specific language.'
      operationId: getASpecificLanguage
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    put:
      summary: 'Update a language.'
      operationId: updateALanguage
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: 'Must not be greater than 10 characters.'
                  example: bngzmi
                name:
                  type: string
                  description: 'Must not be greater than 100 characters.'
                  example: 'y'
                native_name:
                  type: string
                  description: 'Must not be greater than 100 characters.'
                  example: v
                is_default:
                  type: boolean
                  description: ''
                  example: false
                is_active:
                  type: boolean
                  description: ''
                  example: false
                is_rtl:
                  type: boolean
                  description: ''
                  example: false
                flag:
                  type: string
                  description: 'Must not be greater than 10 characters.'
                  example: nikhwa
                  nullable: true
                sort_order:
                  type: integer
                  description: 'Must be at least 0.'
                  example: 50
                settings:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
      security: []
    delete:
      summary: 'Delete a language.'
      operationId: deleteALanguage
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: language_id
        description: 'The ID of the language.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/languages/{language_id}/set-default':
    post:
      summary: 'Set language as default.'
      operationId: setLanguageAsDefault
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: language_id
        description: 'The ID of the language.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/languages/{language_id}/activate':
    post:
      summary: 'Activate a language.'
      operationId: activateALanguage
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: language_id
        description: 'The ID of the language.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/languages/{language_id}/deactivate':
    post:
      summary: 'Deactivate a language.'
      operationId: deactivateALanguage
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: language_id
        description: 'The ID of the language.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/languages/{language_id}/export':
    get:
      summary: 'Export translations for a language.'
      operationId: exportTranslationsForALanguage
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: language_id
        description: 'The ID of the language.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/languages/{language_id}/import':
    post:
      summary: 'Import translations for a language.'
      operationId: importTranslationsForALanguage
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                translations:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        description: 'Must not be greater than 255 characters.'
                        example: 'n'
                      value:
                        type: string
                        description: ''
                        example: architecto
                      group:
                        type: string
                        description: 'Must not be greater than 100 characters.'
                        example: 'n'
                        nullable: true
                    required:
                      - key
                      - value
                overwrite:
                  type: boolean
                  description: ''
                  example: false
              required:
                - translations
      security: []
    parameters:
      -
        in: path
        name: language_id
        description: 'The ID of the language.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/languages/{language_id}/auto-translate':
    post:
      summary: 'Auto-translate missing keys for a language.'
      operationId: autoTranslateMissingKeysForALanguage
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: language_id
        description: 'The ID of the language.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/translations:
    get:
      summary: 'Get translations with filtering and pagination.'
      operationId: getTranslationsWithFilteringAndPagination
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                locale:
                  type: string
                  description: 'Must not be greater than 10 characters.'
                  example: sr_BA
                  nullable: true
                group:
                  type: string
                  description: 'Must not be greater than 100 characters.'
                  example: 'n'
                  nullable: true
                search:
                  type: string
                  description: 'Must not be greater than 255 characters.'
                  example: g
                  nullable: true
                status:
                  type: string
                  description: ''
                  example: verified
                  enum:
                    - all
                    - verified
                    - auto_translated
                    - draft
                  nullable: true
                per_page:
                  type: integer
                  description: 'Must be at least 1. Must not be greater than 100.'
                  example: 17
                page:
                  type: integer
                  description: 'Must be at least 1.'
                  example: 35
      security: []
    post:
      summary: 'Create a new translation.'
      operationId: createANewTranslation
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: sr_BA
                key:
                  type: string
                  description: 'Must not be greater than 255 characters.'
                  example: 'n'
                value:
                  type: string
                  description: 'Must not be greater than 5000 characters.'
                  example: g
                group:
                  type: string
                  description: 'Must not be greater than 100 characters.'
                  example: z
                  nullable: true
                is_verified:
                  type: boolean
                  description: ''
                  example: true
                notes:
                  type: string
                  description: 'Must not be greater than 1000 characters.'
                  example: i
                  nullable: true
              required:
                - locale
                - key
                - value
      security: []
  /api/v1/translations/statistics:
    get:
      summary: 'Get translation statistics.'
      operationId: getTranslationStatistics
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/translations/groups:
    get:
      summary: 'Get translation groups.'
      operationId: getTranslationGroups
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/translations/keys:
    get:
      summary: 'Get translation keys for a group.'
      operationId: getTranslationKeysForAGroup
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/translations/missing:
    get:
      summary: 'Get missing translations for a locale.'
      operationId: getMissingTranslationsForALocale
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/translations/bulk:
    post:
      summary: 'Bulk operations on translations.'
      operationId: bulkOperationsOnTranslations
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  description: ''
                  example: auto_translate
                  enum:
                    - verify
                    - unverify
                    - delete
                    - auto_translate
                translations:
                  type: array
                  description: 'The <code>id</code> of an existing record in the translations table.'
                  example:
                    - 16
                  items:
                    type: integer
                target_locale:
                  type: string
                  description: 'This field is required when <code>action</code> is <code>auto_translate</code>. The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: ln_CD
              required:
                - action
                - translations
      security: []
  '/api/v1/translations/locale/{locale}':
    get:
      summary: 'Get translations for a specific locale (key-value pairs) with fallback.'
      operationId: getTranslationsForASpecificLocalekeyValuePairsWithFallback
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: locale
        description: 'The locale.'
        example: iy
        required: true
        schema:
          type: string
  '/api/v1/translations/{locale}/group/{group}':
    get:
      summary: 'Get translations for a specific locale and group (key-value pairs).'
      operationId: getTranslationsForASpecificLocaleAndGroupkeyValuePairs
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: locale
        description: ''
        example: iy
        required: true
        schema:
          type: string
      -
        in: path
        name: group
        description: 'The group.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/translations/{translation_id}':
    get:
      summary: 'Get a specific translation.'
      operationId: getASpecificTranslation
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    put:
      summary: 'Update a translation.'
      operationId: updateATranslation
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                value:
                  type: string
                  description: 'Must not be greater than 5000 characters.'
                  example: b
                is_verified:
                  type: boolean
                  description: ''
                  example: false
                notes:
                  type: string
                  description: 'Must not be greater than 1000 characters.'
                  example: g
                  nullable: true
              required:
                - value
      security: []
    delete:
      summary: 'Delete a translation.'
      operationId: deleteATranslation
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: translation_id
        description: 'The ID of the translation.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/translations/{translation_id}/verify':
    post:
      summary: 'Mark translation as verified.'
      operationId: markTranslationAsVerified
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: translation_id
        description: 'The ID of the translation.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/translations/{translation_id}/unverify':
    post:
      summary: 'Mark translation as unverified.'
      operationId: markTranslationAsUnverified
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: translation_id
        description: 'The ID of the translation.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/translations/{translation_id}/auto-correct':
    post:
      summary: 'Auto-correct translation.'
      operationId: autoCorrectTranslation
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: translation_id
        description: 'The ID of the translation.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/translations/{translation_id}/copy':
    post:
      summary: 'Copy translation to another locale.'
      operationId: copyTranslationToAnotherLocale
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: translation_id
        description: 'The ID of the translation.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/translations/{translation_id}/validate':
    post:
      summary: 'Validate translation.'
      operationId: validateTranslation
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: translation_id
        description: 'The ID of the translation.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/translations/{translation_id}/history':
    get:
      summary: 'Get translation history.'
      operationId: getTranslationHistory
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: translation_id
        description: 'The ID of the translation.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/content-translations:
    get:
      summary: 'Get content translations for a model.'
      operationId: getContentTranslationsForAModel
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    post:
      summary: 'Create a new content translation.'
      operationId: createANewContentTranslation
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model_type:
                  type: string
                  description: 'Must not be greater than 255 characters.'
                  example: b
                model_id:
                  type: integer
                  description: ''
                  example: 16
                locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: ln_CD
                field:
                  type: string
                  description: 'Must not be greater than 100 characters.'
                  example: g
                value:
                  type: string
                  description: 'Must not be greater than 5000 characters.'
                  example: z
                is_verified:
                  type: boolean
                  description: ''
                  example: true
                notes:
                  type: string
                  description: 'Must not be greater than 1000 characters.'
                  example: i
                  nullable: true
              required:
                - model_type
                - model_id
                - locale
                - field
                - value
      security: []
  /api/v1/content-translations/statistics:
    get:
      summary: 'Get content translation statistics.'
      operationId: getContentTranslationStatistics
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/content-translations/bulk:
    post:
      summary: 'Bulk operations on content translations.'
      operationId: bulkOperationsOnContentTranslations
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  description: ''
                  example: verify
                  enum:
                    - verify
                    - unverify
                    - delete
                    - auto_translate
                    - copy
                translations:
                  type: array
                  description: 'The <code>id</code> of an existing record in the content_translations table.'
                  example:
                    - 16
                  items:
                    type: integer
                target_locale:
                  type: string
                  description: 'This field is required when <code>action</code> is <code>copy</code>. The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: ln_CD
              required:
                - action
                - translations
      security: []
  '/api/v1/content-translations/{model_type}/{model_id}':
    get:
      summary: 'Get content translations for a model.'
      operationId: getContentTranslationsForAModel
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: model_type
        description: ''
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: model_id
        description: 'The ID of the model.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/content-translations/{model_type}/{model_id}/status':
    get:
      summary: 'Get translation status for a model.'
      operationId: getTranslationStatusForAModel
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: model_type
        description: ''
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: model_id
        description: 'The ID of the model.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/content-translations/{model_type}/{model_id}/missing':
    get:
      summary: 'Get missing translations for a model.'
      operationId: getMissingTranslationsForAModel
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: model_type
        description: ''
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: model_id
        description: 'The ID of the model.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/content-translations/{model_type}/{model_id}/auto-translate':
    post:
      summary: 'Auto-translate missing content.'
      operationId: autoTranslateMissingContent
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model_type:
                  type: string
                  description: 'Must not be greater than 255 characters.'
                  example: b
                model_id:
                  type: integer
                  description: ''
                  example: 16
                target_locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: ln_CD
                source_locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: kfo_CI
                  nullable: true
                fields:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
              required:
                - model_type
                - model_id
                - target_locale
      security: []
    parameters:
      -
        in: path
        name: model_type
        description: ''
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: model_id
        description: 'The ID of the model.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/content-translations/{model_type}/{model_id}/export':
    get:
      summary: 'Export content translations.'
      operationId: exportContentTranslations
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: model_type
        description: ''
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: model_id
        description: 'The ID of the model.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/content-translations/{model_type}/{model_id}/import':
    post:
      summary: 'Import content translations.'
      operationId: importContentTranslations
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model_type:
                  type: string
                  description: 'Must not be greater than 255 characters.'
                  example: b
                model_id:
                  type: integer
                  description: ''
                  example: 16
                locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: ln_CD
                translations:
                  type: array
                  description: ''
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                        description: 'Must not be greater than 100 characters.'
                        example: 'n'
                      value:
                        type: string
                        description: 'Must not be greater than 5000 characters.'
                        example: g
                    required:
                      - field
                      - value
                overwrite:
                  type: boolean
                  description: ''
                  example: false
              required:
                - model_type
                - model_id
                - locale
                - translations
      security: []
    parameters:
      -
        in: path
        name: model_type
        description: ''
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: model_id
        description: 'The ID of the model.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/content-translations/{translation_id}':
    get:
      summary: 'Get a specific content translation.'
      operationId: getASpecificContentTranslation
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    put:
      summary: 'Update a content translation.'
      operationId: updateAContentTranslation
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                value:
                  type: string
                  description: 'Must not be greater than 5000 characters.'
                  example: b
                is_verified:
                  type: boolean
                  description: ''
                  example: false
                notes:
                  type: string
                  description: 'Must not be greater than 1000 characters.'
                  example: g
                  nullable: true
              required:
                - value
      security: []
    delete:
      summary: 'Delete a content translation.'
      operationId: deleteAContentTranslation
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: translation_id
        description: 'The ID of the translation.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages':
    get:
      summary: 'Get language settings for a tenant.'
      operationId: getLanguageSettingsForATenant
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    post:
      summary: 'Add a language to a tenant.'
      operationId: addALanguageToATenant
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: sr_BA
                is_default:
                  type: boolean
                  description: ''
                  example: false
                is_active:
                  type: boolean
                  description: ''
                  example: true
                fallback_locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: en_MT
                  nullable: true
                settings:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
              required:
                - locale
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/available':
    get:
      summary: 'Get available languages for tenant (not yet added).'
      operationId: getAvailableLanguagesForTenantnotYetAdded
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/summary':
    get:
      summary: 'Get tenant language preferences summary.'
      operationId: getTenantLanguagePreferencesSummary
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/statistics':
    get:
      summary: 'Get tenant language usage statistics.'
      operationId: getTenantLanguageUsageStatistics
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/sync':
    post:
      summary: 'Sync tenant languages with system languages.'
      operationId: syncTenantLanguagesWithSystemLanguages
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/{tenantLanguage_id}':
    get:
      summary: 'Get a specific tenant language setting.'
      operationId: getASpecificTenantLanguageSetting
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
    put:
      summary: 'Update tenant language settings.'
      operationId: updateTenantLanguageSettings
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                is_default:
                  type: boolean
                  description: ''
                  example: false
                is_active:
                  type: boolean
                  description: ''
                  example: false
                fallback_locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table. Must not be greater than 10 characters.'
                  example: kfo_CI
                  nullable: true
                settings:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
      security: []
    delete:
      summary: 'Remove a language from a tenant.'
      operationId: removeALanguageFromATenant
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: tenantLanguage_id
        description: 'The ID of the tenantLanguage.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/{tenantLanguage_id}/set-default':
    post:
      summary: 'Set language as default for tenant.'
      operationId: setLanguageAsDefaultForTenant
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: tenantLanguage_id
        description: 'The ID of the tenantLanguage.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/{tenantLanguage_id}/activate':
    post:
      summary: 'Activate language for tenant.'
      operationId: activateLanguageForTenant
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: tenantLanguage_id
        description: 'The ID of the tenantLanguage.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/{tenantLanguage_id}/deactivate':
    post:
      summary: 'Deactivate language for tenant.'
      operationId: deactivateLanguageForTenant
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: tenantLanguage_id
        description: 'The ID of the tenantLanguage.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/tenants/{tenant_id}/languages/{tenantLanguage_id}/settings':
    put:
      summary: 'Update tenant language settings.'
      operationId: updateTenantLanguageSettings
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                settings:
                  type: object
                  description: ''
                  example: []
                  properties: {  }
              required:
                - settings
      security: []
    parameters:
      -
        in: path
        name: tenant_id
        description: 'The ID of the tenant.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: tenantLanguage_id
        description: 'The ID of the tenantLanguage.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/locale/switch:
    post:
      summary: 'Switch current locale.'
      operationId: switchCurrentLocale
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                locale:
                  type: string
                  description: 'The <code>code</code> of an existing record in the languages table.'
                  example: sr_BA
                remember:
                  type: boolean
                  description: ''
                  example: false
              required:
                - locale
      security: []
  /api/v1/locale/detect:
    get:
      summary: "Detect user's preferred locale."
      operationId: detectUsersPreferredLocale
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/locale/current:
    get:
      summary: 'Get current locale info.'
      operationId: getCurrentLocaleInfo
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/ping:
    get:
      summary: 'Ping endpoint for uptime monitoring'
      operationId: pingEndpointForUptimeMonitoring
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/status:
    get:
      summary: 'Get application status (for load balancers)'
      operationId: getApplicationStatusforLoadBalancers
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/prometheus:
    get:
      summary: ''
      operationId: getApiV1Prometheus
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/v1/metrics:
    get:
      summary: 'Get performance metrics'
      operationId: getPerformanceMetrics
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/v1/error-rates:
    get:
      summary: 'Get error rates'
      operationId: getErrorRates
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/v1/dashboard:
    get:
      summary: 'Get monitoring dashboard data'
      operationId: getMonitoringDashboardData
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
      security: []
  /api/v1/security/status:
    get:
      summary: 'External API - Status'
      operationId: externalAPIStatus
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - Endpoints
      security: []
  /api/guardian/features/check:
    post:
      summary: 'Check if a feature is enabled'
      operationId: checkIfAFeatureIsEnabled
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
  /api/guardian/features/available:
    post:
      summary: 'Get all available features for context'
      operationId: getAllAvailableFeaturesForContext
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
  '/api/guardian/features/stats/{feature}':
    post:
      summary: 'Get feature usage statistics'
      operationId: getFeatureUsageStatistics
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
    parameters:
      -
        in: path
        name: feature
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  /api/guardian/features/trial:
    post:
      summary: 'Create trial period for feature'
      operationId: createTrialPeriodForFeature
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
  /api/guardian/features/campaign:
    post:
      summary: 'Create campaign'
      operationId: createCampaign
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
  /api/v1/features/check:
    post:
      summary: 'Check if a feature is enabled'
      operationId: checkIfAFeatureIsEnabled
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
  /api/v1/features/available:
    post:
      summary: 'Get all available features for context'
      operationId: getAllAvailableFeaturesForContext
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
  '/api/v1/features/stats/{feature}':
    post:
      summary: 'Get feature usage statistics'
      operationId: getFeatureUsageStatistics
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
    parameters:
      -
        in: path
        name: feature
        description: ''
        example: architecto
        required: true
        schema:
          type: string
  /api/v1/features/trial:
    post:
      summary: 'Create trial period for feature'
      operationId: createTrialPeriodForFeature
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
  /api/v1/features/campaign:
    post:
      summary: 'Create campaign'
      operationId: createCampaign
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Feature Management'
  /api/v1/partner/dashboard:
    get:
      summary: 'Display partner dashboard'
      operationId: displayPartnerDashboard
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
  /api/v1/partner/profile:
    get:
      summary: 'Get partner profile'
      operationId: getPartnerProfile
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
    put:
      summary: 'Update partner profile'
      operationId: updatePartnerProfile
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Partner Management'
  /api/v1/partner/referrals:
    get:
      summary: 'Get referrals'
      operationId: getReferrals
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
  /api/v1/partner/commissions:
    get:
      summary: 'Get commissions'
      operationId: getCommissions
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
  /api/v1/partner/payouts:
    get:
      summary: 'List payouts for the authenticated partner'
      operationId: listPayoutsForTheAuthenticatedPartner
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
    post:
      summary: 'Request a payout'
      operationId: requestAPayout
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Partner Management'
  '/api/v1/partner/payouts/{payout}':
    get:
      summary: 'Show payout details'
      operationId: showPayoutDetails
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
    parameters:
      -
        in: path
        name: payout
        description: 'The payout.'
        example: architecto
        required: true
        schema:
          type: string
  /api/v1/partner/marketing-materials:
    get:
      summary: 'Get marketing materials'
      operationId: getMarketingMaterials
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
  /api/v1/partner/generate-link:
    post:
      summary: 'Generate affiliate link'
      operationId: generateAffiliateLink
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Partner Management'
  /api/v1/partner/earnings-report:
    get:
      summary: 'Get earnings report'
      operationId: getEarningsReport
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
  /api/v1/partner/analytics:
    get:
      summary: 'Get analytics'
      operationId: getAnalytics
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Partner Management'
  /api/v1/partner/apply:
    post:
      summary: 'Create new partner application'
      operationId: createNewPartnerApplication
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Partner Management'
      security: []
  /api/v1/partner/track-click:
    post:
      summary: 'Track referral click'
      operationId: trackReferralClick
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Partner Management'
      security: []
  /api/v1/performance/dashboard:
    get:
      summary: 'Get Performance Dashboard'
      operationId: getPerformanceDashboard
      description: 'Retrieve the main performance dashboard data.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
  '/api/v1/performance/analyze/{site_id}':
    post:
      summary: 'Analyze Site Performance'
      operationId: analyzeSitePerformance
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/metrics/{site_id}':
    get:
      summary: 'Get Performance Metrics'
      operationId: getPerformanceMetrics
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/score/{site_id}':
    get:
      summary: 'Get Performance Score'
      operationId: getPerformanceScore
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/trends/{site_id}':
    get:
      summary: 'Get Performance Trends'
      operationId: getPerformanceTrends
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/optimize/{site_id}':
    post:
      summary: 'Optimize Site (General)'
      operationId: optimizeSiteGeneral
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/cache/{site_id}':
    post:
      summary: 'Optimize Cache'
      operationId: optimizeCache
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/database/{site_id}':
    post:
      summary: 'Optimize Database'
      operationId: optimizeDatabase
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/images/{site_id}':
    post:
      summary: 'Optimize Images'
      operationId: optimizeImages
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/cdn/{site_id}':
    post:
      summary: 'Configure CDN'
      operationId: configureCDN
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/monitor/{site_id}':
    post:
      summary: 'Start Monitoring'
      operationId: startMonitoring
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/alerts/{site_id}':
    get:
      summary: 'Get Alerts'
      operationId: getAlerts
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    post:
      summary: 'Configure Alerts'
      operationId: configureAlerts
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/report/{site_id}':
    get:
      summary: 'Get Performance Report'
      operationId: getPerformanceReport
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/comparison/{site_id}':
    get:
      summary: 'Get Comparison'
      operationId: getComparison
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/performance/recommendations/{site_id}':
    get:
      summary: 'Get Recommendations'
      operationId: getRecommendations
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/performance/settings/{site_id}':
    get:
      summary: 'Get Performance Settings'
      operationId: getPerformanceSettings
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    post:
      summary: 'Update Performance Settings'
      operationId: updatePerformanceSettings
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                monitoring:
                  type: object
                  description: ''
                  example: []
                  properties:
                    enabled:
                      type: boolean
                      description: ''
                      example: false
                    interval:
                      type: integer
                      description: 'Must be at least 60. Must not be greater than 3600.'
                      example: 22
                alerts:
                  type: object
                  description: ''
                  example: []
                  properties:
                    enabled:
                      type: boolean
                      description: ''
                      example: true
                optimization:
                  type: object
                  description: ''
                  example: []
                  properties:
                    auto_optimization:
                      type: boolean
                      description: ''
                      example: false
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/v1/performance/history/{site_id}':
    get:
      summary: 'Get History'
      operationId: getHistory
      description: ''
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  /api/agent/performance/analyze:
    post:
      summary: 'Analyze Site Performance'
      operationId: analyzeSitePerformance
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  /api/agent/performance/metrics:
    get:
      summary: 'Get Performance Metrics'
      operationId: getPerformanceMetrics
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  /api/agent/performance/optimize:
    post:
      summary: 'Optimize Site (General)'
      operationId: optimizeSiteGeneral
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  /api/agent/performance/monitor:
    post:
      summary: 'Start Monitoring'
      operationId: startMonitoring
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  /api/agent/performance/report:
    get:
      summary: 'Get Performance Report'
      operationId: getPerformanceReport
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - 'Performance Optimization'
    parameters:
      -
        in: path
        name: site
        description: 'The ID of the site.'
        example: architecto
        required: true
        schema:
          type: string
  /api/agent/performance/history:
    get:
      summary: 'Get History'
      operationId: getHistory
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - 'Performance Optimization'
  /api/v1/performance/analyze:
    post:
      summary: 'External API - Analyze'
      operationId: externalAPIAnalyze
      description: 'Public API endpoint to trigger an AI analysis on a site using an X-API-Key header for authentication.'
      parameters: []
      responses: {  }
      tags:
        - 'Performance Optimization'
      security: []
  /api/v1/performance/metrics:
    get:
      summary: 'External API - Metrics'
      operationId: externalAPIMetrics
      description: ''
      parameters: []
      responses:
        500:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Server Error'
                properties:
                  message:
                    type: string
                    example: 'Server Error'
      tags:
        - 'Performance Optimization'
      security: []
  /api/v1/security/dashboard:
    get:
      summary: 'Get Security Dashboard'
      operationId: getSecurityDashboard
      description: 'Retrieve the main security dashboard data, including overview stats, score, and recent incidents.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
  /api/v1/security/threats:
    get:
      summary: 'Get Threats'
      operationId: getThreats
      description: 'Retrieve active threats and threat intelligence data.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
  /api/v1/security/vulnerabilities:
    get:
      summary: 'Get Vulnerabilities'
      operationId: getVulnerabilities
      description: 'Retrieve a list of vulnerabilities detected across all sites.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
  /api/v1/security/incidents:
    get:
      summary: 'Get Incidents'
      operationId: getIncidents
      description: 'Retrieve a paginated list of security incidents.'
      parameters:
        -
          in: query
          name: period
          description: 'The time period (e.g., "30d", "7d").'
          example: 30d
          required: false
          schema:
            type: string
            description: 'The time period (e.g., "30d", "7d").'
            example: 30d
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
  '/api/v1/security/scan/{site_id}':
    post:
      summary: 'Scan Site'
      operationId: scanSite
      description: "Trigger a comprehensive security scan for a specific site.\nRequires 20 credits."
      parameters: []
      responses: {  }
      tags:
        - Security
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'Optional parameter. The ID of the site to scan.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  '/api/v1/security/fix/{site_id}':
    post:
      summary: 'Fix Issues'
      operationId: fixIssues
      description: 'Apply automated fixes for identified security issues.'
      parameters: []
      responses: {  }
      tags:
        - Security
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                fixes:
                  type: array
                  description: 'Array of fix IDs to apply.'
                  example:
                    - fix_123
                    - fix_456
                  items:
                    type: string
              required:
                - fixes
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'Optional parameter. The ID of the site.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  '/api/v1/security/monitor/{site_id}':
    post:
      summary: 'Start Monitoring'
      operationId: startMonitoring
      description: 'Enable and configure security monitoring for a site.'
      parameters: []
      responses: {  }
      tags:
        - Security
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                config:
                  type: object
                  description: 'Monitoring configuration.'
                  example:
                    real_time_monitoring: true
                    alert_thresholds:
                      critical: 1
                  properties: {  }
              required:
                - config
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'Optional parameter. The ID of the site.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  '/api/v1/security/alert/{site_id}':
    post:
      summary: 'Configure Alerts'
      operationId: configureAlerts
      description: 'Setup alert preferences for a site.'
      parameters: []
      responses: {  }
      tags:
        - Security
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                alerts:
                  type: object
                  description: 'Alert configuration.'
                  example:
                    vulnerability_alerts: true
                    notification_email: user@example.com
                  properties: {  }
              required:
                - alerts
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'Optional parameter. The ID of the site.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  '/api/v1/security/report/{site_id}':
    get:
      summary: 'Get Security Report'
      operationId: getSecurityReport
      description: 'Generate a comprehensive security report for a site.'
      parameters:
        -
          in: query
          name: period
          description: 'The reporting period.'
          example: 30d
          required: false
          schema:
            type: string
            description: 'The reporting period.'
            example: 30d
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
      -
        in: path
        name: site
        description: 'Optional parameter. The ID of the site.'
        required: true
        schema:
          type: string
        examples:
          omitted:
            summary: 'When the value is omitted'
            value: ''
          present:
            summary: 'When the value is present'
            value: architecto
  /api/v1/security/compliance:
    get:
      summary: 'Get Compliance Status'
      operationId: getComplianceStatus
      description: 'Retrieve compliance status (GDPR, PCI, HIPAA, SOX) for all sites.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
  /api/v1/security/audit-log:
    get:
      summary: 'Get Audit Log'
      operationId: getAuditLog
      description: 'Retrieve security audit logs.'
      parameters:
        -
          in: query
          name: period
          description: 'The time period.'
          example: 30d
          required: false
          schema:
            type: string
            description: 'The time period.'
            example: 30d
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
  /api/v1/security/settings:
    get:
      summary: 'Get Security Settings'
      operationId: getSecuritySettings
      description: 'Retrieve user-level security settings.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
    post:
      summary: 'Update Security Settings'
      operationId: updateSecuritySettings
      description: 'Update user-level security settings.'
      parameters: []
      responses: {  }
      tags:
        - Security
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                monitoring_enabled:
                  type: boolean
                  description: 'Enable/disable monitoring.'
                  example: false
                alert_thresholds:
                  type: array
                  description: 'Threshold configuration.'
                  example:
                    - architecto
                  items:
                    type: string
  /api/v1/security/team:
    get:
      summary: 'Get Security Team'
      operationId: getSecurityTeam
      description: 'Retrieve the list of security team members.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Security
    post:
      summary: 'Add Team Member'
      operationId: addTeamMember
      description: 'Add a new member to the security team.'
      parameters: []
      responses: {  }
      tags:
        - Security
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: "The member's name."
                  example: architecto
                email:
                  type: string
                  description: "The member's email."
                  example: gbailey@example.net
                role:
                  type: string
                  description: "The member's role (analyst, manager, admin)."
                  example: architecto
              required:
                - name
                - email
                - role
  /api/v1/security/scan:
    post:
      summary: 'External Scan (API)'
      operationId: externalScanAPI
      description: "Trigger a scan from an external source using an API key.\nRequires 25 credits."
      parameters: []
      responses: {  }
      tags:
        - Security
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                site_url:
                  type: string
                  description: 'The URL to scan.'
                  example: 'http://www.bailey.biz/quos-velit-et-fugiat-sunt-nihil-accusantium-harum.html'
                api_key:
                  type: string
                  description: 'Valid API Key.'
                  example: architecto
              required:
                - site_url
                - api_key
      security: []
  /api/guardian/init-connection:
    post:
      summary: 'Initialize secure connection'
      operationId: initializeSecureConnection
      description: "Establish a secure connection between the WordPress site and Guardian Hub.\nThis is usually called by the plugin upon first activation or reconfiguration."
      parameters: []
      responses: {  }
      tags:
        - 'Site Initialization'
      security: []
  /api/guardian/refresh-tokens:
    post:
      summary: 'Refresh tokens'
      operationId: refreshTokens
      description: 'Refresh the site tokens using a valid refresh token.'
      parameters: []
      responses: {  }
      tags:
        - 'Site Initialization'
      security: []
  /api/v1/init-connection:
    post:
      summary: 'Initialize secure connection'
      operationId: initializeSecureConnection
      description: "Establish a secure connection between the WordPress site and Guardian Hub.\nThis is usually called by the plugin upon first activation or reconfiguration."
      parameters: []
      responses: {  }
      tags:
        - 'Site Initialization'
      security: []
  /api/v1/refresh-tokens:
    post:
      summary: 'Refresh tokens'
      operationId: refreshTokens
      description: 'Refresh the site tokens using a valid refresh token.'
      parameters: []
      responses: {  }
      tags:
        - 'Site Initialization'
      security: []
  /api/guardian/pairing/complete:
    post:
      summary: 'Complete Pairing'
      operationId: completePairing
      description: "Finalize the pairing process from the WordPress Agent.\nExchange the pairing token for a permanent API Key."
      parameters: []
      responses: {  }
      tags:
        - Sites
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pairing_token:
                  type: string
                  description: 'The pairing token generated when creating the site.'
                  example: pt_1234567890abcdef
                wp_version:
                  type: string
                  description: 'The WordPress version of the site. Must match the regex /^\d+\.\d+(\.\d+)?$/.'
                  example: 6.4.2
                php_version:
                  type: string
                  description: 'The PHP version of the server. Must match the regex /^\d+\.\d+(\.\d+)?$/.'
                  example: 8.2.14
                metadata:
                  type: object
                  description: 'Additional metadata about the site.'
                  example:
                    site_url: 'https://example.com'
                    admin_email: admin@example.com
                    plugin_count: 12
                  properties: {  }
              required:
                - pairing_token
      security: []
  /api/guardian/sites:
    get:
      summary: 'List Sites'
      operationId: listSites
      description: 'Get a list of all sites for the authenticated user.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Sites
    post:
      summary: 'Create Site'
      operationId: createSite
      description: 'Register a new WordPress site and generate a pairing token.'
      parameters: []
      responses: {  }
      tags:
        - Sites
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Must match the regex /^[a-zA-Z0-9\s\-_\.]+$/. Must not be greater than 255 characters.'
                  example: b
                url:
                  type: string
                  description: 'Must be a valid URL. Must match the regex /^https:\/\//. Must not be greater than 255 characters.'
                  example: 'http://bailey.com/'
              required:
                - name
                - url
  '/api/guardian/sites/{id}':
    get:
      summary: 'Get Site Details'
      operationId: getSiteDetails
      description: 'Retrieve detailed information about a specific site.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Sites
    put:
      summary: 'Update Site'
      operationId: updateSite
      description: 'Update site configuration.'
      parameters: []
      responses: {  }
      tags:
        - Sites
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Must match the regex /^[a-zA-Z0-9\s\-_\.]+$/. Must not be greater than 255 characters.'
                  example: b
                settings:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
    delete:
      summary: 'Rimuovi sito'
      operationId: rimuoviSito
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Sites
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/guardian/sites/{site_id}/regenerate-api-key':
    post:
      summary: 'Rigenera API key'
      operationId: rigeneraAPIKey
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Sites
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  /api/guardian/sites/health:
    post:
      summary: 'Store Health Data'
      operationId: storeHealthData
      description: 'Receive health status telemetry from the WordPress Agent.'
      parameters: []
      responses: {  }
      tags:
        - Sites
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                wp_version:
                  type: string
                  description: 'The WordPress version. Must match the regex /^\d+\.\d+(\.\d+)?$/.'
                  example: 6.4.2
                php_version:
                  type: string
                  description: 'The PHP version. Must match the regex /^\d+\.\d+(\.\d+)?$/.'
                  example: 8.2.14
                uptime_percentage:
                  type: number
                  description: 'Site uptime percentage. Must be at least 0. Must not be greater than 100.'
                  example: 99.99
                disk_usage:
                  type: object
                  description: 'Disk usage statistics.'
                  example:
                    total: 102400
                    free: 51200
                    used: 51200
                  properties: {  }
                memory_usage:
                  type: object
                  description: 'Memory usage statistics.'
                  example:
                    total: 4096
                    used: 2048
                  properties: {  }
                critical_issues:
                  type: object
                  description: 'List of critical issues detected.'
                  example:
                    -
                      type: security
                      title: 'Outdated Plugin'
                      details: 'Plugin X is vulnerable.'
                  properties: {  }
                warnings:
                  type: object
                  description: 'List of warnings detected.'
                  example: []
                  properties: {  }
                plugins:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
                themes:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
  /api/v1/pairing/complete:
    post:
      summary: 'Complete Pairing'
      operationId: completePairing
      description: "Finalize the pairing process from the WordPress Agent.\nExchange the pairing token for a permanent API Key."
      parameters: []
      responses: {  }
      tags:
        - Sites
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pairing_token:
                  type: string
                  description: 'The pairing token generated when creating the site.'
                  example: pt_1234567890abcdef
                wp_version:
                  type: string
                  description: 'The WordPress version of the site. Must match the regex /^\d+\.\d+(\.\d+)?$/.'
                  example: 6.4.2
                php_version:
                  type: string
                  description: 'The PHP version of the server. Must match the regex /^\d+\.\d+(\.\d+)?$/.'
                  example: 8.2.14
                metadata:
                  type: object
                  description: 'Additional metadata about the site.'
                  example:
                    site_url: 'https://example.com'
                    admin_email: admin@example.com
                    plugin_count: 12
                  properties: {  }
              required:
                - pairing_token
      security: []
  /api/v1/sites:
    get:
      summary: 'List Sites'
      operationId: listSites
      description: 'Get a list of all sites for the authenticated user.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Sites
    post:
      summary: 'Create Site'
      operationId: createSite
      description: 'Register a new WordPress site and generate a pairing token.'
      parameters: []
      responses: {  }
      tags:
        - Sites
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Must match the regex /^[a-zA-Z0-9\s\-_\.]+$/. Must not be greater than 255 characters.'
                  example: b
                url:
                  type: string
                  description: 'Must be a valid URL. Must match the regex /^https:\/\//. Must not be greater than 255 characters.'
                  example: 'http://bailey.com/'
              required:
                - name
                - url
  '/api/v1/sites/{id}':
    get:
      summary: 'Get Site Details'
      operationId: getSiteDetails
      description: 'Retrieve detailed information about a specific site.'
      parameters: []
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Sites
    put:
      summary: 'Update Site'
      operationId: updateSite
      description: 'Update site configuration.'
      parameters: []
      responses: {  }
      tags:
        - Sites
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Must match the regex /^[a-zA-Z0-9\s\-_\.]+$/. Must not be greater than 255 characters.'
                  example: b
                settings:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
    delete:
      summary: 'Rimuovi sito'
      operationId: rimuoviSito
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Sites
    parameters:
      -
        in: path
        name: id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  '/api/v1/sites/{site_id}/regenerate-api-key':
    post:
      summary: 'Rigenera API key'
      operationId: rigeneraAPIKey
      description: ''
      parameters: []
      responses: {  }
      tags:
        - Sites
    parameters:
      -
        in: path
        name: site_id
        description: 'The ID of the site.'
        example: 16
        required: true
        schema:
          type: integer
  /api/v1/sites/health:
    post:
      summary: 'Store Health Data'
      operationId: storeHealthData
      description: 'Receive health status telemetry from the WordPress Agent.'
      parameters: []
      responses: {  }
      tags:
        - Sites
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                wp_version:
                  type: string
                  description: 'The WordPress version. Must match the regex /^\d+\.\d+(\.\d+)?$/.'
                  example: 6.4.2
                php_version:
                  type: string
                  description: 'The PHP version. Must match the regex /^\d+\.\d+(\.\d+)?$/.'
                  example: 8.2.14
                uptime_percentage:
                  type: number
                  description: 'Site uptime percentage. Must be at least 0. Must not be greater than 100.'
                  example: 99.99
                disk_usage:
                  type: object
                  description: 'Disk usage statistics.'
                  example:
                    total: 102400
                    free: 51200
                    used: 51200
                  properties: {  }
                memory_usage:
                  type: object
                  description: 'Memory usage statistics.'
                  example:
                    total: 4096
                    used: 2048
                  properties: {  }
                critical_issues:
                  type: object
                  description: 'List of critical issues detected.'
                  example:
                    -
                      type: security
                      title: 'Outdated Plugin'
                      details: 'Plugin X is vulnerable.'
                  properties: {  }
                warnings:
                  type: object
                  description: 'List of warnings detected.'
                  example: []
                  properties: {  }
                plugins:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
                themes:
                  type: object
                  description: ''
                  example: null
                  properties: {  }
  /api/guardian/upgrade/initiate:
    post:
      summary: 'Initiate upgrade process'
      operationId: initiateUpgradeProcess
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Upgrade Management'
  /api/guardian/upgrade/payment:
    post:
      summary: 'Process payment'
      operationId: processPayment
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Upgrade Management'
  /api/guardian/upgrade/confirm:
    post:
      summary: 'Confirm upgrade (for free upgrades or after payment)'
      operationId: confirmUpgradeforFreeUpgradesOrAfterPayment
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Upgrade Management'
  /api/guardian/upgrade/options:
    post:
      summary: 'Get available upgrade options'
      operationId: getAvailableUpgradeOptions
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Upgrade Management'
  /api/guardian/upgrade/history:
    post:
      summary: 'Get upgrade history'
      operationId: getUpgradeHistory
      description: ''
      parameters: []
      responses: {  }
      tags:
        - 'Upgrade Management'
  /api/v1/upgrade/initiate:
    post:
      summary: 'Initiate upgrade process'
      operationId: initiateUpgradeProcess
      description: 'Start a subscription upgrade process selecting the target plan and billing cycle.'
      parameters: []
      responses:
        200:
          description: 'Upgrade process initiated.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Validation error.'
      tags:
        - 'Upgrade Management'
      security:
        - bearerAuth: []
  /api/v1/upgrade/payment:
    post:
      summary: 'Process payment'
      operationId: processPayment
      description: 'Process payment for a pending subscription upgrade using the provided payment method.'
      parameters: []
      responses:
        200:
          description: 'Payment processed successfully.'
        401:
          description: 'Unauthenticated.'
        422:
          description: 'Payment failed or validation error.'
      tags:
        - 'Upgrade Management'
      security:
        - bearerAuth: []
  /api/v1/upgrade/confirm:
    post:
      summary: 'Confirm upgrade (for free upgrades or after payment)'
      operationId: confirmUpgradeforFreeUpgradesOrAfterPayment
      description: 'Confirm and finalize a subscription upgrade after payment is processed or for free tier upgrades.'
      parameters: []
      responses:
        200:
          description: 'Upgrade confirmed and applied.'
        401:
          description: 'Unauthenticated.'
      tags:
        - 'Upgrade Management'
      security:
        - bearerAuth: []
  /api/v1/upgrade/options:
    post:
      summary: 'Get available upgrade options'
      operationId: getAvailableUpgradeOptions
      description: 'Retrieve all available upgrade paths from the current subscription plan with pricing and feature comparisons.'
      parameters: []
      responses:
        200:
          description: 'Upgrade options returned.'
        401:
          description: 'Unauthenticated.'
      tags:
        - 'Upgrade Management'
      security:
        - bearerAuth: []
  /api/v1/upgrade/history:
    post:
      summary: 'Get upgrade history'
      operationId: getUpgradeHistory
      description: 'Retrieve the complete history of subscription upgrades and plan changes.'
      parameters: []
      responses:
        200:
          description: 'Upgrade history returned.'
        401:
          description: 'Unauthenticated.'
      tags:
        - 'Upgrade Management'
      security:
        - bearerAuth: []

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum
  responses:
    UnauthorizedError:
      description: Authentication token is missing or invalid.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Unauthenticated.
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: 'The given data was invalid.'
              errors:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
    NotFoundError:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: 'Resource not found.'
security:
  -
    bearerAuth: []
