{
  "components": {
    "schemas": {
      "AcceptInvitationDto": {
        "properties": {
          "password": {
            "example": "SecureP@ssw0rd!",
            "minLength": 8,
            "type": "string"
          },
          "token": {
            "example": "your-secure-token-here",
            "type": "string"
          }
        },
        "required": [
          "token",
          "password"
        ],
        "type": "object"
      },
      "ActionItemDto": {
        "properties": {
          "description": {
            "description": "Action item description",
            "type": "string"
          },
          "dueDate": {
            "description": "Suggested due date",
            "type": "string"
          },
          "priority": {
            "description": "Priority level",
            "enum": [
              "high",
              "medium",
              "low"
            ],
            "type": "string"
          }
        },
        "required": [
          "description",
          "priority"
        ],
        "type": "object"
      },
      "ActivationBlockerDto": {
        "properties": {
          "code": {
            "example": "missing_calendar_integration",
            "type": "string"
          },
          "message": {
            "example": "Connect a Google or Outlook calendar integration.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "ActivationMilestoneDto": {
        "properties": {
          "blockers": {
            "items": {
              "$ref": "#/components/schemas/ActivationBlockerDto"
            },
            "type": "array"
          },
          "completed": {
            "example": true,
            "type": "boolean"
          },
          "id": {
            "example": "calendar_connected",
            "type": "string"
          },
          "title": {
            "example": "Connect calendar",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "completed",
          "blockers"
        ],
        "type": "object"
      },
      "ActivationStatusDto": {
        "properties": {
          "completed": {
            "example": 4,
            "type": "number"
          },
          "generatedAt": {
            "example": "2026-01-07T12:00:00.000Z",
            "type": "string"
          },
          "milestones": {
            "items": {
              "$ref": "#/components/schemas/ActivationMilestoneDto"
            },
            "type": "array"
          },
          "organizationId": {
            "type": "string"
          },
          "progressPercent": {
            "example": 67,
            "type": "number"
          },
          "recommendedNext": {
            "example": [
              "calendar_connected",
              "payments_setup"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "timezone": {
            "example": "UTC",
            "type": "string"
          },
          "total": {
            "example": 6,
            "type": "number"
          },
          "userId": {
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "userId",
          "generatedAt",
          "timezone",
          "milestones",
          "completed",
          "total",
          "progressPercent",
          "recommendedNext"
        ],
        "type": "object"
      },
      "AdAccountResponseDto": {
        "properties": {
          "authUrl": {
            "example": "https://ads.google.com/oauth?...",
            "type": "string"
          },
          "createdAt": {
            "example": "2024-01-10T09:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "errorMessage": {
            "example": "Authorization failed",
            "type": "string"
          },
          "externalAccountId": {
            "example": "123-456-7890",
            "type": "string"
          },
          "googleCustomerId": {
            "example": "1234567890",
            "type": "string"
          },
          "googleLocationGroupId": {
            "example": "987654321",
            "type": "string"
          },
          "hasAuthenticatedConnection": {
            "example": true,
            "type": "boolean"
          },
          "id": {
            "example": "maa_123",
            "type": "string"
          },
          "lastSyncAt": {
            "example": "2024-01-16T10:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "lastSyncStatus": {
            "example": "success",
            "type": "string"
          },
          "metaBusinessAccountId": {
            "example": "123456789012345",
            "type": "string"
          },
          "metaPageId": {
            "example": "123456789012345",
            "type": "string"
          },
          "metaPixelId": {
            "example": "123456789012345",
            "type": "string"
          },
          "metadata": {
            "example": {
              "currency": "USD"
            },
            "type": "object"
          },
          "provider": {
            "enum": [
              "google_ads",
              "meta_ads"
            ],
            "example": "google_ads",
            "type": "string"
          },
          "status": {
            "example": "connected",
            "type": "string"
          },
          "updatedAt": {
            "example": "2024-01-12T09:00:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider",
          "status",
          "hasAuthenticatedConnection",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "AdAccountSummaryDto": {
        "properties": {
          "activeCampaigns": {
            "example": 12,
            "type": "number"
          },
          "adAccountId": {
            "example": "maa_123",
            "type": "string"
          },
          "campaignCount": {
            "example": 18,
            "type": "number"
          },
          "clicks": {
            "example": 1560,
            "type": "number"
          },
          "conversions": {
            "example": 124,
            "type": "number"
          },
          "cpa": {
            "example": 2.62,
            "type": "number"
          },
          "cpc": {
            "example": 0.21,
            "type": "number"
          },
          "ctr": {
            "example": 3.21,
            "type": "number"
          },
          "currencyCode": {
            "example": "USD",
            "type": "string"
          },
          "endDate": {
            "example": "2025-01-30",
            "type": "string"
          },
          "impressions": {
            "example": 48500,
            "type": "number"
          },
          "pausedCampaigns": {
            "example": 4,
            "type": "number"
          },
          "spend": {
            "example": 325,
            "type": "number"
          },
          "spendMicros": {
            "example": 325000000,
            "type": "number"
          },
          "startDate": {
            "example": "2025-01-01",
            "type": "string"
          }
        },
        "required": [
          "adAccountId",
          "startDate",
          "endDate",
          "spendMicros",
          "spend",
          "impressions",
          "clicks",
          "campaignCount"
        ],
        "type": "object"
      },
      "AdCampaignCreativeLinkDto": {
        "properties": {
          "creativeId": {
            "type": "string"
          },
          "placement": {
            "type": "string"
          }
        },
        "required": [
          "creativeId",
          "placement"
        ],
        "type": "object"
      },
      "AdCampaignPolygonPointDto": {
        "properties": {
          "latitude": {
            "example": 37.7749,
            "type": "number"
          },
          "longitude": {
            "example": -122.4194,
            "type": "number"
          }
        },
        "required": [
          "latitude",
          "longitude"
        ],
        "type": "object"
      },
      "AdCampaignPublishJobDto": {
        "properties": {
          "completedAt": {
            "format": "date-time",
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "jobType": {
            "type": "string"
          },
          "queuedAt": {
            "format": "date-time",
            "type": "string"
          },
          "startedAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "jobType",
          "status",
          "queuedAt"
        ],
        "type": "object"
      },
      "AdCampaignResponseDto": {
        "properties": {
          "adAccountId": {
            "type": "string"
          },
          "biddingStrategy": {
            "type": "string"
          },
          "channelSubtype": {
            "enum": [
              "google_search_responsive",
              "google_performance_max",
              "google_maps",
              "meta_feed",
              "meta_story"
            ],
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "creatives": {
            "items": {
              "$ref": "#/components/schemas/AdCampaignCreativeLinkDto"
            },
            "type": "array"
          },
          "dailyBudgetMicros": {
            "type": "object"
          },
          "endAt": {
            "format": "date-time",
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "objective": {
            "type": "string"
          },
          "providerCampaignId": {
            "type": "string"
          },
          "providerStatus": {
            "type": "string"
          },
          "publishJobs": {
            "items": {
              "$ref": "#/components/schemas/AdCampaignPublishJobDto"
            },
            "type": "array"
          },
          "startAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "pending_publish",
              "submitting",
              "in_review",
              "active",
              "paused",
              "failed",
              "completed"
            ],
            "type": "string"
          },
          "targetRegions": {
            "items": {
              "$ref": "#/components/schemas/AdCampaignTargetRegionResponseDto"
            },
            "type": "array"
          },
          "totalBudgetMicros": {
            "type": "object"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "channelSubtype",
          "status",
          "targetRegions",
          "creatives",
          "publishJobs",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "AdCampaignSummaryDto": {
        "properties": {
          "campaignId": {
            "example": "1234567890",
            "type": "string"
          },
          "campaignName": {
            "example": "Brand Awareness - HVAC",
            "type": "string"
          },
          "channel": {
            "example": "SEARCH",
            "type": "string"
          },
          "clicks": {
            "example": 320,
            "type": "number"
          },
          "conversions": {
            "example": 42,
            "type": "number"
          },
          "cpa": {
            "description": "Cost per acquisition in currency units.",
            "example": 2.98,
            "type": "number"
          },
          "cpc": {
            "description": "Cost per click in currency units.",
            "example": 0.39,
            "type": "number"
          },
          "ctr": {
            "description": "Click-through rate percentage.",
            "example": 2.67,
            "type": "number"
          },
          "currencyCode": {
            "example": "USD",
            "type": "string"
          },
          "dailyBudget": {
            "description": "Daily budget in account currency units.",
            "example": 5,
            "type": "number"
          },
          "dailyBudgetMicros": {
            "example": 5000000,
            "type": "number"
          },
          "endDate": {
            "example": "2025-06-30",
            "type": "string"
          },
          "impressions": {
            "example": 12000,
            "type": "number"
          },
          "metadata": {
            "example": {
              "campaignBudgetId": "1234",
              "effectiveStatus": "ACTIVE"
            },
            "type": "object"
          },
          "objective": {
            "example": "LEAD_GENERATION",
            "type": "string"
          },
          "spend": {
            "example": 125,
            "type": "number"
          },
          "spendMicros": {
            "example": 125000000,
            "type": "number"
          },
          "startDate": {
            "example": "2025-01-01",
            "type": "string"
          },
          "status": {
            "example": "ENABLED",
            "type": "string"
          }
        },
        "required": [
          "campaignId",
          "spendMicros",
          "spend",
          "impressions",
          "clicks"
        ],
        "type": "object"
      },
      "AdCampaignTargetRegionDto": {
        "properties": {
          "latitude": {
            "example": 37.7749,
            "type": "number"
          },
          "locationId": {
            "description": "Link to existing organization location if applicable",
            "type": "string"
          },
          "longitude": {
            "example": -122.4194,
            "type": "number"
          },
          "polygonPoints": {
            "description": "Polygon vertices (min 3, max 12)",
            "items": {
              "$ref": "#/components/schemas/AdCampaignPolygonPointDto"
            },
            "type": "array"
          },
          "postalCodes": {
            "description": "ZIP/postal codes if type=zip",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "radiusMeters": {
            "description": "Radius in meters (1–80km)",
            "example": 16093,
            "type": "number"
          },
          "type": {
            "enum": [
              "radius",
              "polygon",
              "zip"
            ],
            "example": "radius",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "AdCampaignTargetRegionResponseDto": {
        "properties": {
          "latitude": {
            "type": "number"
          },
          "locationId": {
            "type": "string"
          },
          "longitude": {
            "type": "number"
          },
          "polygonPoints": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "radiusMeters": {
            "type": "number"
          },
          "type": {
            "enum": [
              "radius",
              "polygon",
              "zip"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "AdCampaignTimeseriesDto": {
        "properties": {
          "clicks": {
            "example": 14,
            "type": "number"
          },
          "conversions": {
            "example": 3,
            "type": "number"
          },
          "cpa": {
            "example": 0.93,
            "type": "number"
          },
          "cpc": {
            "example": 0.2,
            "type": "number"
          },
          "ctr": {
            "example": 3.11,
            "type": "number"
          },
          "date": {
            "example": "2025-01-20",
            "type": "string"
          },
          "impressions": {
            "example": 450,
            "type": "number"
          },
          "spend": {
            "example": 2.8,
            "type": "number"
          },
          "spendMicros": {
            "example": 2800000,
            "type": "number"
          }
        },
        "required": [
          "date",
          "impressions",
          "clicks",
          "spendMicros",
          "spend"
        ],
        "type": "object"
      },
      "AdCreativeAssetResponseDto": {
        "properties": {
          "assetType": {
            "type": "string"
          },
          "content": {
            "description": "Structured copy payload or metadata",
            "type": "object"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "filestackHandle": {
            "type": "string"
          },
          "filestackUrl": {
            "type": "string"
          },
          "format": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "assetType",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "AdCreativeResponseDto": {
        "properties": {
          "adAccountId": {
            "type": "string"
          },
          "assets": {
            "items": {
              "$ref": "#/components/schemas/AdCreativeAssetResponseDto"
            },
            "type": "array"
          },
          "audience": {
            "type": "string"
          },
          "channelSubtype": {
            "enum": [
              "google_search_responsive",
              "google_performance_max",
              "google_maps",
              "meta_feed",
              "meta_story"
            ],
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "errorMessage": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "objective": {
            "type": "string"
          },
          "offerSummary": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "resultPayload": {
            "type": "object"
          },
          "status": {
            "enum": [
              "queued",
              "processing",
              "ready",
              "failed"
            ],
            "type": "string"
          },
          "tone": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "organizationId",
          "channelSubtype",
          "status",
          "createdAt",
          "updatedAt",
          "assets"
        ],
        "type": "object"
      },
      "AddProjectMemberDto": {
        "properties": {
          "role": {
            "default": "MEMBER",
            "enum": [
              "MANAGER",
              "MEMBER",
              "VIEWER"
            ],
            "type": "string"
          },
          "userId": {
            "description": "User ID (CUID)",
            "example": "cmigwdn1a0009yip9o2faxg7j",
            "type": "string"
          }
        },
        "required": [
          "userId",
          "role"
        ],
        "type": "object"
      },
      "AddReactionDto": {
        "properties": {
          "emoji": {
            "example": "👍",
            "type": "string"
          }
        },
        "required": [
          "emoji"
        ],
        "type": "object"
      },
      "AddTeamChannelMemberDto": {
        "properties": {
          "userId": {
            "example": "userId",
            "type": "string"
          }
        },
        "required": [
          "userId"
        ],
        "type": "object"
      },
      "AddressDto": {
        "properties": {
          "city": {
            "example": "Austin",
            "type": "string"
          },
          "country": {
            "example": "US",
            "type": "string"
          },
          "line1": {
            "example": "123 Main St",
            "type": "string"
          },
          "line2": {
            "example": "Suite 200",
            "type": "string"
          },
          "postalCode": {
            "example": "78701",
            "type": "string"
          },
          "state": {
            "example": "TX",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AdsBillingSummaryDto": {
        "properties": {
          "autopauseEnabled": {
            "example": true,
            "type": "boolean"
          },
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "estimatedDaysRemaining": {
            "description": "Estimated days remaining based on recent average daily spend",
            "example": 10,
            "type": "number"
          },
          "isAutopaused": {
            "description": "True if ads have been auto-paused due to caps/prepaid",
            "example": false,
            "type": "boolean"
          },
          "monthToDateSpendCents": {
            "description": "Month-to-date spend in cents (legacy field name)",
            "example": 12345,
            "type": "number"
          },
          "mtdSpendCents": {
            "description": "Month-to-date spend in cents (from ingested insights)",
            "example": 12345,
            "type": "number"
          },
          "prepaidBalanceCents": {
            "description": "Prepaid wallet balance in cents",
            "example": 150000,
            "type": "number"
          },
          "remainingPrepaidCents": {
            "description": "Estimated remaining prepaid cents based on month-to-date spend",
            "example": 149000,
            "type": "number"
          },
          "spendCapDailyCents": {
            "example": 20000,
            "type": "number"
          },
          "spendCapMonthlyCents": {
            "example": 200000,
            "type": "number"
          },
          "todaySpendCents": {
            "description": "Today spend in cents (from ingested insights)",
            "example": 123,
            "type": "number"
          }
        },
        "required": [
          "prepaidBalanceCents",
          "autopauseEnabled"
        ],
        "type": "object"
      },
      "AdsBillingTransactionDto": {
        "properties": {
          "amountCents": {
            "example": 2500,
            "type": "number"
          },
          "campaignId": {
            "example": "cmp_123",
            "type": "string"
          },
          "createdAt": {
            "example": "2025-01-21T10:05:00.000Z",
            "type": "string"
          },
          "description": {
            "example": "Ads prepaid top-up",
            "type": "string"
          },
          "id": {
            "example": "abt_123",
            "type": "string"
          },
          "stripePaymentId": {
            "example": "pi_123",
            "type": "string"
          },
          "type": {
            "enum": [
              "topup",
              "spend",
              "refund"
            ],
            "example": "topup",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "amountCents",
          "description",
          "createdAt"
        ],
        "type": "object"
      },
      "AdsBillingTransactionsResponseDto": {
        "properties": {
          "total": {
            "example": 42,
            "type": "number"
          },
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/AdsBillingTransactionDto"
            },
            "type": "array"
          }
        },
        "required": [
          "transactions",
          "total"
        ],
        "type": "object"
      },
      "AdsTopUpIntentResponseDto": {
        "properties": {
          "amountCents": {
            "example": 5000,
            "type": "number"
          },
          "clientSecret": {
            "example": "pi_123_secret_abc",
            "type": "string"
          },
          "paymentIntentId": {
            "example": "pi_123",
            "type": "string"
          }
        },
        "required": [
          "paymentIntentId",
          "clientSecret",
          "amountCents"
        ],
        "type": "object"
      },
      "AgencySettingsDto": {
        "properties": {
          "features": {
            "description": "Feature flags enabled for this agency.",
            "example": [
              "multi-client",
              "whitelabel"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "limits": {
            "$ref": "#/components/schemas/AgencySettingsLimitsDto"
          }
        },
        "type": "object"
      },
      "AgencySettingsLimitsDto": {
        "properties": {
          "clients": {
            "description": "Maximum number of client organizations the agency may manage.",
            "example": 10,
            "type": "number"
          },
          "seats": {
            "description": "Maximum seats (members) across all managed clients.",
            "example": 25,
            "type": "number"
          }
        },
        "type": "object"
      },
      "AgentResponseDto": {
        "properties": {
          "capabilities": {
            "description": "Capabilities of the AI agent",
            "example": [
              "crm_lookup",
              "kb_search",
              "appointment_booking"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "createdAt": {
            "description": "When the agent was created",
            "example": "2024-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "description": "Description of the AI agent",
            "example": "Handles customer inquiries and support requests",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for the AI agent",
            "example": "agent_123",
            "type": "string"
          },
          "isActive": {
            "description": "Whether the agent is active",
            "example": true,
            "type": "boolean"
          },
          "maxTokens": {
            "description": "Maximum tokens for AI responses",
            "example": 4000,
            "type": "number"
          },
          "model": {
            "description": "AI model being used",
            "example": "gpt-4",
            "type": "string"
          },
          "name": {
            "description": "Name of the AI agent",
            "example": "Customer Service Agent",
            "type": "string"
          },
          "systemPrompt": {
            "description": "System prompt for the AI agent",
            "example": "You are a helpful customer service assistant...",
            "type": "string"
          },
          "temperature": {
            "description": "Temperature setting for AI responses",
            "example": 0.7,
            "type": "number"
          },
          "updatedAt": {
            "description": "When the agent was last updated",
            "example": "2024-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "systemPrompt",
          "model",
          "temperature",
          "maxTokens",
          "capabilities",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "AivaChatDto": {
        "properties": {
          "message": {
            "description": "User's text message",
            "type": "string"
          },
          "sessionId": {
            "description": "Optional session ID for conversation continuity",
            "type": "string"
          },
          "voiceAgentId": {
            "description": "The AIVA agent ID to chat with",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "AivaOutboundCallRequestDto": {
        "properties": {
          "phoneNumber": {
            "description": "Destination phone number to call (E.164 recommended, e.g. '+15551234567').",
            "example": "+15551234567",
            "type": "string"
          },
          "voiceAgentId": {
            "description": "Optional VoiceAgent ID to use for this call. If omitted, uses the org primary number assignment / default routing.",
            "type": "string"
          }
        },
        "required": [
          "phoneNumber"
        ],
        "type": "object"
      },
      "AivaOutboundCallResponseDto": {
        "properties": {
          "callId": {
            "description": "Twilio Call SID (used as callId)",
            "example": "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "type": "string"
          },
          "initiatedAt": {
            "description": "ISO timestamp when initiated",
            "type": "string"
          },
          "status": {
            "description": "Call status",
            "example": "initiated",
            "type": "string"
          }
        },
        "required": [
          "callId",
          "status",
          "initiatedAt"
        ],
        "type": "object"
      },
      "AivaWebRtcOfferDto": {
        "properties": {
          "sdp": {
            "description": "WebRTC SDP offer",
            "example": "v=0\\r\\n...",
            "type": "string"
          },
          "token": {
            "description": "Signed session token (from POST /v1/aiva/sessions)",
            "type": "string"
          },
          "type": {
            "description": "SDP type",
            "enum": [
              "offer"
            ],
            "type": "string"
          }
        },
        "required": [
          "token",
          "sdp",
          "type"
        ],
        "type": "object"
      },
      "AnalyticsEventsDto": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/SiteAnalyticsEventDto"
            },
            "type": "array"
          }
        },
        "required": [
          "events"
        ],
        "type": "object"
      },
      "AnalyzeCallSentimentDto": {
        "properties": {},
        "type": "object"
      },
      "AnalyzeCustomerExperienceDto": {
        "properties": {},
        "type": "object"
      },
      "ApplyLifecyclePresetDto": {
        "properties": {
          "preset": {
            "description": "Preset to apply to lifecycle stages",
            "enum": [
              "B2B_SAAS",
              "HOME_SERVICES",
              "WELLNESS_STUDIO",
              "REAL_ESTATE",
              "INSURANCE_AGENCY",
              "LEGAL_SERVICES",
              "FINANCIAL_SERVICES",
              "SOLAR",
              "ROOFING",
              "PROPERTY_SERVICES"
            ],
            "type": "string"
          }
        },
        "required": [
          "preset"
        ],
        "type": "object"
      },
      "ApplyLoyaltyDto": {
        "properties": {
          "amount": {
            "example": 25,
            "type": "number"
          },
          "invoiceId": {
            "example": "invoice_uuid",
            "type": "string"
          },
          "source": {
            "example": "manual",
            "type": "string"
          }
        },
        "required": [
          "invoiceId",
          "amount"
        ],
        "type": "object"
      },
      "ApplyPostCallRuleTemplateDto": {
        "properties": {
          "applyToAll": {
            "description": "Apply to every unified agent in the organization.",
            "example": false,
            "type": "boolean"
          },
          "mode": {
            "description": "append adds the template rules to existing rules; replace overwrites the target agents rule sets with the template rules.",
            "enum": [
              "append",
              "replace"
            ],
            "example": "append",
            "type": "string"
          },
          "unifiedAgentIds": {
            "description": "Unified agent ids to apply the template to. Required unless applyToAll is true.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ApplyWorkflowSuggestionDto": {
        "properties": {
          "activate": {
            "description": "Activate the workflow immediately after creation",
            "example": false,
            "type": "boolean"
          },
          "name": {
            "description": "Override the generated workflow name",
            "example": "Post-service review booster",
            "type": "string"
          },
          "templateId": {
            "description": "Identifier of the workflow template to instantiate",
            "example": "general_review_request_follow_up",
            "type": "string"
          }
        },
        "required": [
          "templateId"
        ],
        "type": "object"
      },
      "AssignOrgToTwilioShardDto": {
        "properties": {
          "force": {
            "default": false,
            "description": "Allow reassignment even if org already has a shard",
            "type": "boolean"
          },
          "orgId": {
            "description": "Organization ID",
            "type": "string"
          },
          "shardId": {
            "description": "Twilio shard ID",
            "type": "string"
          }
        },
        "required": [
          "orgId",
          "shardId"
        ],
        "type": "object"
      },
      "AssignPhoneNumberDto": {
        "properties": {
          "isPrimary": {
            "description": "Whether this number should be the organization primary.",
            "example": true,
            "type": "boolean"
          },
          "voiceAgentId": {
            "description": "Voice agent ID to assign the number to.",
            "example": "voiceagent_123",
            "type": "string"
          }
        },
        "required": [
          "voiceAgentId"
        ],
        "type": "object"
      },
      "AssignSessionDto": {
        "properties": {},
        "type": "object"
      },
      "AttachSmsNumberDto": {
        "properties": {
          "campaignId": {
            "description": "Attach to a specific campaign registration id (preferred when multiple exist).",
            "type": "string"
          },
          "campaignType": {
            "description": "Attach to the newest APPROVED campaign of this type.",
            "enum": [
              "CUSTOMER_CARE",
              "MARKETING"
            ],
            "type": "string"
          },
          "phoneNumber": {
            "description": "E.164 phone number owned by the org (e.g., +15551234567)",
            "type": "string"
          }
        },
        "required": [
          "phoneNumber"
        ],
        "type": "object"
      },
      "AutoBookAppointmentDto": {
        "properties": {},
        "type": "object"
      },
      "AutoHandoffDto": {
        "properties": {
          "enabled": {
            "example": true,
            "type": "boolean"
          },
          "triggers": {
            "example": [
              "complex_issues",
              "customer_frustrated"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "BackfillTwilioShardsDto": {
        "properties": {
          "dryRun": {
            "default": true,
            "description": "When true, do not write changes",
            "type": "boolean"
          },
          "limit": {
            "description": "Limit number of orgs updated in this call",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BatchAnalyzeCallSentimentDto": {
        "properties": {},
        "type": "object"
      },
      "BatchContactEnrichmentDto": {
        "properties": {
          "contactIds": {
            "description": "Contact IDs to enrich.",
            "example": [
              "cuid_1",
              "cuid_2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "refresh": {
            "default": false,
            "description": "If true, bypass cache and recompute enrichment.",
            "type": "boolean"
          }
        },
        "required": [
          "contactIds"
        ],
        "type": "object"
      },
      "BatchCreateTemplateDto": {
        "properties": {
          "category": {
            "description": "Template category",
            "type": "string"
          },
          "description": {
            "description": "Template description",
            "type": "string"
          },
          "edges": {
            "description": "Workflow edges",
            "type": "array"
          },
          "isActive": {
            "default": false,
            "description": "Whether to activate the workflow immediately",
            "type": "boolean"
          },
          "name": {
            "description": "Template name",
            "type": "string"
          },
          "nodes": {
            "description": "Workflow nodes",
            "type": "array"
          },
          "trigger": {
            "description": "Workflow trigger configuration",
            "type": "object"
          }
        },
        "required": [
          "name",
          "description",
          "category",
          "trigger",
          "nodes",
          "edges"
        ],
        "type": "object"
      },
      "BatchCreateTemplatesRequestDto": {
        "properties": {
          "templates": {
            "description": "Array of workflow templates to create",
            "items": {
              "$ref": "#/components/schemas/BatchCreateTemplateDto"
            },
            "type": "array"
          }
        },
        "required": [
          "templates"
        ],
        "type": "object"
      },
      "BatchOperation": {
        "properties": {
          "id": {
            "description": "Unique identifier for this operation (used in response)",
            "example": "op1",
            "type": "string"
          },
          "params": {
            "description": "Parameters for the operation",
            "example": {
              "limit": 10,
              "offset": 0
            },
            "type": "object"
          },
          "type": {
            "description": "Type of operation to execute",
            "enum": [
              "get_contacts",
              "get_deals",
              "get_dashboard_stats",
              "get_contact",
              "get_deal",
              "get_tasks",
              "get_appointments",
              "get_companies"
            ],
            "example": "get_contacts",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "type": "object"
      },
      "BatchOperationResult": {
        "properties": {
          "data": {
            "description": "Response data (if successful)",
            "type": "object"
          },
          "error": {
            "description": "Error message (if failed)",
            "type": "string"
          },
          "id": {
            "description": "Operation ID from request",
            "type": "string"
          },
          "success": {
            "description": "Whether the operation succeeded",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "success"
        ],
        "type": "object"
      },
      "BatchRequestDto": {
        "properties": {
          "operations": {
            "description": "Array of operations to execute in parallel",
            "items": {
              "$ref": "#/components/schemas/BatchOperation"
            },
            "type": "array"
          },
          "requests": {
            "deprecated": true,
            "description": "DEPRECATED alias for operations. Prefer sending `operations`.",
            "items": {
              "$ref": "#/components/schemas/BatchOperation"
            },
            "type": "array"
          }
        },
        "required": [
          "operations"
        ],
        "type": "object"
      },
      "BatchResponseDto": {
        "properties": {
          "executionTimeMs": {
            "description": "Total execution time in milliseconds",
            "type": "number"
          },
          "results": {
            "description": "Results for each operation",
            "items": {
              "$ref": "#/components/schemas/BatchOperationResult"
            },
            "type": "array"
          }
        },
        "required": [
          "results",
          "executionTimeMs"
        ],
        "type": "object"
      },
      "BatchWorkflowTemplatesDto": {
        "properties": {
          "templates": {
            "items": {
              "$ref": "#/components/schemas/WorkflowTemplateInputDto"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "BlockOrderEntry": {
        "properties": {
          "blockId": {
            "description": "Block ID",
            "type": "string"
          },
          "order": {
            "description": "New order index",
            "type": "number"
          },
          "pageId": {
            "description": "Page ID to attach block (for moves)",
            "type": "string"
          }
        },
        "required": [
          "blockId",
          "order",
          "pageId"
        ],
        "type": "object"
      },
      "BookAppointmentDto": {
        "properties": {
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "contactInfo": {
            "example": {
              "email": "john@example.com",
              "name": "John Doe",
              "phone": "+1234567890"
            },
            "type": "object"
          },
          "duration": {
            "description": "Duration in minutes",
            "example": 30,
            "type": "number"
          },
          "metadata": {
            "example": {
              "bookingSource": "widget",
              "chatSummary": "Customer asked about pricing"
            },
            "type": "object"
          },
          "notes": {
            "example": "Interested in enterprise plan",
            "type": "string"
          },
          "serviceId": {
            "example": "service-offering-id",
            "type": "string"
          },
          "staffId": {
            "example": "staff-id",
            "type": "string"
          },
          "startTime": {
            "example": "2025-01-10T14:00:00Z",
            "type": "string"
          }
        },
        "required": [
          "serviceId",
          "startTime"
        ],
        "type": "object"
      },
      "BookingSettingsDto": {
        "properties": {
          "allowCancellation": {
            "example": true,
            "type": "boolean"
          },
          "bufferMinutes": {
            "example": 15,
            "type": "number"
          },
          "cancellationHours": {
            "example": 24,
            "type": "number"
          },
          "customFields": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "maxAdvanceDays": {
            "example": 90,
            "type": "number"
          },
          "minAdvanceHours": {
            "example": 24,
            "type": "number"
          },
          "requirePhone": {
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "BrandKitAssetUploadDto": {
        "properties": {
          "fileUrl": {
            "example": "https://cdn.example.com/logo.png",
            "type": "string"
          },
          "filename": {
            "example": "logo.png",
            "type": "string"
          },
          "type": {
            "example": "logo",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BrandingDto": {
        "properties": {
          "companyName": {
            "example": "ACME Services",
            "type": "string"
          },
          "logoUrl": {
            "example": "https://example.com/logo.png",
            "type": "string"
          },
          "primaryColor": {
            "example": "#0066CC",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BulkActionDto": {
        "properties": {
          "action": {
            "enum": [
              "assign",
              "resolve",
              "tag",
              "export"
            ],
            "type": "string"
          },
          "assigneeId": {
            "description": "Required for ASSIGN action",
            "example": "user-id",
            "type": "string"
          },
          "sessionIds": {
            "example": [
              "session-id-1",
              "session-id-2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tags": {
            "description": "Required for TAG action",
            "example": [
              "tag1",
              "tag2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "action",
          "sessionIds"
        ],
        "type": "object"
      },
      "BulkDeleteCompaniesDto": {
        "properties": {
          "companyIds": {
            "description": "Array of company IDs to delete",
            "example": [
              "company_1",
              "company_2",
              "company_3"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "companyIds"
        ],
        "type": "object"
      },
      "BulkDeleteContactsDto": {
        "properties": {
          "contactIds": {
            "description": "Array of contact IDs to delete",
            "example": [
              "contact_1",
              "contact_2",
              "contact_3"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "contactIds"
        ],
        "type": "object"
      },
      "BulkDeleteDealsDto": {
        "properties": {
          "dealIds": {
            "description": "Array of deal IDs to delete",
            "example": [
              "deal_1",
              "deal_2",
              "deal_3"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "dealIds"
        ],
        "type": "object"
      },
      "BulkSyncListingsDto": {
        "properties": {
          "force": {
            "default": false,
            "description": "Force sync even if recently synced (best-effort; depends on provider capabilities)",
            "type": "boolean"
          },
          "listingIds": {
            "description": "Optional specific listing connection IDs to sync (if omitted, sync all connected listings)",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "BulkUpdateCompaniesDto": {
        "properties": {
          "ids": {
            "description": "Company IDs to update",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updates": {
            "$ref": "#/components/schemas/BulkUpdateCompaniesFieldsDto"
          }
        },
        "required": [
          "ids",
          "updates"
        ],
        "type": "object"
      },
      "BulkUpdateCompaniesFieldsDto": {
        "properties": {
          "ownerId": {
            "description": "Assign owner userId (or null to clear)",
            "nullable": true,
            "type": "string"
          },
          "tags": {
            "description": "Replace tags array",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "BulkUpdateContactsDto": {
        "properties": {
          "ids": {
            "description": "Contact IDs to update",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updates": {
            "$ref": "#/components/schemas/BulkUpdateContactsFieldsDto"
          }
        },
        "required": [
          "ids",
          "updates"
        ],
        "type": "object"
      },
      "BulkUpdateContactsFieldsDto": {
        "properties": {
          "companyId": {
            "description": "Set companyId (or null to clear)",
            "nullable": true,
            "type": "string"
          },
          "ownerId": {
            "description": "Assign owner userId (or null to clear)",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "LEAD",
              "ACTIVE",
              "INACTIVE"
            ],
            "type": "string"
          },
          "tags": {
            "description": "Replace tags array",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "BulkUpdateDealsDto": {
        "properties": {
          "ids": {
            "description": "Deal IDs to update",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updates": {
            "$ref": "#/components/schemas/BulkUpdateDealsFieldsDto"
          }
        },
        "required": [
          "ids",
          "updates"
        ],
        "type": "object"
      },
      "BulkUpdateDealsFieldsDto": {
        "properties": {
          "ownerId": {
            "description": "Assign owner userId (or null to clear)",
            "nullable": true,
            "type": "string"
          },
          "probability": {
            "description": "Set probability (0-100)",
            "type": "number"
          },
          "stageId": {
            "description": "Move deals to stageId",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BusinessHoursDto": {
        "properties": {
          "end": {
            "example": "17:00",
            "type": "string"
          },
          "start": {
            "example": "09:00",
            "type": "string"
          },
          "timezone": {
            "example": "UTC",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BusinessHoursScheduleEntryDto": {
        "properties": {
          "dayOfWeek": {
            "description": "0=Sunday, 6=Saturday",
            "example": 1,
            "type": "number"
          },
          "enabled": {
            "example": true,
            "type": "boolean"
          },
          "endTime": {
            "example": "17:00",
            "type": "string"
          },
          "startTime": {
            "example": "09:00",
            "type": "string"
          }
        },
        "required": [
          "dayOfWeek",
          "startTime",
          "endTime"
        ],
        "type": "object"
      },
      "BusinessProfileDto": {
        "properties": {
          "mcc": {
            "description": "Stripe MCC",
            "example": "1520",
            "type": "string"
          },
          "productDescription": {
            "example": "Residential and commercial roofing services",
            "type": "string"
          },
          "supportEmail": {
            "example": "support@acme.com",
            "type": "string"
          },
          "supportPhone": {
            "example": "+15125551234",
            "type": "string"
          },
          "url": {
            "example": "https://acmeroofing.com",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CadenceGoalInput": {
        "properties": {
          "criteria": {
            "type": "object"
          },
          "goalType": {
            "enum": [
              "BOOKING_CREATED",
              "DEAL_STAGE_CHANGED",
              "INVOICE_PAID",
              "PAYMENT_COLLECTED",
              "CUSTOM"
            ],
            "type": "string"
          }
        },
        "required": [
          "goalType"
        ],
        "type": "object"
      },
      "CadenceQuickLaunchDto": {
        "properties": {
          "aiContext": {
            "description": "Extra AI context (services, offers, brand voice, etc.)",
            "type": "object"
          },
          "audienceSavedViewId": {
            "description": "Saved view ID to auto-target contacts for this cadence",
            "type": "string"
          },
          "complianceTags": {
            "description": "Compliance tags or guardrails that must be honored (e.g., hipaa, tcpa).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "goalStatement": {
            "description": "Describe the scenario, audience, and outcome the cadence should drive.",
            "type": "string"
          },
          "goalType": {
            "description": "Primary business goal to track",
            "enum": [
              "BOOKING_CREATED",
              "DEAL_STAGE_CHANGED",
              "INVOICE_PAID",
              "PAYMENT_COLLECTED",
              "CUSTOM"
            ],
            "type": "string"
          },
          "includeTaskHandOff": {
            "description": "Force a manual task hand-off step near the end.",
            "type": "boolean"
          },
          "maxSteps": {
            "default": 5,
            "description": "Maximum number of steps to generate (1-10).",
            "type": "number"
          },
          "name": {
            "description": "Friendly label for the cadence (used as template name)",
            "maxLength": 120,
            "minLength": 2,
            "type": "string"
          },
          "preferredChannels": {
            "description": "Restrict cadence to these channel types.",
            "items": {
              "enum": [
                "SMS",
                "EMAIL",
                "VOICE_CALL",
                "TASK",
                "WEBHOOK",
                "AI_DECISION"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "quietHours": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QuickLaunchQuietHoursDto"
              }
            ],
            "description": "Quiet hours the cadence must obey."
          },
          "toneOfVoice": {
            "description": "Tone/voice guidance (e.g., “warm, confident, premium”).",
            "type": "string"
          },
          "vertical": {
            "description": "Industry or vertical context (e.g., medspa, hvac, legal)",
            "type": "string"
          }
        },
        "required": [
          "name",
          "goalStatement"
        ],
        "type": "object"
      },
      "CadenceQuickLaunchPublishDto": {
        "properties": {
          "acknowledgedCompliance": {
            "description": "Indicates the compliance checklist was reviewed and approved before publishing.",
            "type": "boolean"
          },
          "aiContext": {
            "description": "Extra AI context (services, offers, brand voice, etc.)",
            "type": "object"
          },
          "audienceSavedViewId": {
            "description": "Saved view ID to auto-target contacts for this cadence",
            "type": "string"
          },
          "complianceTags": {
            "description": "Compliance tags or guardrails that must be honored (e.g., hipaa, tcpa).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "goalStatement": {
            "description": "Describe the scenario, audience, and outcome the cadence should drive.",
            "type": "string"
          },
          "goalType": {
            "description": "Primary business goal to track",
            "enum": [
              "BOOKING_CREATED",
              "DEAL_STAGE_CHANGED",
              "INVOICE_PAID",
              "PAYMENT_COLLECTED",
              "CUSTOM"
            ],
            "type": "string"
          },
          "includeTaskHandOff": {
            "description": "Force a manual task hand-off step near the end.",
            "type": "boolean"
          },
          "maxSteps": {
            "default": 5,
            "description": "Maximum number of steps to generate (1-10).",
            "type": "number"
          },
          "name": {
            "description": "Friendly label for the cadence (used as template name)",
            "maxLength": 120,
            "minLength": 2,
            "type": "string"
          },
          "preferredChannels": {
            "description": "Restrict cadence to these channel types.",
            "items": {
              "type": "string",
              "enum": [
                "SMS",
                "EMAIL",
                "VOICE_CALL",
                "TASK",
                "WEBHOOK",
                "AI_DECISION"
              ]
            },
            "type": "array"
          },
          "quietHours": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QuickLaunchQuietHoursDto"
              }
            ],
            "description": "Quiet hours the cadence must obey."
          },
          "toneOfVoice": {
            "description": "Tone/voice guidance (e.g., “warm, confident, premium”).",
            "type": "string"
          },
          "vertical": {
            "description": "Industry or vertical context (e.g., medspa, hvac, legal)",
            "type": "string"
          }
        },
        "required": [
          "name",
          "goalStatement",
          "acknowledgedCompliance"
        ],
        "type": "object"
      },
      "CadenceStepInput": {
        "properties": {
          "aiPromptOverrides": {
            "description": "Overrides for AI prompt per step",
            "type": "object"
          },
          "channelPayload": {
            "description": "Channel/template payload",
            "type": "object"
          },
          "metadata": {
            "description": "Additional metadata / compliance",
            "type": "object"
          },
          "position": {
            "description": "0-indexed execution order",
            "type": "number"
          },
          "type": {
            "enum": [
              "SMS",
              "EMAIL",
              "VOICE_CALL",
              "TASK",
              "WEBHOOK",
              "AI_DECISION"
            ],
            "type": "string"
          },
          "waitCondition": {
            "description": "Wait condition (delay, trigger)",
            "type": "object"
          }
        },
        "required": [
          "type",
          "position"
        ],
        "type": "object"
      },
      "CalculateToolDto": {
        "properties": {
          "inputs": {
            "description": "Input parameters for the tool calculation",
            "example": {
              "complexity": "moderate",
              "location": "suburban",
              "materialType": "asphalt",
              "squareFootage": 2000
            },
            "type": "object"
          }
        },
        "required": [
          "inputs"
        ],
        "type": "object"
      },
      "CallRecordingResponseDto": {
        "properties": {
          "callId": {
            "description": "Internal call ID",
            "type": "string"
          },
          "channels": {
            "description": "Number of audio channels",
            "type": "string"
          },
          "createdAt": {
            "description": "Recording created timestamp",
            "type": "string"
          },
          "duration": {
            "description": "Recording duration in seconds",
            "type": "number"
          },
          "format": {
            "description": "Recording format",
            "type": "string"
          },
          "recordingSid": {
            "description": "Twilio Recording SID",
            "type": "string"
          },
          "recordingUrl": {
            "description": "Signed URL to access recording",
            "type": "string"
          },
          "size": {
            "description": "Recording file size in bytes",
            "type": "number"
          }
        },
        "required": [
          "callId",
          "recordingUrl",
          "duration",
          "format",
          "createdAt"
        ],
        "type": "object"
      },
      "CallStatusResponseDto": {
        "properties": {
          "callId": {
            "description": "Internal call ID",
            "type": "string"
          },
          "contactName": {
            "description": "Contact name if associated",
            "type": "string"
          },
          "direction": {
            "description": "Call direction (INBOUND|OUTBOUND)",
            "type": "string"
          },
          "disposition": {
            "description": "Disposition label",
            "type": "string"
          },
          "duration": {
            "description": "Call duration in seconds (0 if still in progress)",
            "type": "number"
          },
          "fromNumber": {
            "description": "From number",
            "type": "string"
          },
          "notes": {
            "description": "Internal notes captured by the agent",
            "type": "string"
          },
          "phoneNumber": {
            "description": "Phone number",
            "type": "string"
          },
          "startedAt": {
            "description": "Timestamp when call started",
            "type": "string"
          },
          "status": {
            "description": "Current call status",
            "type": "string"
          },
          "tags": {
            "description": "Tags applied to the call",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "threadId": {
            "description": "Inbox thread ID linked to this call",
            "type": "string"
          },
          "toNumber": {
            "description": "To number",
            "type": "string"
          },
          "voicemailDropId": {
            "description": "Voicemail drop configured for this call",
            "type": "string"
          }
        },
        "required": [
          "callId",
          "status",
          "duration",
          "startedAt",
          "phoneNumber"
        ],
        "type": "object"
      },
      "CallTranscriptResponseDto": {
        "properties": {
          "actionItems": {
            "description": "Action items extracted from the call",
            "items": {
              "$ref": "#/components/schemas/ActionItemDto"
            },
            "type": "array"
          },
          "analyzedAt": {
            "description": "Timestamp when analysis was completed",
            "type": "string"
          },
          "callId": {
            "description": "Internal call ID",
            "type": "string"
          },
          "duration": {
            "description": "Call duration in seconds",
            "type": "number"
          },
          "entities": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EntitiesDto"
              }
            ],
            "description": "Named entities extracted from the call"
          },
          "keyPoints": {
            "description": "Key points extracted from the call",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "language": {
            "description": "Detected language",
            "type": "string"
          },
          "sentiment": {
            "description": "Overall sentiment of the call",
            "type": "string"
          },
          "sentimentScore": {
            "description": "Sentiment confidence score (0-1)",
            "type": "number"
          },
          "summary": {
            "description": "AI-generated summary of the call",
            "type": "string"
          },
          "transcribedAt": {
            "description": "Timestamp when transcription was completed",
            "type": "string"
          },
          "transcript": {
            "description": "Full conversation transcript",
            "type": "string"
          },
          "wordCount": {
            "description": "Word count of transcript",
            "type": "number"
          }
        },
        "required": [
          "callId",
          "transcript",
          "duration"
        ],
        "type": "object"
      },
      "CampaignMetricsResponseDto": {
        "properties": {
          "campaignId": {
            "example": "mac_123",
            "type": "string"
          },
          "clicks": {
            "example": 350,
            "type": "number"
          },
          "conversionRate": {
            "description": "Conversion rate percentage",
            "example": 4.29,
            "type": "number"
          },
          "conversions": {
            "example": 15,
            "type": "number"
          },
          "cpa": {
            "description": "Cost per acquisition in USD",
            "example": 8.33,
            "type": "number"
          },
          "cpc": {
            "description": "Cost per click in USD",
            "example": 0.36,
            "type": "number"
          },
          "ctr": {
            "description": "Click-through rate percentage",
            "example": 2.8,
            "type": "number"
          },
          "granularity": {
            "example": "daily",
            "type": "string"
          },
          "impressions": {
            "example": 12500,
            "type": "number"
          },
          "periodEnd": {
            "example": "2024-01-31",
            "type": "string"
          },
          "periodStart": {
            "example": "2024-01-01",
            "type": "string"
          },
          "spend": {
            "description": "Spend in USD",
            "example": 125,
            "type": "number"
          },
          "spendMicros": {
            "description": "Spend in micros",
            "example": "125000000",
            "type": "string"
          },
          "timeseries": {
            "items": {
              "properties": {
                "clicks": {
                  "type": "number"
                },
                "conversions": {
                  "type": "number"
                },
                "date": {
                  "format": "date",
                  "type": "string"
                },
                "impressions": {
                  "type": "number"
                },
                "spendMicros": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "campaignId",
          "impressions",
          "clicks",
          "conversions",
          "spendMicros",
          "spend",
          "ctr",
          "cpc",
          "cpa",
          "conversionRate",
          "periodStart",
          "periodEnd",
          "granularity"
        ],
        "type": "object"
      },
      "CancelWarmTransferDto": {
        "properties": {
          "consultUuid": {
            "description": "Consultation leg UUID returned by warm transfer initiation",
            "type": "string"
          }
        },
        "required": [
          "consultUuid"
        ],
        "type": "object"
      },
      "ChangeMemberRoleDto": {
        "properties": {
          "role": {
            "enum": [
              "OWNER",
              "ADMIN",
              "USER",
              "AGENCY_ADMIN",
              "AGENCY_USER"
            ],
            "example": "ADMIN",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "type": "object"
      },
      "CheckCreditBalanceDto": {
        "properties": {
          "action": {
            "description": "Action to check credit cost for",
            "enum": [
              "ai_message",
              "ai_voice_minute",
              "ai_resolution",
              "ai_chat_interaction",
              "ai_ad_image",
              "ai_ad_creative",
              "ai_review_reply",
              "sms_segment",
              "sms_message",
              "email_send",
              "dialer_call_minute",
              "workflow_execution",
              "ai_followup",
              "ai_analytics",
              "ai_mining",
              "ai_prediction",
              "ai_revenue",
              "ai_scheduling",
              "ai_experience",
              "ai_performance"
            ],
            "type": "string"
          },
          "quantity": {
            "description": "Quantity of actions",
            "example": 1,
            "type": "number"
          }
        },
        "required": [
          "action",
          "quantity"
        ],
        "type": "object"
      },
      "ClassifyMessageDto": {
        "properties": {
          "content": {
            "description": "Message content to classify",
            "example": "Hi, I need to schedule a roofing repair. What are your rates?",
            "type": "string"
          },
          "messageContent": {
            "description": "Deprecated alias for message content (supported for backward compatibility)",
            "example": "Customer message body",
            "type": "string"
          },
          "messageId": {
            "description": "Message ID to classify",
            "example": "msg_456",
            "type": "string"
          }
        },
        "required": [
          "messageId",
          "content"
        ],
        "type": "object"
      },
      "CompanyDto": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "name": {
            "example": "Acme Roofing LLC",
            "type": "string"
          },
          "phone": {
            "example": "+15125551234",
            "type": "string"
          },
          "registrationNumber": {
            "example": "123456789",
            "type": "string"
          },
          "taxId": {
            "example": "12-3456789",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CompleteOnboardingDto": {
        "properties": {
          "customServices": {
            "items": {
              "$ref": "#/components/schemas/CustomServiceDto"
            },
            "type": "array"
          },
          "selectedServices": {
            "description": "Predefined services selected from onboarding templates",
            "example": [
              "AC Repair",
              "Maintenance Plans"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "CompleteOnboardingPhaseDto": {
        "properties": {
          "phase": {
            "description": "Phase number to mark complete",
            "maximum": 3,
            "minimum": 1,
            "type": "number"
          }
        },
        "required": [
          "phase"
        ],
        "type": "object"
      },
      "CompleteWarmTransferDto": {
        "properties": {
          "consultUuid": {
            "description": "Consultation leg UUID returned by warm transfer initiation",
            "type": "string"
          },
          "originalCallSid": {
            "description": "Original active call SID/UUID",
            "type": "string"
          }
        },
        "required": [
          "originalCallSid",
          "consultUuid"
        ],
        "type": "object"
      },
      "ConfigDto": {
        "properties": {
          "bookingSettings": {
            "$ref": "#/components/schemas/BookingSettingsDto"
          },
          "branding": {
            "$ref": "#/components/schemas/BrandingDto"
          },
          "businessHours": {
            "description": "Business hours map: day -> [{start,end}]",
            "type": "object"
          },
          "locations": {
            "description": "Location IDs",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "services": {
            "description": "Service offering IDs",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "staff": {
            "description": "Staff member IDs",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ConnectIntegrationDto": {
        "properties": {
          "config": {
            "description": "Integration configuration",
            "example": {
              "apiKey": "sk_test_...",
              "environment": "test",
              "webhookSecret": "whsec_..."
            },
            "type": "object"
          },
          "name": {
            "description": "Custom name for the integration",
            "example": "Stripe Payment",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConnectSmtpChannelDto": {
        "properties": {
          "externalId": {
            "description": "Send-from inbox email address",
            "example": "inbox@acme.com",
            "type": "string"
          },
          "fromName": {
            "example": "Acme Service Team",
            "type": "string"
          },
          "isShared": {
            "default": false,
            "type": "boolean"
          },
          "locationId": {
            "description": "Location to own this channel; defaults to active location context.",
            "type": "string"
          },
          "replyTo": {
            "example": "support@acme.com",
            "type": "string"
          },
          "smtp": {
            "$ref": "#/components/schemas/SmtpConnectionDto"
          },
          "verify": {
            "default": true,
            "description": "When true, verifies SMTP connection before marking channel healthy.",
            "type": "boolean"
          }
        },
        "required": [
          "externalId",
          "smtp"
        ],
        "type": "object"
      },
      "ConsentSettingsDto": {
        "properties": {
          "allowReplyOnInboundThread": {
            "description": "Allow agent replies on threads with prior inbound history even if consentSms=false.",
            "example": true,
            "type": "boolean"
          },
          "requireExplicitSmsConsent": {
            "description": "Require explicit consentSms=true before cold outbound SMS/WhatsApp. Opt-out is always enforced regardless.",
            "example": false,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ContactFiltersDto": {
        "properties": {
          "companyIds": {
            "example": [
              "cuid_company_1",
              "cuid_company_2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "createdAfter": {
            "example": "2025-01-01T00:00:00.000Z",
            "type": "string"
          },
          "customFieldFilters": {
            "description": "Custom field filters (stored but currently not applied to recipient selection)",
            "type": "object"
          },
          "lastContactedBefore": {
            "example": "2025-01-01T00:00:00.000Z",
            "type": "string"
          },
          "lifecycleStage": {
            "description": "Lifecycle stage identifiers (currently treated as Contact.lifecycleStageId values)",
            "example": [
              "cuid_stage_1"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tags": {
            "example": [
              "vip",
              "newsletter"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ContactsImportMappingDto": {
        "properties": {
          "companyName": {
            "description": "Index of the column that maps to company name (0-based)",
            "example": 4,
            "type": "number"
          },
          "email": {
            "description": "Index of the column that maps to email (0-based)",
            "example": 2,
            "type": "number"
          },
          "firstName": {
            "description": "Index of the column that maps to first name (0-based)",
            "example": 0,
            "type": "number"
          },
          "lastName": {
            "description": "Index of the column that maps to last name (0-based)",
            "example": 1,
            "type": "number"
          },
          "phone": {
            "description": "Index of the column that maps to phone (0-based)",
            "example": 3,
            "type": "number"
          }
        },
        "type": "object"
      },
      "ContextResponseDto": {
        "properties": {
          "insights": {
            "description": "Generated insights",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "lastUpdated": {
            "description": "When the context was last updated",
            "example": "2024-01-15T10:00:00Z",
            "type": "string"
          },
          "organizations": {
            "description": "Organization ID",
            "example": "org_123",
            "type": "object"
          },
          "recentActivity": {
            "description": "Recent activity data",
            "type": "object"
          },
          "suggestions": {
            "description": "Actionable suggestions",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "summary": {
            "description": "Summary statistics",
            "type": "object"
          },
          "timeframe": {
            "description": "Timeframe for the context",
            "example": "week",
            "type": "string"
          }
        },
        "required": [
          "organizations",
          "timeframe",
          "summary",
          "recentActivity",
          "insights",
          "suggestions",
          "lastUpdated"
        ],
        "type": "object"
      },
      "ConvertReferralDto": {
        "properties": {
          "friendContactId": {
            "example": "friend_contact_uuid",
            "type": "string"
          },
          "purchaseAmount": {
            "example": 150,
            "type": "number"
          },
          "referralCode": {
            "example": "ABC123",
            "type": "string"
          }
        },
        "required": [
          "referralCode",
          "friendContactId"
        ],
        "type": "object"
      },
      "ConvertThreadToTicketDto": {
        "properties": {
          "assignedToId": {
            "description": "User ID to assign the ticket to",
            "type": "string"
          },
          "category": {
            "description": "Ticket category",
            "type": "string"
          },
          "description": {
            "description": "Additional description (thread messages will be included automatically)",
            "type": "string"
          },
          "priority": {
            "default": "MEDIUM",
            "enum": [
              "URGENT",
              "HIGH",
              "MEDIUM",
              "LOW"
            ],
            "type": "string"
          },
          "subject": {
            "description": "Subject for the new ticket",
            "type": "string"
          }
        },
        "required": [
          "subject"
        ],
        "type": "object"
      },
      "ConvertToTicketDto": {
        "properties": {
          "assignToMe": {
            "default": false,
            "example": false,
            "type": "boolean"
          },
          "category": {
            "example": "Technical Support",
            "type": "string"
          },
          "priority": {
            "default": "medium",
            "enum": [
              "low",
              "medium",
              "high",
              "urgent"
            ],
            "type": "string"
          },
          "subject": {
            "example": "Customer can't login to account",
            "type": "string"
          }
        },
        "required": [
          "subject"
        ],
        "type": "object"
      },
      "CreateAccountLinkDto": {
        "properties": {
          "accountId": {
            "description": "Existing Stripe account id. Defaults to the stored account for this organization.",
            "type": "string"
          },
          "collect": {
            "description": "Prefill everything already provided and only collect outstanding items.",
            "enum": [
              "currently_due",
              "eventually_due"
            ],
            "type": "string"
          },
          "refreshUrl": {
            "example": "https://os.serviceagent.ai/settings/payments?step=retry",
            "type": "string"
          },
          "returnUrl": {
            "example": "https://os.serviceagent.ai/settings/payments?step=complete",
            "type": "string"
          },
          "type": {
            "default": "account_onboarding",
            "enum": [
              "account_onboarding",
              "account_update"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateActivityDto": {
        "properties": {
          "body": {
            "description": "Activity description/body",
            "example": "Discussed project requirements and timeline",
            "type": "string"
          },
          "callId": {
            "description": "Related call ID",
            "example": "call_abc",
            "type": "string"
          },
          "companyId": {
            "description": "Related company ID",
            "example": "company_456",
            "type": "string"
          },
          "contactId": {
            "description": "Related contact ID",
            "example": "contact_123",
            "type": "string"
          },
          "customJson": {
            "description": "Custom JSON data",
            "example": "{\"customField\": \"value\"}",
            "type": "object"
          },
          "dealId": {
            "description": "Related deal ID",
            "example": "deal_789",
            "type": "string"
          },
          "durationSec": {
            "description": "Duration in seconds",
            "example": 1800,
            "type": "number"
          },
          "messageId": {
            "description": "Related message ID",
            "example": "message_def",
            "type": "string"
          },
          "ownerId": {
            "description": "Activity owner ID",
            "example": "user_123",
            "type": "string"
          },
          "subject": {
            "description": "Activity subject/title",
            "example": "Follow-up call with John Doe",
            "type": "string"
          },
          "type": {
            "description": "Type of activity",
            "enum": [
              "CALL",
              "EMAIL",
              "SMS",
              "MEETING",
              "NOTE",
              "REVIEW_REQUEST",
              "QUOTE_SENT",
              "PAYMENT_RECEIVED"
            ],
            "example": "CALL",
            "type": "string"
          },
          "whenAt": {
            "description": "When the activity occurred or is scheduled",
            "example": "2024-01-15T10:00:00Z",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "CreateAdAccountDto": {
        "properties": {
          "credentials": {
            "example": {
              "clientId": "abc",
              "clientSecret": "xyz"
            },
            "type": "object"
          },
          "externalAccountId": {
            "example": "123-456-7890",
            "type": "string"
          },
          "googleCustomerId": {
            "description": "Google Ads customer ID sans dashes",
            "example": "1234567890",
            "type": "string"
          },
          "googleLocationGroupId": {
            "example": "LOCATION_GROUP_ID",
            "type": "string"
          },
          "metaBusinessAccountId": {
            "example": "123456789",
            "type": "string"
          },
          "metaPageId": {
            "example": "987654321",
            "type": "string"
          },
          "metaPixelId": {
            "example": "135792468",
            "type": "string"
          },
          "metadata": {
            "example": {
              "currency": "USD"
            },
            "type": "object"
          },
          "provider": {
            "enum": [
              "google_ads",
              "meta_ads"
            ],
            "example": "google_ads",
            "type": "string"
          },
          "triggerInitialSync": {
            "default": false,
            "example": true,
            "type": "boolean"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "CreateAdCampaignDto": {
        "properties": {
          "adAccountId": {
            "description": "Linked marketing ad account ID",
            "type": "string"
          },
          "biddingStrategy": {
            "example": "max_clicks",
            "type": "string"
          },
          "channelSubtype": {
            "enum": [
              "google_search_responsive",
              "google_performance_max",
              "google_maps",
              "meta_feed",
              "meta_story"
            ],
            "type": "string"
          },
          "creativeIds": {
            "description": "Marketing creative IDs to attach to the campaign",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "dailyBudgetMicros": {
            "description": "Daily budget in micros (1 USD = 1_000_000 micros)",
            "example": 5000000,
            "type": "number"
          },
          "endAt": {
            "description": "Campaign end date/time ISO8601",
            "example": "2025-02-15T23:59:59-07:00",
            "type": "string"
          },
          "locationTargets": {
            "description": "Target regions for the campaign. May be empty when `serviceArea` is supplied — the service will derive a radius-type target from the service-area config and append it.",
            "items": {
              "$ref": "#/components/schemas/AdCampaignTargetRegionDto"
            },
            "type": "array"
          },
          "name": {
            "example": "Denver Winter HVAC Push",
            "type": "string"
          },
          "objective": {
            "example": "drive_calls",
            "type": "string"
          },
          "serviceArea": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ServiceAreaInputDto"
              }
            ],
            "description": "Operator-friendly shortcut: \"we serve a {radiusMiles}-mile radius around {centerAddress}\". When provided, the service geocodes the address (or accepts pre-supplied coords), builds a radius targeting block, and APPENDS it to `locationTargets`. Existing entries in `locationTargets` are preserved — service area is additive. Skip this and supply `locationTargets` directly for advanced multi-region / polygon-with-exclusions targeting."
          },
          "startAt": {
            "description": "Campaign start date/time ISO8601",
            "example": "2025-01-15T08:00:00-07:00",
            "type": "string"
          },
          "totalBudgetMicros": {
            "description": "Total/lifetime budget in micros",
            "example": 300000000,
            "type": "number"
          }
        },
        "required": [
          "name",
          "channelSubtype",
          "adAccountId"
        ],
        "type": "object"
      },
      "CreateAdCreativeDto": {
        "properties": {
          "adAccountId": {
            "description": "Optional ad account to associate with the creative",
            "example": "maa_123",
            "type": "string"
          },
          "audience": {
            "example": "Homeowners in Denver with systems older than 10 years",
            "type": "string"
          },
          "callToActionPreference": {
            "example": "Book Online",
            "type": "string"
          },
          "channelSubtype": {
            "enum": [
              "google_search_responsive",
              "google_performance_max",
              "google_maps",
              "meta_feed",
              "meta_story"
            ],
            "example": "google_search_responsive",
            "type": "string"
          },
          "contextTags": {
            "example": [
              "winter",
              "furnace",
              "maintenance"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "enableWebResearch": {
            "description": "If true, run lightweight web research to gather market insights",
            "example": true,
            "type": "boolean"
          },
          "imageAspectRatios": {
            "description": "Aspect ratios for generated image assets",
            "example": [
              "1:1",
              "4:5",
              "9:16"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "imageStyle": {
            "example": "Photo-realistic technician helping homeowner",
            "type": "string"
          },
          "includeImageAssets": {
            "example": true,
            "type": "boolean"
          },
          "includeTextAssets": {
            "example": true,
            "type": "boolean"
          },
          "keywords": {
            "example": [
              "same-day repair",
              "licensed technicians",
              "HVAC financing"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "layoutArchetypeId": {
            "description": "Optional. Pin the visual layout archetype for ALL image assets in this creative. When unset, the pipeline picks per-asset by round-robin biased on the angle framework, so a multi-image creative gets visual variety automatically. Set this to force a single archetype across the batch (e.g. \"hero_offer\" for an offer-driven A/B test where every image must read as price-dominant).",
            "enum": [
              "portrait_banner",
              "hero_offer",
              "typography_hero",
              "testimonial_card",
              "data_stat_card",
              "callout_grid"
            ],
            "example": "hero_offer",
            "type": "string"
          },
          "objective": {
            "example": "Drive winter furnace tune-ups with 0% financing",
            "type": "string"
          },
          "offerSummary": {
            "example": "Free diagnostic + 0% APR for 12 months on qualified installs",
            "type": "string"
          },
          "prompt": {
            "description": "Optional freeform prompt supplied by the customer",
            "example": "Promote smart thermostats and maintenance plans for winter",
            "type": "string"
          },
          "referenceKnowledgeBaseIds": {
            "description": "Optional knowledge base IDs to seed into the prompt",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "referenceResourceUrls": {
            "description": "Optional file handles, URLs, or resource IDs to reference",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tone": {
            "example": "Trustworthy, expert, neighborly",
            "type": "string"
          }
        },
        "required": [
          "channelSubtype"
        ],
        "type": "object"
      },
      "CreateAdsPrepaidTopupIntentDto": {
        "properties": {
          "amountCents": {
            "description": "Amount in cents to add to ads prepaid wallet",
            "example": 50000,
            "type": "number"
          },
          "currency": {
            "default": "usd",
            "example": "usd",
            "type": "string"
          }
        },
        "required": [
          "amountCents"
        ],
        "type": "object"
      },
      "CreateAgencyDto": {
        "properties": {
          "addressJson": {
            "description": "Encrypted address JSON",
            "type": "string"
          },
          "billingModel": {
            "description": "Billing model for the agency",
            "enum": [
              "agency_pays",
              "client_pays",
              "hybrid",
              "AGENCY_PAYS",
              "CLIENT_PAYS",
              "HYBRID"
            ],
            "example": "agency_pays",
            "type": "string"
          },
          "currency": {
            "default": "USD",
            "description": "Currency of the agency",
            "example": "USD",
            "type": "string"
          },
          "domain": {
            "description": "Domain of the agency",
            "example": "agency.com",
            "type": "string"
          },
          "features": {
            "description": "Features enabled for this agency",
            "example": [
              "white_label",
              "custom_branding",
              "advanced_analytics"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "industry": {
            "description": "Industry of the agency",
            "example": "marketing",
            "type": "string"
          },
          "maxClients": {
            "default": 10,
            "description": "Maximum number of clients this agency can manage",
            "example": 25,
            "type": "number"
          },
          "name": {
            "description": "Name of the agency",
            "example": "Digital Marketing Agency",
            "type": "string"
          },
          "phone": {
            "description": "Phone number of the agency",
            "example": "+1-555-0123",
            "type": "string"
          },
          "revenueShare": {
            "default": 0,
            "description": "Revenue share percentage for the agency",
            "example": 15,
            "type": "number"
          },
          "timezone": {
            "default": "UTC",
            "description": "Timezone of the agency",
            "example": "America/New_York",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateAgentDto": {
        "properties": {
          "capabilities": {
            "description": "Capabilities of the AI agent",
            "example": [
              "crm_lookup",
              "kb_search",
              "appointment_booking"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "description": "Description of the AI agent",
            "example": "Handles customer inquiries and support requests",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "description": "Whether the agent is active",
            "example": true,
            "type": "boolean"
          },
          "maxTokens": {
            "default": 4000,
            "description": "Maximum tokens for AI responses",
            "example": 4000,
            "maximum": 8000,
            "minimum": 100,
            "type": "number"
          },
          "model": {
            "default": "gpt-4",
            "description": "AI model to use",
            "example": "gpt-4",
            "type": "string"
          },
          "name": {
            "description": "Name of the AI agent",
            "example": "Customer Service Agent",
            "type": "string"
          },
          "systemPrompt": {
            "description": "System prompt for the AI agent",
            "example": "You are a helpful customer service assistant...",
            "type": "string"
          },
          "temperature": {
            "default": 0.7,
            "description": "Temperature for AI responses (0-1)",
            "example": 0.7,
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "name",
          "systemPrompt"
        ],
        "type": "object"
      },
      "CreateAiAgentDto": {
        "properties": {
          "capabilities": {
            "example": [
              "crm_lookup",
              "kb_search",
              "appointment_booking"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "example": "Handles customer inquiries and support",
            "type": "string"
          },
          "industry": {
            "description": "Industry type for the agent",
            "example": "roofing",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "description": "Whether the agent is active",
            "example": true,
            "type": "boolean"
          },
          "knowledgeBase": {
            "description": "Array of knowledge base article IDs to associate with this agent",
            "example": [
              "kb_article_id_1",
              "kb_article_id_2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "maxTokens": {
            "example": 4000,
            "minimum": 1,
            "type": "number"
          },
          "model": {
            "example": "gpt-5-nano-2025-08-07",
            "type": "string"
          },
          "name": {
            "example": "Customer Service Agent",
            "type": "string"
          },
          "personality": {
            "description": "Personality style for the agent (e.g., professional, friendly, casual)",
            "example": "professional",
            "type": "string"
          },
          "systemPrompt": {
            "example": "You are a helpful customer service assistant...",
            "type": "string"
          },
          "temperature": {
            "example": 0.7,
            "maximum": 2,
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "name",
          "systemPrompt"
        ],
        "type": "object"
      },
      "CreateAivaSessionDto": {
        "properties": {
          "voiceAgentId": {
            "description": "Optional voice agent ID (internal). If omitted, uses org defaults.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateApiKeyDto": {
        "properties": {
          "name": {
            "example": "My API Key",
            "type": "string"
          },
          "scopes": {
            "description": "API key scopes/permissions",
            "example": [
              "crm:read",
              "crm:write"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "scopes"
        ],
        "type": "object"
      },
      "CreateAppointmentDto": {
        "properties": {
          "bufferAfterMinutes": {
            "description": "Minutes of buffer time after the appointment",
            "example": 15,
            "type": "number"
          },
          "bufferBeforeMinutes": {
            "description": "Minutes of buffer time before the appointment",
            "example": 15,
            "type": "number"
          },
          "customJson": {
            "additionalProperties": true,
            "description": "Free-form metadata blob attached to the appointment (e.g. partner-specific tags, internal notes). The server stores this passthrough — schema is intentionally open-ended so workflows and integrations can stash whatever they need.",
            "example": {
              "internalNotes": "VIP customer",
              "priority": "high"
            },
            "type": "object"
          },
          "customerEmail": {
            "description": "Required when `customerId` is not provided. Server upserts a `Contact` by email when this path is taken. Ignored when `customerId` is set.",
            "example": "jane@example.com",
            "type": "string"
          },
          "customerId": {
            "description": "Optional: pass the FK of an existing CRM `Contact` to attach the appointment without an email upsert. When provided, `customerName` and `customerEmail` are not required (and are ignored if sent — the contact row is the source of truth). When omitted, the public/inline booking path runs and `customerName` + `customerEmail` are required.",
            "example": "cnt_123",
            "type": "string"
          },
          "customerName": {
            "description": "Required when `customerId` is not provided. Ignored when `customerId` is set.",
            "example": "Jane Smith",
            "type": "string"
          },
          "customerPhone": {
            "example": "+1234567890",
            "type": "string"
          },
          "description": {
            "example": "Please clean the kitchen thoroughly",
            "type": "string"
          },
          "duration": {
            "description": "Duration in minutes. Used to derive endAt when it is omitted.",
            "example": 90,
            "type": "number"
          },
          "endAt": {
            "example": "2024-01-15T12:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "locationId": {
            "description": "Location ID for this appointment (multi-location)",
            "example": "loc_123",
            "type": "string"
          },
          "notes": {
            "example": "Customer prefers morning appointment",
            "type": "string"
          },
          "ownerId": {
            "example": "user-id",
            "type": "string"
          },
          "recurrenceRule": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RecurrenceRuleDto"
              }
            ],
            "description": "Recurrence rule describing how this appointment should repeat"
          },
          "resourceIds": {
            "description": "Resource IDs required for this appointment (rooms/equipment/vehicles)",
            "example": [
              "res_123"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "scheduledAt": {
            "description": "Legacy alias for startAt (ISO 8601).",
            "example": "2024-01-15T10:00:00Z",
            "type": "string"
          },
          "serviceId": {
            "description": "Optional. Defaults to the first active service offering when omitted.",
            "example": "service-id",
            "type": "string"
          },
          "serviceOfferingId": {
            "description": "Alias for serviceId kept for backward compatibility.",
            "example": "service-offering-id",
            "type": "string"
          },
          "staffId": {
            "description": "Optional. Defaults to the first active staff member when omitted.",
            "example": "staff-id",
            "type": "string"
          },
          "startAt": {
            "description": "Appointment start time. Required unless scheduledAt is provided.",
            "example": "2024-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "example": "scheduled",
            "type": "string"
          },
          "title": {
            "example": "House Cleaning Service",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateAssetDto": {
        "properties": {
          "acquisitionDate": {
            "description": "Acquisition date (ISO string)",
            "type": "string"
          },
          "assetTypeId": {
            "description": "Link to an existing asset type definition.",
            "type": "string"
          },
          "condition": {
            "default": "NEW",
            "enum": [
              "NEW",
              "GOOD",
              "FAIR",
              "POOR",
              "DAMAGED"
            ],
            "type": "string"
          },
          "contactId": {
            "description": "Associated contact ID (owner/point of contact)",
            "type": "string"
          },
          "customFields": {
            "description": "Custom fields captured via UI config",
            "type": "object"
          },
          "dealId": {
            "description": "Related deal/opportunity ID",
            "type": "string"
          },
          "jobId": {
            "description": "Related job ID",
            "type": "string"
          },
          "lastServiceAt": {
            "description": "Last service date (ISO string)",
            "type": "string"
          },
          "locationId": {
            "description": "Associated location ID",
            "type": "string"
          },
          "metadata": {
            "description": "Structured metadata captured for this asset",
            "type": "object"
          },
          "name": {
            "description": "Friendly asset name (e.g., Rooftop Unit #3)",
            "maxLength": 120,
            "minLength": 2,
            "type": "string"
          },
          "nextServiceDueAt": {
            "description": "Next service due (ISO string)",
            "type": "string"
          },
          "quantity": {
            "default": 1,
            "description": "Initial quantity (defaults to 1)",
            "type": "number"
          },
          "serialNumber": {
            "description": "Serial number or unique identifier",
            "maxLength": 120,
            "type": "string"
          },
          "status": {
            "default": "ACTIVE",
            "enum": [
              "ACTIVE",
              "IN_SERVICE",
              "MAINTENANCE",
              "RETIRED",
              "LOST"
            ],
            "type": "string"
          },
          "tags": {
            "description": "Tags for filtering/segmentation",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "unitCostCents": {
            "description": "Unit cost in cents",
            "example": 12900,
            "type": "number"
          },
          "unitOfMeasure": {
            "description": "Unit of measure if different from the asset type",
            "type": "string"
          },
          "warrantyExpiresAt": {
            "description": "Warranty expiration (ISO string)",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateAssetTypeDto": {
        "properties": {
          "description": {
            "description": "Optional description to help teammates identify this type",
            "maxLength": 500,
            "type": "string"
          },
          "isSerialized": {
            "default": false,
            "description": "Set to true if each item must have its own serial number",
            "type": "boolean"
          },
          "key": {
            "description": "Unique key/slug for the asset type (per organization)",
            "example": "hvac_filter",
            "maxLength": 64,
            "minLength": 2,
            "type": "string"
          },
          "metadata": {
            "description": "Arbitrary metadata stored with the asset type",
            "type": "object"
          },
          "name": {
            "description": "Friendly name for the asset type",
            "maxLength": 120,
            "minLength": 2,
            "type": "string"
          },
          "tags": {
            "description": "Tags or labels (e.g., consumable, safety, rental)",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "unitOfMeasure": {
            "description": "Default unit of measure (e.g., each, ft, gallon)",
            "example": "each",
            "type": "string"
          }
        },
        "required": [
          "key",
          "name"
        ],
        "type": "object"
      },
      "CreateBreakDto": {
        "properties": {
          "dayOfWeek": {
            "example": 1,
            "maximum": 6,
            "minimum": 0,
            "type": "number"
          },
          "endTime": {
            "example": "13:00",
            "type": "string"
          },
          "isRecurring": {
            "default": true,
            "example": true,
            "type": "boolean"
          },
          "startTime": {
            "example": "12:00",
            "type": "string"
          },
          "title": {
            "example": "Lunch Break",
            "type": "string"
          }
        },
        "required": [
          "title",
          "startTime",
          "endTime",
          "dayOfWeek",
          "isRecurring"
        ],
        "type": "object"
      },
      "CreateCadenceDto": {
        "properties": {
          "aiContext": {
            "description": "Custom AI context/tone",
            "type": "object"
          },
          "audienceSavedViewId": {
            "description": "Saved view id to auto-target audience",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "goal": {
            "enum": [
              "BOOKING_CREATED",
              "DEAL_STAGE_CHANGED",
              "INVOICE_PAID",
              "PAYMENT_COLLECTED",
              "CUSTOM"
            ],
            "type": "string"
          },
          "goals": {
            "items": {
              "$ref": "#/components/schemas/CadenceGoalInput"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "steps": {
            "description": "Ordered list of cadence steps",
            "items": {
              "$ref": "#/components/schemas/CadenceStepInput"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "steps"
        ],
        "type": "object"
      },
      "CreateCalendarConfigDto": {
        "properties": {
          "config": {
            "$ref": "#/components/schemas/ConfigDto"
          },
          "description": {
            "example": "Primary booking calendar",
            "type": "string"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "name": {
            "example": "Main Calendar",
            "type": "string"
          },
          "settings": {
            "description": "Alias for `config` (legacy frontend). Stored as CalendarConfig.config JSON.",
            "type": "object"
          },
          "slug": {
            "description": "Optional booking slug. If provided, it will be used to derive the public bookingKey (best-effort unique).",
            "example": "main-calendar",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateChannelDto": {
        "properties": {
          "externalId": {
            "description": "Canonical send-from identity (phone number or email address)",
            "type": "string"
          },
          "friendlyName": {
            "description": "Friendly display name for UI",
            "example": "Support Email",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "description": "Active/inactive state",
            "type": "boolean"
          },
          "isShared": {
            "default": false,
            "type": "boolean"
          },
          "locationId": {
            "description": "Location to own this channel; if omitted, uses active location context.",
            "type": "string"
          },
          "provider": {
            "description": "Provider key (twilio/sendgrid/etc.)",
            "type": "string"
          },
          "type": {
            "enum": [
              "SMS",
              "EMAIL",
              "WHATSAPP",
              "TELEGRAM",
              "WIDGET",
              "CALL"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "externalId"
        ],
        "type": "object"
      },
      "CreateClientDto": {
        "properties": {
          "addressJson": {
            "description": "Encrypted address JSON",
            "type": "string"
          },
          "billingModel": {
            "description": "Billing model applied when the client is managed by an agency",
            "enum": [
              "agency_pays",
              "client_pays",
              "hybrid"
            ],
            "type": "string"
          },
          "currency": {
            "default": "USD",
            "description": "Currency of the client organization",
            "example": "USD",
            "type": "string"
          },
          "domain": {
            "description": "Domain of the client organization",
            "example": "acme.com",
            "type": "string"
          },
          "industry": {
            "description": "Industry of the client organization",
            "example": "technology",
            "type": "string"
          },
          "name": {
            "description": "Name of the client organization",
            "example": "Acme Corporation",
            "type": "string"
          },
          "phone": {
            "description": "Phone number of the client organization",
            "example": "+1-555-0456",
            "type": "string"
          },
          "timezone": {
            "default": "UTC",
            "description": "Timezone of the client organization",
            "example": "America/Los_Angeles",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateClosureDto": {
        "properties": {
          "date": {
            "example": "2026-12-25",
            "type": "string"
          },
          "endTime": {
            "example": "12:00",
            "type": "string"
          },
          "isAllDay": {
            "example": true,
            "type": "boolean"
          },
          "locationId": {
            "example": "location-id",
            "type": "string"
          },
          "reason": {
            "example": "Christmas Day",
            "type": "string"
          },
          "startTime": {
            "example": "09:00",
            "type": "string"
          }
        },
        "required": [
          "date"
        ],
        "type": "object"
      },
      "CreateCompanyDto": {
        "properties": {
          "address": {
            "example": "123 Main St",
            "type": "string"
          },
          "addressJson": {
            "example": {
              "city": "Anytown",
              "state": "CA",
              "street": "123 Main St",
              "zip": "12345"
            },
            "type": "object"
          },
          "customJson": {
            "example": {
              "customField": "value"
            },
            "type": "object"
          },
          "domain": {
            "example": "acme.com",
            "type": "string"
          },
          "industry": {
            "example": "Technology",
            "type": "string"
          },
          "name": {
            "example": "Acme Corporation",
            "type": "string"
          },
          "phone": {
            "example": "+1234567890",
            "type": "string"
          },
          "size": {
            "example": "50-100",
            "type": "string"
          },
          "tags": {
            "example": [
              "tag1",
              "tag2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "website": {
            "example": "https://acme.com",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateConnectAccountDto": {
        "properties": {
          "businessProfile": {
            "$ref": "#/components/schemas/BusinessProfileDto"
          },
          "businessType": {
            "enum": [
              "individual",
              "company",
              "non_profit",
              "government_entity"
            ],
            "example": "company",
            "type": "string"
          },
          "company": {
            "$ref": "#/components/schemas/CompanyDto"
          },
          "country": {
            "default": "US",
            "description": "Country for the connected Stripe account. Defaults to the organization country, then US.",
            "example": "US",
            "type": "string"
          },
          "email": {
            "description": "Optional email to prefill on the Stripe-hosted onboarding flow.",
            "example": "billing@acme.com",
            "type": "string"
          },
          "externalAccount": {
            "$ref": "#/components/schemas/ExternalAccountDto"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "owners": {
            "items": {
              "$ref": "#/components/schemas/PersonDto"
            },
            "type": "array"
          },
          "representative": {
            "$ref": "#/components/schemas/PersonDto"
          },
          "settings": {
            "$ref": "#/components/schemas/SettingsDto"
          },
          "tosAcceptance": {
            "$ref": "#/components/schemas/TosAcceptanceDto"
          },
          "type": {
            "default": "express",
            "description": "Stripe Connect account type. Express is the hosted-onboarding default.",
            "enum": [
              "express",
              "standard"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateContactDto": {
        "properties": {
          "behavioralProfile": {
            "description": "Behavioral intelligence profile",
            "example": {
              "communicationStyle": "FORMAL",
              "decisionMakingStyle": "ANALYTICAL",
              "engagementFrequency": "WEEKLY",
              "engagementScore": 75,
              "lastEngagementAt": "2024-01-15T10:00:00Z",
              "preferredChannel": "EMAIL",
              "responseRate": 80,
              "riskTolerance": "MEDIUM",
              "urgencyPreference": "HIGH"
            },
            "type": "object"
          },
          "companyId": {
            "example": "company-id",
            "type": "string"
          },
          "contextualProfile": {
            "description": "Contextual intelligence profile",
            "example": {
              "budgetRange": "50K_100K",
              "challenges": [
                "Legacy systems"
              ],
              "companySize": "MEDIUM",
              "competitors": [
                "Competitor A",
                "Competitor B"
              ],
              "currentSolutions": [
                "Current solution X"
              ],
              "decisionTimeline": "3_MONTHS",
              "goals": [
                "Increase efficiency",
                "Reduce costs"
              ],
              "industry": "Technology",
              "painPoints": [
                "Integration challenges",
                "Cost concerns"
              ],
              "successMetrics": [
                "ROI",
                "User adoption"
              ]
            },
            "type": "object"
          },
          "customJson": {
            "example": {
              "customField": "value"
            },
            "type": "object"
          },
          "email": {
            "example": "john.doe@example.com",
            "type": "string"
          },
          "firstName": {
            "example": "John",
            "type": "string"
          },
          "identityProfile": {
            "description": "Enhanced identity information",
            "example": {
              "avatar": "https://example.com/avatar.jpg",
              "department": "Sales",
              "language": "en",
              "preferredName": "Johnny",
              "role": "Decision Maker",
              "seniority": "SENIOR",
              "socialProfiles": [],
              "timezone": "America/New_York",
              "title": "VP of Sales"
            },
            "type": "object"
          },
          "lastName": {
            "example": "Doe",
            "type": "string"
          },
          "leadScore": {
            "description": "Explicit lead score override. If omitted the system auto-calculates.",
            "example": 65,
            "type": "number"
          },
          "lifecycleStageId": {
            "description": "Lifecycle stage identifier.",
            "example": "stage_cuid",
            "type": "string"
          },
          "lifecycleStageKey": {
            "description": "Lifecycle stage key (e.g., MQL, SQL). Takes precedence over lifecycleStageId.",
            "example": "SQL",
            "type": "string"
          },
          "ownerId": {
            "example": "user-id",
            "type": "string"
          },
          "phone": {
            "example": "+1234567890",
            "type": "string"
          },
          "predictiveProfile": {
            "description": "Predictive intelligence profile",
            "example": {
              "acquisitionCost": 5000,
              "estimatedDealSize": 50000,
              "lifetimeValue": 150000,
              "likelihoodToBuy": 75,
              "nextBestAction": "Schedule demo call",
              "nextMilestone": "Technical evaluation",
              "optimalContactChannel": "PHONE",
              "optimalContactTime": "Tuesday 2-4 PM",
              "predictedChurnDate": null
            },
            "type": "object"
          },
          "relationshipProfile": {
            "description": "Relationship intelligence profile",
            "example": {
              "churnRisk": 20,
              "influenceLevel": "HIGH",
              "loyaltyScore": 80,
              "networkConnections": [],
              "referralPotential": 70,
              "relationshipStage": "WARM",
              "relationshipStrength": 85
            },
            "type": "object"
          },
          "status": {
            "example": "LEAD",
            "type": "string"
          },
          "tags": {
            "example": [
              "tag1",
              "tag2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "firstName",
          "lastName"
        ],
        "type": "object"
      },
      "CreateContactFromWidgetDto": {
        "properties": {
          "company": {
            "example": "Acme Corp",
            "type": "string"
          },
          "customFields": {
            "example": {
              "aiResolutionAttempted": true,
              "chatIntent": "pricing",
              "messageCount": 15
            },
            "type": "object"
          },
          "email": {
            "example": "john@example.com",
            "type": "string"
          },
          "leadSource": {
            "default": "widget",
            "example": "widget",
            "type": "string"
          },
          "name": {
            "example": "John Doe",
            "type": "string"
          },
          "phone": {
            "example": "+1234567890",
            "type": "string"
          },
          "tags": {
            "example": [
              "widget-lead",
              "high-intent"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "CreateCreativeSuggestionDto": {
        "properties": {
          "adAccountId": {
            "description": "Optional marketing ad account to tie creative to a campaign",
            "example": "maa_123",
            "type": "string"
          },
          "audience": {
            "example": "Homeowners in Dallas with homes over 10 years old",
            "type": "string"
          },
          "channel": {
            "enum": [
              "google_ads",
              "meta_ads",
              "listings",
              "email",
              "sms"
            ],
            "example": "google_ads",
            "type": "string"
          },
          "listingConnectionId": {
            "description": "Optional listing connection to personalize creative",
            "example": "mlc_123",
            "type": "string"
          },
          "objective": {
            "example": "Promote spring HVAC tune-up offer",
            "type": "string"
          },
          "tone": {
            "example": "Friendly, expert, and community-focused tone",
            "type": "string"
          }
        },
        "required": [
          "channel",
          "objective"
        ],
        "type": "object"
      },
      "CreateCustomFieldDefinitionDto": {
        "properties": {
          "description": {
            "example": "Best way to reach this contact",
            "type": "string"
          },
          "entityTypes": {
            "example": [
              "contact",
              "company"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "fieldType": {
            "example": "select",
            "type": "string"
          },
          "key": {
            "example": "preferred_contact_method",
            "type": "string"
          },
          "label": {
            "example": "Preferred Contact Method",
            "type": "string"
          },
          "options": {
            "example": [
              "Phone",
              "Email"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "showInForms": {
            "example": true,
            "type": "boolean"
          },
          "showInList": {
            "example": true,
            "type": "boolean"
          },
          "validation": {
            "example": {
              "required": true
            },
            "type": "object"
          }
        },
        "required": [
          "key",
          "label",
          "fieldType"
        ],
        "type": "object"
      },
      "CreateCustomReportDto": {
        "properties": {
          "category": {
            "description": "Category of the report",
            "enum": [
              "SALES",
              "MARKETING",
              "CUSTOMER",
              "OPERATIONS",
              "FINANCE"
            ],
            "example": "SALES",
            "type": "string"
          },
          "configuration": {
            "description": "Report configuration and filters",
            "example": {
              "dateRange": {
                "end": "2024-01-31",
                "start": "2024-01-01"
              },
              "fields": [
                "name",
                "value",
                "status",
                "contact",
                "company"
              ],
              "filters": {
                "pipeline": "sales-pipeline",
                "status": [
                  "WON",
                  "OPEN"
                ]
              },
              "groupBy": "month",
              "sortBy": "value",
              "sortOrder": "desc"
            },
            "type": "object"
          },
          "description": {
            "description": "Description of the report",
            "example": "Monthly sales performance report",
            "type": "string"
          },
          "isActive": {
            "description": "Whether the report is active",
            "example": true,
            "type": "boolean"
          },
          "name": {
            "description": "Name of the custom report",
            "example": "Monthly Sales Report",
            "type": "string"
          },
          "parameters": {
            "description": "Query parameters as JSON string",
            "example": "[\"2024-01-01\", \"2024-01-31\"]",
            "type": "string"
          },
          "query": {
            "description": "SQL query for the report",
            "example": "SELECT * FROM deals WHERE created_at >= $1 AND created_at <= $2",
            "type": "string"
          },
          "type": {
            "description": "Type of report",
            "enum": [
              "DEALS",
              "CONTACTS",
              "ACTIVITIES",
              "PERFORMANCE",
              "REVENUE"
            ],
            "example": "DEALS",
            "type": "string"
          }
        },
        "required": [
          "name",
          "query",
          "type",
          "configuration"
        ],
        "type": "object"
      },
      "CreateDealDto": {
        "properties": {
          "amountCents": {
            "example": 250000,
            "type": "number"
          },
          "closeDate": {
            "example": "2025-12-31",
            "type": "string"
          },
          "companyId": {
            "example": "comp_123",
            "type": "string"
          },
          "contactId": {
            "example": "contact_123",
            "type": "string"
          },
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "ownerId": {
            "example": "user_123",
            "type": "string"
          },
          "pipelineId": {
            "example": "pipe_123",
            "type": "string"
          },
          "source": {
            "example": "inbound",
            "type": "string"
          },
          "stage": {
            "description": "Deprecated alias for stageId. Will be coerced into stageId if provided.",
            "example": "stage_legacy",
            "type": "string"
          },
          "stageId": {
            "example": "stage_123",
            "type": "string"
          },
          "status": {
            "enum": [
              "OPEN",
              "WON",
              "LOST"
            ],
            "example": "OPEN",
            "type": "string"
          },
          "title": {
            "example": "New Website Project",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "CreateDealFromWidgetDto": {
        "properties": {
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "customFields": {
            "example": {
              "chatIntent": "pricing",
              "productInterest": [
                "Enterprise Plan",
                "Custom Integration"
              ],
              "urgency": "high"
            },
            "type": "object"
          },
          "expectedCloseDate": {
            "example": "2025-02-15",
            "type": "string"
          },
          "locationId": {
            "example": "location-id",
            "type": "string"
          },
          "notes": {
            "example": "Customer interested in enterprise features",
            "type": "string"
          },
          "pipelineId": {
            "example": "pipeline-id",
            "type": "string"
          },
          "probability": {
            "example": 25,
            "maximum": 100,
            "minimum": 0,
            "type": "number"
          },
          "source": {
            "default": "widget",
            "example": "widget",
            "type": "string"
          },
          "stageId": {
            "example": "stage-id",
            "type": "string"
          },
          "title": {
            "example": "Enterprise Plan - Acme Corp",
            "type": "string"
          },
          "value": {
            "example": 50000,
            "type": "number"
          }
        },
        "required": [
          "contactId",
          "title"
        ],
        "type": "object"
      },
      "CreateDeveloperAppDto": {
        "properties": {
          "description": {
            "example": "Internal app for support and automation workflows.",
            "type": "string"
          },
          "environment": {
            "enum": [
              "development",
              "staging",
              "production"
            ],
            "example": "development",
            "type": "string"
          },
          "metadata": {
            "example": {
              "ownerTeam": "platform"
            },
            "type": "object"
          },
          "name": {
            "example": "Support Dashboard",
            "type": "string"
          },
          "slug": {
            "example": "support-dashboard",
            "type": "string"
          },
          "type": {
            "enum": [
              "internal",
              "partner",
              "public",
              "mcp",
              "automation"
            ],
            "example": "internal",
            "type": "string"
          }
        },
        "required": [
          "name",
          "environment",
          "type"
        ],
        "type": "object"
      },
      "CreateDeveloperAppPromptDto": {
        "properties": {
          "framework": {
            "example": "nextjs",
            "type": "string"
          },
          "generatedPrompt": {
            "example": "## Objective\nAdd ServiceAgent chat to the app...",
            "type": "string"
          },
          "metadata": {
            "example": {
              "recommendedPackages": [
                "@serviceagent/nextjs"
              ]
            },
            "type": "object"
          },
          "refinement": {
            "example": "Use a docked launcher and preserve our existing theme tokens.",
            "type": "string"
          },
          "targetModel": {
            "example": "cursor",
            "type": "string"
          },
          "title": {
            "example": "Support widget prompt",
            "type": "string"
          },
          "useCase": {
            "example": "chat",
            "type": "string"
          },
          "userIntent": {
            "example": "Add a production-ready support chat assistant to our dashboard.",
            "type": "string"
          }
        },
        "required": [
          "title",
          "targetModel",
          "framework",
          "useCase",
          "userIntent",
          "generatedPrompt"
        ],
        "type": "object"
      },
      "CreateDeveloperCredentialDto": {
        "properties": {
          "developerAppId": {
            "example": "devapp_123",
            "type": "string"
          },
          "expiresAt": {
            "example": "2026-12-31T23:59:59.000Z",
            "format": "date-time",
            "type": "string"
          },
          "kind": {
            "enum": [
              "api_key",
              "service_token",
              "client_secret",
              "signing_secret"
            ],
            "example": "api_key",
            "type": "string"
          },
          "label": {
            "example": "Production backend key",
            "type": "string"
          },
          "metadata": {
            "example": {
              "environment": "production"
            },
            "type": "object"
          }
        },
        "required": [
          "developerAppId",
          "kind",
          "label"
        ],
        "type": "object"
      },
      "CreateDeveloperOAuthClientDto": {
        "properties": {
          "allowedScopes": {
            "example": [
              "tickets:read",
              "tickets:write",
              "webhooks:read"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "developerAppId": {
            "example": "devapp_123",
            "type": "string"
          },
          "name": {
            "example": "Support OAuth Client",
            "type": "string"
          },
          "redirectUris": {
            "example": [
              "https://developer.serviceagent.ai/auth/callback"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "developerAppId",
          "name",
          "redirectUris"
        ],
        "type": "object"
      },
      "CreateDialerRingGroupDto": {
        "properties": {
          "description": {
            "type": "string"
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/DialerRingGroupMemberInputDto"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateDispositionCodeDto": {
        "properties": {
          "code": {
            "description": "Disposition code to create",
            "example": "follow_up",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "CreateDmConversationDto": {
        "properties": {
          "isGroup": {
            "example": false,
            "type": "boolean"
          },
          "name": {
            "example": "Project Alpha",
            "type": "string"
          },
          "participantIds": {
            "description": "Other participants (the caller is added automatically). Pass an empty array to open the self-chat conversation (KAN-26).",
            "example": [
              "userId1",
              "userId2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "participantIds"
        ],
        "type": "object"
      },
      "CreateEmailCampaignDto": {
        "properties": {
          "channelId": {
            "description": "Send-from email channel",
            "example": "channel-uuid-123",
            "type": "string"
          },
          "fromEmail": {
            "example": "newsletter@acme.com",
            "type": "string"
          },
          "fromName": {
            "example": "Acme Co.",
            "type": "string"
          },
          "htmlContent": {
            "example": "<h1>Hello</h1>",
            "type": "string"
          },
          "listId": {
            "description": "Alias of recipientListId",
            "example": "cuid_list_123",
            "type": "string"
          },
          "name": {
            "example": "January Newsletter",
            "type": "string"
          },
          "previewText": {
            "example": "A quick overview of updates…",
            "type": "string"
          },
          "recipientFilters": {
            "$ref": "#/components/schemas/ContactFiltersDto"
          },
          "recipientListId": {
            "example": "cuid_list_123",
            "type": "string"
          },
          "replyTo": {
            "example": "support@acme.com",
            "type": "string"
          },
          "scheduledAt": {
            "example": "2025-01-01T12:00:00.000Z",
            "type": "string"
          },
          "subject": {
            "example": "What’s new this month",
            "type": "string"
          },
          "subjectVariants": {
            "description": "Optional A/B subject test config. When set, recipients are split deterministically across the variants by hashed (campaignId, contactId) bucket — same recipient always lands on the same variant across retries. Maximum 6 variants. The campaign-level `subject` field is still required (used as the fallback when this is null and as the operator-facing default in the UI).",
            "items": {
              "$ref": "#/components/schemas/SubjectVariantDto"
            },
            "type": "array"
          },
          "templateId": {
            "example": "cuid_template_123",
            "type": "string"
          },
          "textContent": {
            "example": "Hello",
            "type": "string"
          }
        },
        "required": [
          "name",
          "subject"
        ],
        "type": "object"
      },
      "CreateEmailListDto": {
        "properties": {
          "description": {
            "example": "High-value customers for quarterly newsletter",
            "type": "string"
          },
          "filters": {
            "$ref": "#/components/schemas/ContactFiltersDto"
          },
          "name": {
            "example": "VIP Customers",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateEmailTemplateApiDto": {
        "properties": {
          "category": {
            "example": "newsletter",
            "type": "string"
          },
          "htmlContent": {
            "example": "<h1>Hello {{firstName}}</h1>",
            "type": "string"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "example": "Holiday Newsletter",
            "type": "string"
          },
          "subject": {
            "example": "Happy Holidays from Acme!",
            "type": "string"
          },
          "textContent": {
            "example": "Hello {{firstName}}",
            "type": "string"
          },
          "variables": {
            "example": [
              "{{firstName}}",
              "{{companyName}}"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "subject",
          "htmlContent",
          "category"
        ],
        "type": "object"
      },
      "CreateEmailTemplateDto": {
        "properties": {
          "body": {
            "description": "Alias for bodyHtml",
            "example": "<html>...</html>",
            "type": "string"
          },
          "bodyHtml": {
            "description": "Email body in HTML format with template variables",
            "example": "<h2>Proposal Follow-up</h2><p>Dear {{contact.firstName}},</p><p>I wanted to follow up on the proposal...</p>",
            "type": "string"
          },
          "category": {
            "description": "Template category",
            "example": "sales",
            "type": "string"
          },
          "name": {
            "description": "Template name",
            "example": "Proposal Follow-up",
            "type": "string"
          },
          "subject": {
            "description": "Email subject with template variables",
            "example": "Follow-up: {{proposal.title}}",
            "type": "string"
          },
          "variables": {
            "description": "Array of template variables used",
            "example": [
              "contact.firstName",
              "proposal.title",
              "user.name"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "subject",
          "bodyHtml",
          "category"
        ],
        "type": "object"
      },
      "CreateEvalPersonaDto": {
        "properties": {
          "description": {
            "description": "Detailed description of the persona",
            "type": "string"
          },
          "industry": {
            "description": "Industry context",
            "example": "hvac",
            "type": "string"
          },
          "name": {
            "description": "Persona display name",
            "example": "Impatient first-time caller",
            "type": "string"
          },
          "personality": {
            "description": "Personality trait",
            "example": "impatient",
            "type": "string"
          },
          "speakingStyle": {
            "description": "How this persona speaks",
            "example": "short, demanding sentences",
            "type": "string"
          },
          "tags": {
            "description": "Freeform tags for filtering",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateEvalScenarioDto": {
        "properties": {
          "criteria": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EvalCriteriaDto"
              }
            ],
            "description": "Scoring criteria"
          },
          "label": {
            "description": "Scenario label",
            "example": "After-hours booking pressure",
            "type": "string"
          },
          "offlineResponse": {
            "description": "Canned response for offline eval mode",
            "type": "string"
          },
          "personaId": {
            "description": "Reference to an EvalPersona ID",
            "type": "string"
          },
          "tags": {
            "description": "Freeform tags for filtering",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "userMessage": {
            "description": "The message the simulated caller sends",
            "example": "I need an appointment Sunday at 11:30 PM.",
            "type": "string"
          }
        },
        "required": [
          "label",
          "userMessage",
          "criteria"
        ],
        "type": "object"
      },
      "CreateEvalSuiteDto": {
        "properties": {
          "description": {
            "description": "Description of what this suite tests",
            "type": "string"
          },
          "name": {
            "description": "Suite name",
            "example": "HVAC Core Quality Suite",
            "type": "string"
          },
          "scenarioIds": {
            "description": "Scenario IDs to include",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "weights": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EvalWeightsDto"
              }
            ],
            "description": "Scoring weights"
          }
        },
        "required": [
          "name",
          "scenarioIds"
        ],
        "type": "object"
      },
      "CreateFeatureFlagDto": {
        "properties": {
          "config": {
            "description": "Feature flag configuration",
            "type": "object"
          },
          "description": {
            "description": "Feature flag description",
            "type": "string"
          },
          "enabled": {
            "description": "Whether the feature is enabled",
            "type": "boolean"
          },
          "key": {
            "description": "Feature flag key",
            "type": "string"
          },
          "name": {
            "description": "Feature flag name",
            "type": "string"
          }
        },
        "required": [
          "key",
          "name",
          "description",
          "enabled"
        ],
        "type": "object"
      },
      "CreateFollowUpRuleDto": {
        "properties": {},
        "type": "object"
      },
      "CreateFollowUpSequenceDto": {
        "properties": {},
        "type": "object"
      },
      "CreateIntegrationRequestDto": {
        "properties": {},
        "type": "object"
      },
      "CreateInvoiceDto": {
        "properties": {
          "amount": {
            "example": 10000,
            "type": "number"
          },
          "autoSend": {
            "example": false,
            "type": "boolean"
          },
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "description": {
            "example": "Invoice description",
            "type": "string"
          },
          "dueDate": {
            "example": "2025-12-31",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvoiceItemDto"
            },
            "type": "array"
          },
          "notes": {
            "example": "Payment notes",
            "type": "string"
          },
          "number": {
            "example": "INV-001",
            "type": "string"
          },
          "paymentTerms": {
            "example": "Net 30",
            "type": "string"
          },
          "template": {
            "example": "default",
            "type": "string"
          }
        },
        "required": [
          "amount",
          "description"
        ],
        "type": "object"
      },
      "CreateKbArticleDto": {
        "properties": {
          "aiAgentId": {
            "example": "cleaning",
            "type": "string"
          },
          "category": {
            "example": "pricing",
            "type": "string"
          },
          "content": {
            "example": "Our standard service includes cleaning, maintenance, and repair work...",
            "type": "string"
          },
          "fileHandles": {
            "description": "Filestack file handles for attachments",
            "example": [
              "handle1",
              "handle2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tags": {
            "example": [
              "pricing",
              "services",
              "costs"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "example": "Service Pricing Information",
            "type": "string"
          }
        },
        "required": [
          "title",
          "content"
        ],
        "type": "object"
      },
      "CreateKnowledgeBaseDto": {
        "properties": {
          "description": {
            "description": "Optional description",
            "example": "Public-facing FAQs and policies",
            "type": "string"
          },
          "name": {
            "description": "Knowledge base name",
            "example": "Support FAQ",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateListingConnectionDto": {
        "properties": {
          "credentials": {
            "description": "Credentials required to communicate with the provider API",
            "example": {
              "clientId": "123",
              "clientSecret": "abc"
            },
            "type": "object"
          },
          "externalId": {
            "description": "External provider identifier for the connected listing (spec field name)",
            "example": "accounts/123/locations/456",
            "type": "string"
          },
          "externalLocationId": {
            "description": "External provider identifier for the connected location/listing",
            "example": "accounts/123/locations/456",
            "type": "string"
          },
          "locationId": {
            "description": "Optional location identifier when the connection is scoped to a specific branch",
            "example": "loc_123",
            "type": "string"
          },
          "metadata": {
            "description": "Additional configuration for the provider connector",
            "example": {
              "autoSync": true
            },
            "type": "object"
          },
          "provider": {
            "description": "Listings provider to connect with the organization or location",
            "enum": [
              "google_business",
              "yelp",
              "facebook",
              "apple_maps",
              "bing",
              "trustpilot"
            ],
            "example": "google_business",
            "type": "string"
          },
          "triggerInitialSync": {
            "default": false,
            "description": "When true, immediately queue an initial listings sync after creation",
            "example": true,
            "type": "boolean"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "CreateLocationDto": {
        "properties": {
          "address": {
            "description": "Primary address of the location",
            "example": "123 Main St, Dallas, TX 75201",
            "type": "string"
          },
          "addressJson": {
            "description": "Structured address object (optional). Useful for maps + formatting.",
            "example": {
              "city": "Dallas",
              "country": "US",
              "state": "TX",
              "street": "123 Main St",
              "zip": "75201"
            },
            "type": "object"
          },
          "googlePlaceId": {
            "description": "Google Place ID for this location (optional).",
            "example": "ChIJN1t_tDeuEmsRUsoyG83frY4",
            "type": "string"
          },
          "isActive": {
            "description": "Whether the location is active",
            "example": true,
            "type": "boolean"
          },
          "latitude": {
            "description": "Latitude (optional)",
            "example": 32.7767,
            "type": "number"
          },
          "longitude": {
            "description": "Longitude (optional)",
            "example": -96.797,
            "type": "number"
          },
          "marketingNapOverride": {
            "description": "Location-specific override for listings NAP data",
            "example": {
              "address": {
                "city": "Dallas",
                "state": "TX",
                "street": "123 Main St",
                "zip": "75201"
              },
              "name": "Acme Heating & Air - Downtown",
              "phone": "+1-555-0123"
            },
            "type": "object"
          },
          "name": {
            "description": "Display name for the location",
            "example": "Downtown Office",
            "type": "string"
          },
          "phone": {
            "description": "Contact phone number for the location",
            "example": "+1-555-0123",
            "type": "string"
          },
          "serviceAreaZipCodes": {
            "description": "Zip codes served by this location for localized marketing",
            "example": [
              "75201",
              "75202",
              "75001"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "timezone": {
            "description": "Timezone identifier for scheduling and availability",
            "example": "America/Chicago",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateMakeWebhookDto": {
        "properties": {
          "events": {
            "description": "Which ServiceAgent events should be delivered to this Make webhook. make.test will always be added automatically.",
            "example": [
              "call.started",
              "client_portal.ticket.created"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secret": {
            "description": "Optional HMAC secret for verifying payload signatures. If not provided, a secret is generated and returned.",
            "type": "string"
          },
          "url": {
            "description": "Make.com \"Custom webhook\" URL (scenario trigger URL)",
            "example": "https://hook.us1.make.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "CreateManualSurveyInvitationDto": {
        "properties": {
          "appointmentId": {
            "type": "string"
          },
          "callId": {
            "type": "string"
          },
          "campaignId": {
            "type": "string"
          },
          "channel": {
            "enum": [
              "EMAIL",
              "SMS",
              "WHATSAPP",
              "CHAT_WIDGET",
              "TICKET",
              "CALL_IVR"
            ],
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "contactId": {
            "type": "string"
          },
          "deliveryMetadata": {
            "type": "object"
          },
          "sendAt": {
            "description": "ISO string for when to send invite; defaults to immediate",
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "ticketId": {
            "type": "string"
          },
          "triggerId": {
            "type": "string"
          },
          "workflowRunId": {
            "type": "string"
          }
        },
        "required": [
          "templateId",
          "contactId",
          "channel"
        ],
        "type": "object"
      },
      "CreateMessageCommentDto": {
        "properties": {
          "body": {
            "example": "This needs a follow-up call.",
            "type": "string"
          },
          "messageId": {
            "example": "message-id",
            "type": "string"
          },
          "metadata": {
            "example": {
              "sentiment": "positive"
            },
            "type": "object"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "CreateMessageDto": {
        "properties": {
          "agentId": {
            "description": "Human/AI/system actor id that authored this message.",
            "example": "agent_123",
            "type": "string"
          },
          "agentName": {
            "description": "Display name for the authoring agent.",
            "example": "AIVA Front Desk",
            "type": "string"
          },
          "agentType": {
            "enum": [
              "human",
              "ai",
              "automation",
              "system"
            ],
            "example": "ai",
            "type": "string"
          },
          "body": {
            "example": "Message content here",
            "type": "string"
          },
          "customJson": {
            "example": {
              "attachments": []
            },
            "type": "object"
          },
          "direction": {
            "enum": [
              "INBOUND",
              "OUTBOUND"
            ],
            "example": "OUTBOUND",
            "type": "string"
          },
          "externalId": {
            "example": "twilio-message-id",
            "type": "string"
          },
          "fromAddress": {
            "example": "+1234567890",
            "type": "string"
          },
          "sentAt": {
            "example": "2024-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "example": "sent",
            "type": "string"
          },
          "subject": {
            "example": "Subject line",
            "type": "string"
          },
          "threadId": {
            "example": "thread-id",
            "type": "string"
          },
          "toAddress": {
            "example": "+0987654321",
            "type": "string"
          },
          "type": {
            "enum": [
              "SMS",
              "EMAIL",
              "WHATSAPP",
              "TELEGRAM",
              "WIDGET"
            ],
            "example": "SMS",
            "type": "string"
          }
        },
        "required": [
          "threadId",
          "direction",
          "type",
          "fromAddress",
          "toAddress",
          "body"
        ],
        "type": "object"
      },
      "CreateMessageThreadDto": {
        "properties": {
          "assignedTo": {
            "example": "user-id",
            "type": "string"
          },
          "assignedToId": {
            "example": "user-id",
            "type": "string"
          },
          "customJson": {
            "example": {
              "priority": "high"
            },
            "type": "object"
          },
          "externalId": {
            "example": "twilio-sid-123",
            "type": "string"
          },
          "fromEmail": {
            "example": "sender@example.com",
            "type": "string"
          },
          "fromNumber": {
            "example": "+1234567890",
            "type": "string"
          },
          "starred": {
            "example": true,
            "type": "boolean"
          },
          "status": {
            "enum": [
              "OPEN",
              "CLOSED",
              "NEEDS_REPLY",
              "SPAM",
              "ARCHIVED",
              "active",
              "archived",
              "closed"
            ],
            "example": "OPEN",
            "type": "string"
          },
          "subject": {
            "example": "Subject of the message",
            "type": "string"
          },
          "tags": {
            "example": [
              "priority",
              "vip"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "toEmail": {
            "example": "recipient@example.com",
            "type": "string"
          },
          "toNumber": {
            "example": "+0987654321",
            "type": "string"
          },
          "type": {
            "enum": [
              "SMS",
              "EMAIL",
              "WHATSAPP",
              "TELEGRAM",
              "WIDGET"
            ],
            "example": "SMS",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "CreateOrganizationDto": {
        "properties": {
          "billingModel": {
            "description": "Billing model to use for client organizations (required when isClient is true)",
            "enum": [
              "agency_pays",
              "client_pays",
              "hybrid"
            ],
            "type": "string"
          },
          "domain": {
            "description": "Domain of the organization",
            "example": "acme.com",
            "type": "string"
          },
          "industry": {
            "default": "general",
            "description": "Industry type (defaults to general if not specified)",
            "enum": [
              "general",
              "construction",
              "general_contractor",
              "roofing",
              "hvac",
              "plumbing",
              "electrical",
              "solar",
              "garage",
              "pest_control",
              "pool_service",
              "appliance_repair",
              "restoration",
              "moving",
              "legal",
              "insurance",
              "healthcare",
              "medical",
              "automotive",
              "real-estate",
              "realestate",
              "salon",
              "fitness",
              "restaurant",
              "dental",
              "spa",
              "home_services",
              "consulting",
              "cleaning",
              "landscaping",
              "painting",
              "photography",
              "event_planning",
              "pet_services",
              "education",
              "transportation",
              "it_services",
              "accounting",
              "seo_services",
              "marketing_agency",
              "advertising_agency",
              "other"
            ],
            "example": "roofing",
            "type": "string"
          },
          "isClient": {
            "description": "Flag indicating if the new organization is a client of the current user",
            "example": true,
            "type": "boolean"
          },
          "marketingNapProfile": {
            "description": "Canonical name, address, and phone used across listings",
            "example": {
              "address": {
                "city": "Dallas",
                "state": "TX",
                "street": "123 Main St",
                "zip": "75201"
              },
              "name": "Acme Heating & Air",
              "phone": "+1-555-0123"
            },
            "type": "object"
          },
          "marketingServiceAreaZipCodes": {
            "description": "Zip codes served by the organization for localized marketing",
            "example": [
              "75201",
              "75202"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "marketingVerticals": {
            "description": "Marketing vertical tags that tailor content and recommendations",
            "example": [
              "hvac",
              "plumbing"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "description": "Name of the organization",
            "example": "Acme Corporation",
            "type": "string"
          },
          "timezone": {
            "default": "UTC",
            "description": "Timezone of the organization",
            "example": "America/New_York",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreatePaymentLinkDto": {
        "properties": {
          "amount": {
            "description": "Amount in cents",
            "example": 5000,
            "type": "number"
          },
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "currency": {
            "example": "usd",
            "type": "string"
          },
          "customerEmail": {
            "example": "customer@example.com",
            "type": "string"
          },
          "customerName": {
            "example": "John Doe",
            "type": "string"
          },
          "description": {
            "example": "Service payment",
            "type": "string"
          },
          "invoiceId": {
            "example": "invoice-id",
            "type": "string"
          },
          "metadata": {
            "example": {
              "source": "appointment"
            },
            "type": "object"
          }
        },
        "required": [
          "amount",
          "description"
        ],
        "type": "object"
      },
      "CreatePaymentMethodDto": {
        "properties": {
          "paymentMethodId": {
            "description": "Stripe payment method ID",
            "example": "pm_1234567890",
            "type": "string"
          },
          "setAsDefault": {
            "description": "Set as default payment method",
            "example": true,
            "type": "boolean"
          }
        },
        "required": [
          "paymentMethodId"
        ],
        "type": "object"
      },
      "CreatePayoutDto": {
        "properties": {
          "amountCents": {
            "description": "Payout amount in cents",
            "example": 2500,
            "type": "number"
          },
          "currency": {
            "description": "Three-letter ISO currency code",
            "example": "usd",
            "type": "string"
          }
        },
        "required": [
          "amountCents"
        ],
        "type": "object"
      },
      "CreatePipelineDto": {
        "properties": {
          "isDefault": {
            "description": "Set as default pipeline",
            "type": "boolean"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "description": "Pipeline name",
            "type": "string"
          },
          "stages": {
            "description": "Pipeline stages",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreatePricingPlanDto": {
        "properties": {
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "description": {
            "example": "Best for growing teams",
            "type": "string"
          },
          "features": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "industry": {
            "example": "home_services",
            "type": "string"
          },
          "limitations": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "maxStorage": {
            "example": 100,
            "type": "number"
          },
          "maxUsers": {
            "example": 5,
            "type": "number"
          },
          "name": {
            "example": "Pro",
            "type": "string"
          },
          "popular": {
            "example": true,
            "type": "boolean"
          },
          "priceMonthly": {
            "example": 99,
            "type": "number"
          },
          "priceYearly": {
            "example": 990,
            "type": "number"
          },
          "recommended": {
            "example": false,
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "priceMonthly",
          "priceYearly",
          "features"
        ],
        "type": "object"
      },
      "CreatePricingTierDto": {
        "properties": {
          "billingInterval": {
            "description": "Billing interval",
            "enum": [
              "MONTHLY",
              "YEARLY"
            ],
            "example": "MONTHLY",
            "type": "string"
          },
          "description": {
            "description": "Description of the pricing tier",
            "example": "Custom pricing tier for specific needs",
            "type": "string"
          },
          "features": {
            "description": "List of features included in this tier",
            "example": [
              "Feature 1",
              "Feature 2",
              "Feature 3"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "isActive": {
            "description": "Whether the tier is active",
            "example": true,
            "type": "boolean"
          },
          "limits": {
            "description": "Usage limits for this tier",
            "example": {
              "activities": 2000,
              "contacts": 1000,
              "deals": 200,
              "storage": "10GB"
            },
            "type": "object"
          },
          "name": {
            "description": "Name of the pricing tier",
            "example": "Custom Tier",
            "type": "string"
          },
          "priceCents": {
            "description": "Price in cents",
            "example": 9900,
            "type": "number"
          }
        },
        "required": [
          "name",
          "priceCents",
          "billingInterval"
        ],
        "type": "object"
      },
      "CreateProjectDto": {
        "properties": {
          "budgetCents": {
            "description": "Budget in cents",
            "example": 5000000,
            "type": "number"
          },
          "companyId": {
            "example": "company-id",
            "type": "string"
          },
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "customJson": {
            "type": "object"
          },
          "dealId": {
            "example": "deal-id",
            "type": "string"
          },
          "description": {
            "example": "Complete redesign of company website",
            "type": "string"
          },
          "name": {
            "example": "Website Redesign Project",
            "type": "string"
          },
          "phases": {
            "items": {
              "$ref": "#/components/schemas/CreateProjectPhaseDto"
            },
            "type": "array"
          },
          "progressPercent": {
            "description": "Progress percentage (0-100)",
            "example": 0,
            "type": "number"
          },
          "startDate": {
            "type": "string"
          },
          "status": {
            "example": "planning",
            "type": "string"
          },
          "targetCompletionDate": {
            "type": "string"
          },
          "targetDate": {
            "description": "Alias for targetCompletionDate",
            "type": "string"
          },
          "templateId": {
            "example": "template-id",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateProjectPhaseDto": {
        "properties": {
          "customJson": {
            "type": "object"
          },
          "description": {
            "example": "Initial planning and requirements gathering",
            "type": "string"
          },
          "name": {
            "example": "Phase 1: Planning",
            "type": "string"
          },
          "order": {
            "example": 0,
            "type": "number"
          },
          "startDate": {
            "type": "string"
          },
          "status": {
            "example": "not_started",
            "type": "string"
          },
          "targetCompletionDate": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateProjectTemplateDto": {
        "properties": {
          "category": {
            "example": "web-development",
            "type": "string"
          },
          "customJson": {
            "type": "object"
          },
          "description": {
            "example": "Standard template for website development projects",
            "type": "string"
          },
          "estimatedCostCents": {
            "description": "Estimated cost in cents",
            "example": 5000000,
            "type": "number"
          },
          "estimatedHours": {
            "description": "Estimated hours",
            "example": 40,
            "type": "number"
          },
          "isDefault": {
            "example": false,
            "type": "boolean"
          },
          "name": {
            "example": "Website Development Template",
            "type": "string"
          },
          "phases": {
            "example": [
              {
                "name": "Planning",
                "order": 0,
                "status": "not_started"
              },
              {
                "name": "Design",
                "order": 1,
                "status": "not_started"
              },
              {
                "name": "Development",
                "order": 2,
                "status": "not_started"
              },
              {
                "name": "Testing",
                "order": 3,
                "status": "not_started"
              },
              {
                "name": "Launch",
                "order": 4,
                "status": "not_started"
              }
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateReferralProgramDto": {
        "properties": {
          "advocateRewardAmount": {
            "example": 25,
            "type": "number"
          },
          "advocateRewardType": {
            "default": "credits",
            "enum": [
              "credits",
              "cash",
              "discount",
              "perk"
            ],
            "type": "string"
          },
          "description": {
            "example": "Refer a friend and earn credits",
            "type": "string"
          },
          "expiresAt": {
            "example": "2026-01-01T00:00:00Z",
            "type": "string"
          },
          "friendRewardAmount": {
            "example": 10,
            "type": "number"
          },
          "friendRewardType": {
            "default": "credits",
            "enum": [
              "credits",
              "cash",
              "discount",
              "perk"
            ],
            "type": "string"
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "maxReferralsPerAdvocate": {
            "example": 10,
            "type": "number"
          },
          "minPurchaseAmount": {
            "example": 0,
            "type": "number"
          },
          "name": {
            "example": "Referral Program",
            "type": "string"
          }
        },
        "required": [
          "name",
          "advocateRewardAmount"
        ],
        "type": "object"
      },
      "CreateResourceDto": {
        "properties": {
          "capacity": {
            "description": "Capacity (default 1)",
            "example": 1,
            "type": "number"
          },
          "customJson": {
            "description": "Additional custom data",
            "example": {
              "locationId": "loc_123"
            },
            "type": "object"
          },
          "description": {
            "description": "Free-form description of the resource",
            "example": "Primary service bay on the ground floor",
            "type": "string"
          },
          "isActive": {
            "description": "Whether resource is active",
            "example": true,
            "type": "boolean"
          },
          "name": {
            "description": "Resource name",
            "example": "Bay 1",
            "type": "string"
          },
          "type": {
            "description": "Resource type (free-form)",
            "example": "ROOM",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateReviewCommentDto": {
        "properties": {
          "body": {
            "example": "Called customer, offered re-service tomorrow.",
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "CreateReviewRequestDto": {
        "properties": {
          "appointmentId": {
            "description": "Appointment that completed",
            "type": "string"
          },
          "channels": {
            "items": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "contactId": {
            "description": "Contact to request a review from (legacy field)",
            "type": "string"
          },
          "contactIds": {
            "description": "Contacts to request reviews from (spec field)",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "jobId": {
            "description": "Job that completed",
            "type": "string"
          },
          "locationId": {
            "description": "Location associated with the review request",
            "type": "string"
          },
          "messageOverrides": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReviewRequestMessageDto"
              }
            ],
            "description": "Override default messaging content"
          },
          "provider": {
            "description": "Review destination selected by the user",
            "enum": [
              "google",
              "yelp",
              "facebook",
              "trustpilot"
            ],
            "example": "google",
            "type": "string"
          },
          "sendAt": {
            "description": "Schedule the request to send after this time",
            "type": "string"
          },
          "templateId": {
            "description": "Optional template ID override (applies to the selected channel). If omitted, uses org/location review request settings.",
            "type": "string"
          },
          "templateOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReviewTemplateOverrideDto"
              }
            ],
            "description": "Override template subject/body (spec field)"
          }
        },
        "type": "object"
      },
      "CreateReviewRequestResponseDto": {
        "properties": {
          "appointmentId": {
            "type": "string"
          },
          "channel": {
            "type": "object"
          },
          "contactId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "jobId": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "sendAfter": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "channel",
          "status",
          "createdAt"
        ],
        "type": "object"
      },
      "CreateReviewRequestSpecDto": {
        "properties": {
          "channel": {
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "provider": {
            "enum": [
              "google",
              "yelp",
              "facebook",
              "trustpilot"
            ],
            "type": "string"
          },
          "scheduledFor": {
            "example": "2026-02-01T00:00:00Z",
            "type": "string"
          },
          "templateId": {
            "example": "template-id",
            "type": "string"
          }
        },
        "required": [
          "contactId",
          "channel"
        ],
        "type": "object"
      },
      "CreateSavedFilterDto": {
        "properties": {
          "criteria": {
            "description": "Filter criteria object using the same keys as list endpoints",
            "example": {
              "score": {
                "gte": 80
              },
              "status": "active",
              "tags": [
                "vip"
              ]
            },
            "type": "object"
          },
          "isFavorite": {
            "default": false,
            "type": "boolean"
          },
          "name": {
            "example": "High Value Leads",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "enum": [
              "contacts",
              "companies",
              "deals"
            ],
            "example": "contacts",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "criteria"
        ],
        "type": "object"
      },
      "CreateSelfNoteDto": {
        "properties": {
          "content": {
            "example": "Remember to follow up with client",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "CreateServiceOfferingDto": {
        "properties": {
          "category": {
            "example": "cleaning",
            "type": "string"
          },
          "color": {
            "description": "Hex color code for calendar display",
            "example": "#3B82F6",
            "type": "string"
          },
          "customJson": {
            "example": {
              "bufferTime": 15,
              "requiresDeposit": true
            },
            "type": "object"
          },
          "description": {
            "example": "Professional house cleaning service",
            "type": "string"
          },
          "duration": {
            "description": "Duration in minutes",
            "example": 60,
            "type": "number"
          },
          "durationMin": {
            "deprecated": true,
            "description": "Legacy field; use duration instead (minutes)",
            "type": "number"
          },
          "isActive": {
            "description": "Whether the service offering is active",
            "example": true,
            "type": "boolean"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "example": "House Cleaning",
            "type": "string"
          },
          "ownerId": {
            "example": "user-id",
            "type": "string"
          },
          "price": {
            "description": "Price in dollars",
            "example": 50,
            "type": "number"
          },
          "priceCents": {
            "deprecated": true,
            "description": "Legacy field; use price instead (cents)",
            "type": "number"
          }
        },
        "required": [
          "name",
          "duration",
          "price"
        ],
        "type": "object"
      },
      "CreateServiceRequestDto": {
        "properties": {
          "email": {
            "description": "Customer email",
            "type": "string"
          },
          "message": {
            "description": "Optional service request note",
            "type": "string"
          },
          "name": {
            "description": "Customer full name",
            "type": "string"
          },
          "phone": {
            "description": "Customer phone number",
            "type": "string"
          },
          "widgetKey": {
            "description": "Public widget key that identifies organization",
            "type": "string"
          },
          "zip": {
            "description": "Customer ZIP/postal code",
            "type": "string"
          }
        },
        "required": [
          "widgetKey",
          "name",
          "email",
          "zip"
        ],
        "type": "object"
      },
      "CreateSiteBlockDto": {
        "properties": {
          "blockType": {
            "description": "Block type key (hero, services, gallery, etc.)",
            "type": "string"
          },
          "content": {
            "description": "Block content payload",
            "type": "object"
          },
          "metadata": {
            "description": "Additional metadata for the block",
            "type": "object"
          },
          "order": {
            "description": "Display order",
            "type": "number"
          },
          "pageId": {
            "description": "Page ID to attach the block to",
            "type": "string"
          },
          "variant": {
            "description": "Block variant (e.g., split, carousel)",
            "type": "string"
          }
        },
        "required": [
          "pageId",
          "blockType",
          "content"
        ],
        "type": "object"
      },
      "CreateSitePageDto": {
        "properties": {
          "description": {
            "description": "Meta description",
            "type": "string"
          },
          "order": {
            "default": 999,
            "description": "Insert order index",
            "type": "number"
          },
          "path": {
            "description": "URL path (e.g., /gallery). Defaults auto if omitted.",
            "type": "string"
          },
          "seo": {
            "description": "Initial SEO config",
            "type": "object"
          },
          "title": {
            "description": "Page title",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "CreateSmsBrandDto": {
        "properties": {
          "a2pProfileEmail": {
            "description": "Optional separate email for A2P profile bundle creation notifications.",
            "type": "string"
          },
          "a2pProfilePolicySid": {
            "description": "TrustHub policy SID for the A2P Messaging Profile bundle.",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/SmsBrandAddressDto"
          },
          "brandType": {
            "enum": [
              "STANDARD",
              "SOLE_PROPRIETOR"
            ],
            "type": "string"
          },
          "businessEmail": {
            "type": "string"
          },
          "businessName": {
            "type": "string"
          },
          "businessPhone": {
            "type": "string"
          },
          "contactEmail": {
            "type": "string"
          },
          "contactFirstName": {
            "type": "string"
          },
          "contactLastName": {
            "type": "string"
          },
          "contactPhone": {
            "type": "string"
          },
          "customerProfileEmail": {
            "description": "Email used for TrustHub bundle creation notifications.",
            "type": "string"
          },
          "customerProfilePolicySid": {
            "description": "TrustHub policy SID for the Customer Profile bundle.",
            "type": "string"
          },
          "endUsers": {
            "items": {
              "$ref": "#/components/schemas/SmsRawEndUserDto"
            },
            "type": "array"
          },
          "legalEntityType": {
            "enum": [
              "BUSINESS",
              "INDIVIDUAL",
              "SOLE_PROPRIETOR"
            ],
            "type": "string"
          },
          "mock": {
            "default": false,
            "type": "boolean"
          },
          "mode": {
            "description": "Submission mode. If omitted, backend will infer based on provided fields ('raw' if policy SIDs + endUsers are present).",
            "enum": [
              "raw",
              "simple"
            ],
            "type": "string"
          },
          "skipAutomaticSecVet": {
            "type": "boolean"
          },
          "taxIdOrEin": {
            "description": "Tax ID / EIN (as entered by the user). Backend does not persist this; it is forwarded to Twilio.",
            "type": "string"
          },
          "websiteUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CreateSmsCampaignDto": {
        "properties": {
          "description": {
            "maxLength": 4096,
            "minLength": 40,
            "type": "string"
          },
          "hasEmbeddedLinks": {
            "type": "boolean"
          },
          "hasEmbeddedPhone": {
            "type": "boolean"
          },
          "helpMessage": {
            "maxLength": 320,
            "minLength": 20,
            "type": "string"
          },
          "messageFlow": {
            "maxLength": 2048,
            "minLength": 40,
            "type": "string"
          },
          "messageSamples": {
            "items": {
              "type": "string"
            },
            "maxItems": 5,
            "minItems": 2,
            "type": "array"
          },
          "optInMessage": {
            "maxLength": 320,
            "minLength": 20,
            "type": "string"
          },
          "optOutMessage": {
            "maxLength": 320,
            "minLength": 20,
            "type": "string"
          },
          "type": {
            "enum": [
              "CUSTOMER_CARE",
              "MARKETING"
            ],
            "type": "string"
          },
          "usecase": {
            "description": "Optional Twilio US A2P use-case string override. If omitted, backend will map from `type`.",
            "example": "CUSTOMER_CARE",
            "type": "string"
          }
        },
        "required": [
          "type",
          "description",
          "messageFlow",
          "messageSamples",
          "hasEmbeddedLinks",
          "hasEmbeddedPhone"
        ],
        "type": "object"
      },
      "CreateSmsOptOutDto": {
        "properties": {
          "phoneNumber": {
            "example": "+14155550123",
            "type": "string"
          },
          "reason": {
            "example": "manual",
            "type": "string"
          }
        },
        "required": [
          "phoneNumber"
        ],
        "type": "object"
      },
      "CreateSmsTemplateApiDto": {
        "properties": {
          "category": {
            "example": "promotion",
            "type": "string"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "message": {
            "example": "Hi {{firstName}}, save 20% this week. Reply STOP to opt out.",
            "type": "string"
          },
          "name": {
            "example": "Promo - Winter Discount",
            "type": "string"
          },
          "variables": {
            "example": [
              "{{firstName}}",
              "{{appointmentTime}}"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "message",
          "category"
        ],
        "type": "object"
      },
      "CreateStaffDto": {
        "properties": {
          "bio": {
            "example": "Experienced HVAC technician with 10+ years",
            "type": "string"
          },
          "calendarId": {
            "example": "google-calendar-id",
            "type": "string"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "skills": {
            "example": [
              "hvac",
              "maintenance",
              "repair"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "example": "Senior Technician",
            "type": "string"
          },
          "userId": {
            "example": "user-id",
            "type": "string"
          }
        },
        "required": [
          "userId"
        ],
        "type": "object"
      },
      "CreateSurveyCampaignDto": {
        "properties": {
          "channelStrategy": {
            "description": "Channel sequencing, review thresholds, etc.",
            "type": "object"
          },
          "cooldownDays": {
            "description": "Days before the same contact can receive this campaign again",
            "example": 30,
            "type": "number"
          },
          "defaultDelayMinutes": {
            "description": "Delay in minutes before sending invitations",
            "example": 120,
            "type": "number"
          },
          "name": {
            "example": "Post-appointment follow-up",
            "type": "string"
          },
          "targetFilters": {
            "description": "Targeting filters (services, staff, tags, etc.)",
            "type": "object"
          },
          "templateId": {
            "type": "string"
          }
        },
        "required": [
          "templateId",
          "name",
          "defaultDelayMinutes"
        ],
        "type": "object"
      },
      "CreateSurveyFrontendDto": {
        "properties": {
          "description": {
            "type": "string"
          },
          "questions": {
            "items": {
              "$ref": "#/components/schemas/FrontendSurveyQuestionDto"
            },
            "type": "array"
          },
          "settings": {
            "description": "Frontend settings bag (best-effort stored in theme.metadata)",
            "type": "object"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "questions"
        ],
        "type": "object"
      },
      "CreateSurveyResponseDto": {
        "properties": {
          "answers": {
            "type": "object"
          },
          "comment": {
            "type": "string"
          },
          "invitationId": {
            "type": "string"
          },
          "respondedAt": {
            "description": "Override response timestamp (ISO string)",
            "type": "string"
          },
          "score": {
            "maximum": 10,
            "minimum": 0,
            "type": "number"
          },
          "sentiment": {
            "type": "string"
          }
        },
        "required": [
          "invitationId"
        ],
        "type": "object"
      },
      "CreateSurveyTemplateDto": {
        "properties": {
          "channels": {
            "example": [
              "EMAIL",
              "SMS"
            ],
            "items": {
              "enum": [
                "EMAIL",
                "SMS",
                "WHATSAPP",
                "CHAT_WIDGET",
                "TICKET",
                "CALL_IVR"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "example": "Sent 2 hours after appointment completion",
            "type": "string"
          },
          "name": {
            "example": "Post-Appointment NPS",
            "type": "string"
          },
          "questions": {
            "description": "Ordered list of questions to display",
            "items": {
              "$ref": "#/components/schemas/SurveyQuestionInputDto"
            },
            "type": "array"
          },
          "scoreType": {
            "enum": [
              "NPS",
              "CSAT",
              "CES",
              "CUSTOM"
            ],
            "example": "NPS",
            "type": "string"
          },
          "theme": {
            "description": "Custom theme (colors, fonts, etc.)",
            "type": "object"
          }
        },
        "required": [
          "name",
          "scoreType",
          "channels",
          "questions"
        ],
        "type": "object"
      },
      "CreateSurveyTriggerDto": {
        "properties": {
          "delayMinutes": {
            "description": "Delay in minutes before sending invitations",
            "example": 120,
            "type": "number"
          },
          "entityFilters": {
            "description": "Filters for matching events (serviceIds, staffIds, etc.)",
            "type": "object"
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "type": {
            "enum": [
              "APPOINTMENT_COMPLETED",
              "TICKET_RESOLVED",
              "CALL_COMPLETED",
              "CHAT_ENDED",
              "WORKFLOW_NODE",
              "MANUAL"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "delayMinutes"
        ],
        "type": "object"
      },
      "CreateTagDto": {
        "properties": {
          "color": {
            "example": "#ef4444",
            "type": "string"
          },
          "description": {
            "example": "High-value customers requiring priority service",
            "type": "string"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "example": "VIP",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateTaskDto": {
        "properties": {
          "companyId": {
            "description": "Related company ID",
            "example": "company_456",
            "type": "string"
          },
          "contactId": {
            "description": "Related contact ID",
            "example": "contact_123",
            "type": "string"
          },
          "customJson": {
            "description": "Custom JSON data",
            "example": "{\"customField\": \"value\"}",
            "type": "object"
          },
          "dealId": {
            "description": "Related deal ID",
            "example": "deal_789",
            "type": "string"
          },
          "description": {
            "description": "Task description",
            "example": "Call client to discuss project timeline",
            "type": "string"
          },
          "dueAt": {
            "description": "Task due date",
            "example": "2024-01-15T17:00:00Z",
            "type": "string"
          },
          "estimatedHours": {
            "description": "Estimated hours for this task",
            "example": 2.5,
            "type": "number"
          },
          "ownerId": {
            "description": "Task owner ID",
            "example": "user_123",
            "type": "string"
          },
          "phaseId": {
            "description": "Related project phase ID",
            "example": "phase_456",
            "type": "string"
          },
          "priority": {
            "description": "Task priority",
            "enum": [
              "LOW",
              "MEDIUM",
              "HIGH"
            ],
            "example": "HIGH",
            "type": "string"
          },
          "projectId": {
            "description": "Related project ID",
            "example": "project_123",
            "type": "string"
          },
          "stage": {
            "description": "Task stage (e.g., todo, in_progress, review, done)",
            "example": "todo",
            "type": "string"
          },
          "status": {
            "description": "Task status",
            "enum": [
              "OPEN",
              "DONE"
            ],
            "example": "OPEN",
            "type": "string"
          },
          "title": {
            "description": "Task title",
            "example": "Follow up with client",
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "CreateTeamChannelDto": {
        "properties": {
          "color": {
            "example": "#6366f1",
            "type": "string"
          },
          "description": {
            "example": "General discussions",
            "type": "string"
          },
          "icon": {
            "example": "💬",
            "type": "string"
          },
          "name": {
            "example": "general",
            "type": "string"
          },
          "type": {
            "enum": [
              "PUBLIC",
              "PRIVATE",
              "ANNOUNCEMENT"
            ],
            "example": "PUBLIC",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateTeamStatusUpdateDto": {
        "properties": {
          "idempotencyKey": {
            "description": "Optional client-supplied idempotency key. Repeats within a 10-second window return the same row instead of creating a duplicate.",
            "example": "b2f4a8e0-1234-4567-8901-abcdef012345",
            "type": "string"
          },
          "linkedAppointmentId": {
            "example": "appointmentId",
            "type": "string"
          },
          "locationAddress": {
            "example": "123 Main St, San Francisco, CA",
            "type": "string"
          },
          "locationLat": {
            "example": 37.7749,
            "type": "number"
          },
          "locationLng": {
            "example": -122.4194,
            "type": "number"
          },
          "message": {
            "example": "At customer location",
            "type": "string"
          },
          "statusType": {
            "enum": [
              "ON_SITE",
              "EN_ROUTE",
              "COMPLETED",
              "BREAK",
              "EMERGENCY",
              "CUSTOM"
            ],
            "type": "string"
          }
        },
        "required": [
          "statusType"
        ],
        "type": "object"
      },
      "CreateTicketCategoryDto": {
        "properties": {
          "color": {
            "description": "Tailwind color class, e.g. \"bg-red-500\"",
            "type": "string"
          },
          "description": {
            "description": "Optional category description",
            "type": "string"
          },
          "name": {
            "description": "Category name",
            "type": "string"
          }
        },
        "required": [
          "name",
          "color"
        ],
        "type": "object"
      },
      "CreateTicketCommentDto": {
        "properties": {
          "attachments": {
            "description": "Attachments JSON string",
            "type": "string"
          },
          "content": {
            "description": "Comment content",
            "type": "string"
          },
          "isInternal": {
            "default": false,
            "description": "Whether this is an internal note (not visible to customer)",
            "type": "boolean"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "CreateTicketDto": {
        "properties": {
          "aiCategory": {
            "description": "AI-classified category",
            "type": "string"
          },
          "aiPriority": {
            "description": "AI-classified priority",
            "enum": [
              "URGENT",
              "HIGH",
              "MEDIUM",
              "LOW"
            ],
            "type": "string"
          },
          "aiSentiment": {
            "description": "AI-detected sentiment (e.g. positive/neutral/negative)",
            "type": "string"
          },
          "assignedTeam": {
            "description": "Team name to assign the ticket to",
            "type": "string"
          },
          "assignedToId": {
            "description": "User ID to assign the ticket to",
            "type": "string"
          },
          "category": {
            "description": "Ticket category",
            "type": "string"
          },
          "companyId": {
            "description": "Company ID if ticket is related to a company",
            "type": "string"
          },
          "contactId": {
            "description": "Contact ID if ticket is related to a contact",
            "type": "string"
          },
          "customJson": {
            "description": "Additional custom data as JSON string",
            "type": "string"
          },
          "description": {
            "description": "Detailed description of the issue",
            "type": "string"
          },
          "dueDate": {
            "description": "Due date for ticket resolution",
            "type": "string"
          },
          "messageThreadId": {
            "description": "Message thread ID if ticket originated from a conversation",
            "type": "string"
          },
          "priority": {
            "default": "MEDIUM",
            "enum": [
              "URGENT",
              "HIGH",
              "MEDIUM",
              "LOW"
            ],
            "type": "string"
          },
          "source": {
            "default": "MANUAL",
            "enum": [
              "EMAIL",
              "SMS",
              "WHATSAPP",
              "WEB_FORM",
              "PHONE",
              "API",
              "MANUAL",
              "CHAT"
            ],
            "type": "string"
          },
          "status": {
            "default": "OPEN",
            "enum": [
              "OPEN",
              "IN_PROGRESS",
              "WAITING_ON_CUSTOMER",
              "WAITING_ON_THIRD_PARTY",
              "RESOLVED",
              "CLOSED",
              "CANCELLED"
            ],
            "type": "string"
          },
          "subcategory": {
            "description": "Ticket subcategory",
            "type": "string"
          },
          "subject": {
            "description": "Ticket subject/title",
            "type": "string"
          },
          "tags": {
            "description": "Ticket tags",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "subject",
          "description"
        ],
        "type": "object"
      },
      "CreateTicketPriorityDto": {
        "properties": {
          "color": {
            "description": "Tailwind color classes, e.g. \"bg-red-500 text-red-500\"",
            "type": "string"
          },
          "description": {
            "description": "Optional priority description",
            "type": "string"
          },
          "isDefault": {
            "default": false,
            "description": "Whether this is the default priority for new tickets",
            "type": "boolean"
          },
          "level": {
            "description": "Sort order level (1 = highest priority)",
            "minimum": 1,
            "type": "number"
          },
          "name": {
            "description": "Priority name (e.g., \"Critical\", \"High\", \"Medium\", \"Low\")",
            "type": "string"
          }
        },
        "required": [
          "name",
          "level",
          "color"
        ],
        "type": "object"
      },
      "CreateTicketSlaDto": {
        "properties": {
          "escalationEnabled": {
            "default": false,
            "description": "Whether escalation is enabled for this SLA",
            "type": "boolean"
          },
          "firstResponseTime": {
            "description": "First response time value",
            "minimum": 1,
            "type": "number"
          },
          "isActive": {
            "default": true,
            "description": "Whether this SLA is active",
            "type": "boolean"
          },
          "name": {
            "description": "SLA name (e.g., \"Standard Response\", \"VIP Support\")",
            "type": "string"
          },
          "prioritySettingId": {
            "description": "Linked priority setting ID",
            "type": "string"
          },
          "resolutionTime": {
            "description": "Resolution time value",
            "minimum": 1,
            "type": "number"
          },
          "timeUnit": {
            "default": "hours",
            "description": "Time unit for both response and resolution times",
            "enum": [
              "hours",
              "days"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "firstResponseTime",
          "resolutionTime",
          "timeUnit"
        ],
        "type": "object"
      },
      "CreateTicketTemplateDto": {
        "properties": {
          "category": {
            "description": "Optional category (e.g., \"Billing\")",
            "type": "string"
          },
          "content": {
            "description": "Template content (supports {{variable.paths}})",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "description": "Enable/disable without deleting",
            "type": "boolean"
          },
          "shortcut": {
            "description": "Optional shortcut (e.g., \"/reset\")",
            "type": "string"
          },
          "title": {
            "description": "Template title (e.g., \"Password Reset\")",
            "type": "string"
          }
        },
        "required": [
          "title",
          "content"
        ],
        "type": "object"
      },
      "CreateTimeEntryDto": {
        "properties": {
          "billableRateCents": {
            "description": "Billable rate in cents per hour",
            "example": 10000,
            "type": "number"
          },
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "customJson": {
            "type": "object"
          },
          "description": {
            "example": "Worked on feature implementation",
            "type": "string"
          },
          "durationMinutes": {
            "description": "Duration in minutes",
            "example": 120,
            "type": "number"
          },
          "endedAt": {
            "example": "2024-01-15T12:00:00Z",
            "type": "string"
          },
          "invoiceId": {
            "example": "invoice-id",
            "type": "string"
          },
          "isBillable": {
            "example": true,
            "type": "boolean"
          },
          "projectId": {
            "example": "project-id",
            "type": "string"
          },
          "startedAt": {
            "example": "2024-01-15T10:00:00Z",
            "type": "string"
          },
          "taskId": {
            "example": "task-id",
            "type": "string"
          }
        },
        "required": [
          "description"
        ],
        "type": "object"
      },
      "CreateTimeOffDto": {
        "properties": {
          "endDate": {
            "example": "2025-02-05",
            "type": "string"
          },
          "reason": {
            "example": "Family vacation",
            "type": "string"
          },
          "startDate": {
            "example": "2025-02-01",
            "type": "string"
          },
          "type": {
            "default": "OTHER",
            "enum": [
              "VACATION",
              "SICK",
              "PERSONAL",
              "OTHER"
            ],
            "type": "string"
          }
        },
        "required": [
          "startDate",
          "endDate",
          "type",
          "reason"
        ],
        "type": "object"
      },
      "CreateTimelineEventDto": {
        "properties": {
          "category": {
            "description": "Category of the event",
            "example": "call",
            "type": "string"
          },
          "description": {
            "description": "Description of the event",
            "example": "Discussed project requirements and timeline",
            "type": "string"
          },
          "metadata": {
            "description": "Additional metadata for the event",
            "example": {
              "duration": 1800,
              "outcome": "positive"
            },
            "type": "object"
          },
          "source": {
            "description": "Source of the event",
            "enum": [
              "MANUAL",
              "AUTOMATED",
              "INTEGRATION",
              "AI_GENERATED"
            ],
            "example": "MANUAL",
            "type": "string"
          },
          "timestamp": {
            "description": "When the event occurred",
            "example": "2024-01-15T10:00:00Z",
            "type": "string"
          },
          "title": {
            "description": "Title of the event",
            "example": "Phone call with John Doe",
            "type": "string"
          },
          "type": {
            "description": "Type of timeline event",
            "enum": [
              "INTERACTION",
              "MILESTONE",
              "ACHIEVEMENT",
              "CHANGE",
              "ALERT"
            ],
            "example": "INTERACTION",
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "source"
        ],
        "type": "object"
      },
      "CreateTwilioShardDto": {
        "properties": {
          "accountSid": {
            "description": "Twilio Account SID (AC...)",
            "type": "string"
          },
          "authToken": {
            "description": "Twilio Auth Token for this account",
            "type": "string"
          },
          "friendlyName": {
            "description": "Human-friendly label",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "accountSid",
          "authToken"
        ],
        "type": "object"
      },
      "CreateUnifiedAgentDto": {
        "properties": {},
        "type": "object"
      },
      "CreateUsageEventDto": {
        "properties": {
          "amount": {
            "description": "Quantity used",
            "example": 5,
            "type": "number"
          },
          "costCents": {
            "description": "Cost in cents",
            "example": 100,
            "type": "number"
          },
          "metadata": {
            "example": {
              "conversationId": "conv-123"
            },
            "type": "object"
          },
          "type": {
            "example": "AI_MINUTES",
            "type": "string"
          },
          "unit": {
            "example": "minutes",
            "type": "string"
          }
        },
        "required": [
          "type",
          "amount",
          "unit"
        ],
        "type": "object"
      },
      "CreateUserDto": {
        "properties": {
          "email": {
            "example": "user@example.com",
            "type": "string"
          },
          "firstName": {
            "example": "John",
            "type": "string"
          },
          "lastName": {
            "example": "Doe",
            "type": "string"
          },
          "organizationName": {
            "example": "My Company",
            "type": "string"
          },
          "password": {
            "example": "password123",
            "type": "string"
          },
          "phone": {
            "example": "+1234567890",
            "type": "string"
          }
        },
        "required": [
          "email",
          "password",
          "firstName",
          "lastName"
        ],
        "type": "object"
      },
      "CreateVoicemailDropDto": {
        "properties": {
          "audioUrl": {
            "description": "Direct audio URL (if not using fileId)",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "durationSeconds": {
            "description": "Duration in seconds (used for UI)",
            "type": "number"
          },
          "fileId": {
            "description": "ID of a previously uploaded file asset",
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "transcript": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CreateWebhookDto": {
        "properties": {
          "events": {
            "description": "List of events to subscribe to",
            "example": [
              "company.created",
              "contact.updated",
              "deal.won"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secret": {
            "description": "Custom webhook secret (auto-generated if not provided)",
            "example": "whsec_your_webhook_secret_here",
            "type": "string"
          },
          "url": {
            "example": "https://api.example.com/webhooks",
            "type": "string"
          }
        },
        "required": [
          "url",
          "events"
        ],
        "type": "object"
      },
      "CreateWidgetConfigDto": {
        "properties": {},
        "type": "object"
      },
      "CreateWidgetSessionDto": {
        "properties": {},
        "type": "object"
      },
      "CreateWidgetWebhookDto": {
        "properties": {
          "description": {
            "description": "Admin-facing description.",
            "maxLength": 200,
            "type": "string"
          },
          "enabled": {
            "default": true,
            "description": "Whether delivery is enabled.",
            "type": "boolean"
          },
          "events": {
            "description": "Subscribed event keys.",
            "items": {
              "enum": [
                "widget.chat.started",
                "widget.chat.message",
                "widget.chat.ended",
                "widget.lead.captured",
                "widget.booking.requested",
                "widget.phone.call"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "url": {
            "description": "HTTPS endpoint URL.",
            "maxLength": 2048,
            "type": "string"
          },
          "widgetConfigId": {
            "description": "Widget config scope. Null means all widgets in the org.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "url",
          "events"
        ],
        "type": "object"
      },
      "CreateWorkflowDto": {
        "properties": {
          "definition": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowDefinitionDto"
              }
            ],
            "deprecated": true,
            "description": "Builder-shaped graph wrapper. The server lifts `definition.nodes` / `definition.edges` onto the root before validation. Prefer sending `nodes` / `edges` at the root directly."
          },
          "description": {
            "example": "Automates the customer onboarding process",
            "type": "string"
          },
          "edges": {
            "description": "Workflow graph edges. Edges referencing unknown nodes are dropped server-side rather than 400ing the save.",
            "items": {
              "$ref": "#/components/schemas/WorkflowEdgeDto"
            },
            "type": "array"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowMetadataDto"
              }
            ],
            "description": "Workflow metadata including AI conversation history and builder source tags."
          },
          "name": {
            "example": "New Customer Onboarding",
            "type": "string"
          },
          "nodes": {
            "description": "Workflow graph nodes. Sparse/null entries emitted by the builder during edits are tolerated and stripped server-side.",
            "items": {
              "$ref": "#/components/schemas/WorkflowNodeDto"
            },
            "type": "array"
          },
          "trigger": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowTriggerDto"
              }
            ],
            "description": "Trigger object for quick-start templates (type + config)."
          },
          "triggerConfig": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowTriggerConfigDto"
              }
            ],
            "description": "Trigger configuration scoped to `triggerType`. Cron schedule for SCHEDULED, event filter for EVENT, webhook secret for WEBHOOK, ignored for MANUAL."
          },
          "triggerType": {
            "enum": [
              "MANUAL",
              "SCHEDULED",
              "EVENT",
              "WEBHOOK"
            ],
            "example": "MANUAL",
            "type": "string"
          }
        },
        "required": [
          "name",
          "triggerType"
        ],
        "type": "object"
      },
      "CreativeSuggestionResponseDto": {
        "properties": {
          "adAccountId": {
            "example": "maa_123",
            "type": "string"
          },
          "audience": {
            "example": "Homeowners in Dallas with homes over 10 years old",
            "type": "string"
          },
          "channel": {
            "enum": [
              "google_ads",
              "meta_ads",
              "listings",
              "email",
              "sms"
            ],
            "example": "google_ads",
            "type": "string"
          },
          "createdAt": {
            "example": "2025-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "errorMessage": {
            "example": "Authorization failed",
            "type": "string"
          },
          "id": {
            "example": "mcs_123",
            "type": "string"
          },
          "listingConnectionId": {
            "example": "mlc_123",
            "type": "string"
          },
          "objective": {
            "example": "Promote spring HVAC tune-up offer",
            "type": "string"
          },
          "resultPayload": {
            "example": {
              "descriptions": [
                "..."
              ],
              "headlines": [
                "..."
              ]
            },
            "type": "object"
          },
          "status": {
            "example": "queued",
            "type": "string"
          },
          "tone": {
            "example": "Friendly, expert, and community-focused tone",
            "type": "string"
          },
          "updatedAt": {
            "example": "2025-01-15T10:01:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "channel",
          "status",
          "objective",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "CreditAdjustmentDto": {
        "properties": {
          "adminId": {
            "example": "admin_123",
            "type": "string"
          },
          "creditAmount": {
            "description": "Credits to add (positive) or remove (negative)",
            "example": 500,
            "type": "number"
          },
          "organizationId": {
            "description": "Organization ID",
            "example": "org_123",
            "type": "string"
          },
          "reason": {
            "example": "Bonus credits for excellent usage",
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "creditAmount",
          "reason"
        ],
        "type": "object"
      },
      "CrmReportExportRequestDto": {
        "properties": {
          "columns": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "filters": {
            "$ref": "#/components/schemas/ExportFiltersDto"
          },
          "format": {
            "enum": [
              "csv",
              "xlsx",
              "pdf"
            ],
            "type": "string"
          },
          "reportType": {
            "enum": [
              "contacts",
              "deals",
              "activities",
              "pipeline"
            ],
            "type": "string"
          }
        },
        "required": [
          "reportType",
          "format"
        ],
        "type": "object"
      },
      "CrmReportExportRequestResponseDto": {
        "properties": {
          "estimatedCompletionTime": {
            "description": "Optional server-side estimate; do not treat as a guarantee.",
            "type": "string"
          },
          "exportId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "processing"
            ],
            "type": "string"
          }
        },
        "required": [
          "exportId",
          "status"
        ],
        "type": "object"
      },
      "CrmReportExportStatusResponseDto": {
        "properties": {
          "downloadUrl": {
            "type": "string"
          },
          "errorMessage": {
            "description": "Present when status=failed (the export record exists, but generation failed).",
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "exportId": {
            "type": "string"
          },
          "rowCount": {
            "type": "number"
          },
          "status": {
            "enum": [
              "processing",
              "completed",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "exportId",
          "status"
        ],
        "type": "object"
      },
      "CustomServiceDto": {
        "properties": {
          "description": {
            "example": "Large-scale commercial heating systems",
            "type": "string"
          },
          "name": {
            "example": "Commercial HVAC",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "DateOfBirthDto": {
        "properties": {
          "day": {
            "example": 12,
            "type": "number"
          },
          "month": {
            "example": 8,
            "type": "number"
          },
          "year": {
            "example": 1985,
            "type": "number"
          }
        },
        "required": [
          "day",
          "month",
          "year"
        ],
        "type": "object"
      },
      "DateRangeDto": {
        "properties": {
          "end": {
            "type": "string"
          },
          "start": {
            "type": "string"
          }
        },
        "required": [
          "start",
          "end"
        ],
        "type": "object"
      },
      "DedupeContactsDto": {
        "properties": {
          "duplicateIds": {
            "example": [
              "duplicate-contact-id-1",
              "duplicate-contact-id-2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "primaryId": {
            "example": "primary-contact-id",
            "type": "string"
          }
        },
        "required": [
          "primaryId",
          "duplicateIds"
        ],
        "type": "object"
      },
      "DetachSmsNumberDto": {
        "properties": {
          "messagingServiceSid": {
            "description": "Detach from a specific messagingServiceSid only. If omitted, detaches from all known services.",
            "type": "string"
          },
          "phoneNumber": {
            "description": "E.164 phone number owned by the org (e.g., +15551234567)",
            "type": "string"
          }
        },
        "required": [
          "phoneNumber"
        ],
        "type": "object"
      },
      "DetectRevenueOpportunitiesDto": {
        "properties": {},
        "type": "object"
      },
      "DeveloperSandboxExecuteDto": {
        "properties": {
          "body": {
            "description": "Request body payload to pass to sandboxed request",
            "nullable": true,
            "type": "object"
          },
          "endpoint": {
            "example": "/v1/contacts",
            "type": "string"
          },
          "headers": {
            "description": "Additional request headers for sandboxed request",
            "type": "object"
          },
          "method": {
            "default": "GET",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE"
            ],
            "type": "string"
          }
        },
        "required": [
          "endpoint"
        ],
        "type": "object"
      },
      "DialerForwardingRuleDto": {
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "destinationType": {
            "type": "string"
          },
          "destinationUserId": {
            "type": "string"
          },
          "destinationValue": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "metadataJson": {
            "type": "string"
          },
          "order": {
            "type": "number"
          },
          "organizationId": {
            "type": "string"
          },
          "ringTimeoutSeconds": {
            "type": "number"
          },
          "scheduleJson": {
            "type": "string"
          },
          "settingsId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "organizationId",
          "settingsId",
          "label",
          "destinationType",
          "order",
          "ringTimeoutSeconds",
          "isActive",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "DialerForwardingRuleInputDto": {
        "properties": {
          "destinationType": {
            "description": "Destination type (USER, PHONE_NUMBER, TEAM, VOICEMAIL)",
            "example": "USER",
            "type": "string"
          },
          "destinationUserId": {
            "description": "User ID when destinationType = USER",
            "type": "string"
          },
          "destinationValue": {
            "description": "Destination phone number or team identifier",
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "metadataJson": {
            "type": "string"
          },
          "order": {
            "type": "number"
          },
          "ringTimeoutSeconds": {
            "type": "number"
          },
          "scheduleJson": {
            "description": "JSON schedule payload for advanced routing windows",
            "type": "string"
          }
        },
        "required": [
          "label",
          "destinationType"
        ],
        "type": "object"
      },
      "DialerRingGroupMemberInputDto": {
        "properties": {
          "isActive": {
            "default": true,
            "description": "Enable/disable member",
            "type": "boolean"
          },
          "metadataJson": {
            "description": "Optional metadata JSON",
            "type": "string"
          },
          "order": {
            "default": 0,
            "description": "Dial order (lower first)",
            "type": "number"
          },
          "phoneNumber": {
            "description": "Direct phone number target (E.164 recommended)",
            "type": "string"
          },
          "scheduleJson": {
            "description": "Optional schedule JSON for when this member should be callable",
            "type": "string"
          },
          "userId": {
            "description": "User ID target (preferred when dialing internal users)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DialerSettingsDto": {
        "properties": {
          "afterHoursRoutingJson": {
            "type": "string"
          },
          "callRecordingEnabled": {
            "type": "boolean"
          },
          "callerIdName": {
            "type": "string"
          },
          "complianceJson": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "defaultOutboundNumberId": {
            "type": "string"
          },
          "fallbackNumber": {
            "type": "string"
          },
          "forwardingStrategy": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadataJson": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "recordingConsentEnabled": {
            "type": "boolean"
          },
          "recordingConsentMessage": {
            "type": "string"
          },
          "ringTimeoutSeconds": {
            "type": "number"
          },
          "updatedAt": {
            "type": "string"
          },
          "voicemailDropDefaultId": {
            "type": "string"
          },
          "voicemailDropDelaySeconds": {
            "type": "number"
          },
          "voicemailDropEnabled": {
            "type": "boolean"
          },
          "voicemailGreetingUrl": {
            "type": "string"
          },
          "welcomeGreetingUrl": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "organizationId",
          "callRecordingEnabled",
          "recordingConsentEnabled",
          "voicemailDropEnabled",
          "voicemailDropDelaySeconds",
          "ringTimeoutSeconds",
          "forwardingStrategy",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "DialerSettingsResponseDto": {
        "properties": {
          "forwardingRules": {
            "items": {
              "$ref": "#/components/schemas/DialerForwardingRuleDto"
            },
            "type": "array"
          },
          "organization": {
            "$ref": "#/components/schemas/DialerSettingsDto"
          },
          "phoneNumbers": {
            "items": {
              "$ref": "#/components/schemas/VoiceNumberSummaryDto"
            },
            "type": "array"
          },
          "telephony": {
            "$ref": "#/components/schemas/TelephonyConfigDto"
          },
          "user": {
            "$ref": "#/components/schemas/DialerUserSettingsDto"
          },
          "voicemailDrops": {
            "items": {
              "$ref": "#/components/schemas/DialerVoicemailDropDto"
            },
            "type": "array"
          }
        },
        "required": [
          "organization",
          "voicemailDrops",
          "forwardingRules",
          "phoneNumbers"
        ],
        "type": "object"
      },
      "DialerUserSettingsDto": {
        "properties": {
          "availabilityJson": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "forwardingPreferenceJson": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadataJson": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "outboundNumberId": {
            "type": "string"
          },
          "recordingOptOut": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "voicemailDropId": {
            "type": "string"
          },
          "wrapUpTimeSeconds": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "organizationId",
          "userId",
          "recordingOptOut",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "DialerVoicemailDropDto": {
        "properties": {
          "audioUrl": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "createdById": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "durationSeconds": {
            "type": "number"
          },
          "fileId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "transcript": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "usageCount": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "organizationId",
          "name",
          "status",
          "usageCount",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "DispositionCodeDto": {
        "properties": {
          "code": {
            "description": "Disposition code",
            "example": "follow_up",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "DispositionCodesResponseDto": {
        "properties": {
          "dispositions": {
            "items": {
              "$ref": "#/components/schemas/DispositionCodeDto"
            },
            "type": "array"
          }
        },
        "required": [
          "dispositions"
        ],
        "type": "object"
      },
      "DuplicateSurveyTemplateDto": {
        "properties": {
          "name": {
            "example": "Post-Appointment NPS (Copy)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DuplicateWorkflowDto": {
        "properties": {
          "name": {
            "description": "Override name for the duplicated workflow",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EditTeamMessageDto": {
        "properties": {
          "content": {
            "example": "Updated content",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "EmailNotificationsDto": {
        "properties": {
          "deals": {
            "type": "boolean"
          },
          "marketing": {
            "type": "boolean"
          },
          "system": {
            "type": "boolean"
          },
          "tasks": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "EmailPreferencesDto": {
        "properties": {
          "dailyDigest": {
            "type": "boolean"
          },
          "productUpdates": {
            "type": "boolean"
          },
          "promotional": {
            "type": "boolean"
          },
          "weeklyReport": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "EnableChatChannelDto": {
        "properties": {},
        "type": "object"
      },
      "EnableVoiceChannelDto": {
        "properties": {},
        "type": "object"
      },
      "EndCallDto": {
        "properties": {
          "callId": {
            "description": "Internal call ID to end",
            "example": "clx1234567890",
            "type": "string"
          }
        },
        "required": [
          "callId"
        ],
        "type": "object"
      },
      "EndCallResponseDto": {
        "properties": {
          "callId": {
            "description": "Internal call ID",
            "type": "string"
          },
          "duration": {
            "description": "Call duration in seconds",
            "type": "number"
          },
          "endedAt": {
            "description": "Timestamp when call ended",
            "type": "string"
          },
          "status": {
            "description": "Call status after ending",
            "type": "string"
          }
        },
        "required": [
          "callId",
          "status",
          "duration",
          "endedAt"
        ],
        "type": "object"
      },
      "EnrollCadenceDto": {
        "properties": {
          "contactIds": {
            "description": "Contact IDs to enroll",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "metadata": {
            "description": "Metadata/personalization snapshot",
            "type": "object"
          },
          "source": {
            "enum": [
              "MANUAL",
              "WORKFLOW",
              "API",
              "CADENCE"
            ],
            "type": "string"
          }
        },
        "required": [
          "contactIds"
        ],
        "type": "object"
      },
      "EntitiesDto": {
        "properties": {
          "amounts": {
            "description": "Monetary amounts mentioned",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "dates": {
            "description": "Dates mentioned",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "products": {
            "description": "Products mentioned in the call",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EvalCriteriaDto": {
        "properties": {
          "should": {
            "items": {
              "$ref": "#/components/schemas/EvalCriterionDto"
            },
            "type": "array"
          },
          "shouldNot": {
            "items": {
              "$ref": "#/components/schemas/EvalCriterionDto"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EvalCriterionDto": {
        "properties": {
          "description": {
            "example": "Offer a valid next-step alternative",
            "type": "string"
          },
          "id": {
            "example": "offer_valid_alternative",
            "type": "string"
          },
          "matchAll": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "matchAny": {
            "example": [
              "available",
              "next",
              "business hours"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "maxWords": {
            "example": 80,
            "type": "number"
          },
          "minWords": {
            "example": 10,
            "type": "number"
          },
          "regex": {
            "example": "\\b\\d{4}\\b",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "EvalWeightsDto": {
        "properties": {
          "latencyThresholdMs": {
            "default": 3000,
            "type": "number"
          },
          "latencyWeight": {
            "default": 0.15,
            "type": "number"
          },
          "shouldNotWeight": {
            "default": 0.35,
            "type": "number"
          },
          "shouldWeight": {
            "default": 0.5,
            "type": "number"
          }
        },
        "type": "object"
      },
      "ExchangeDeveloperPortalSsoDto": {
        "properties": {
          "token": {
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "type": "object"
      },
      "ExecuteContactsImportDto": {
        "properties": {
          "customFieldMapping": {
            "description": "Optional mapping of CSV column index (0-based) to custom field key (e.g. {\"4\":\"lead_source\"})",
            "example": {
              "4": "lead_source",
              "5": "industry"
            },
            "type": "object"
          },
          "fileHandle": {
            "description": "Filestack handle returned from the analyze call",
            "example": "ABC123xyz",
            "type": "string"
          },
          "mapping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactsImportMappingDto"
              }
            ],
            "description": "Field-to-column mapping selected by the user"
          }
        },
        "required": [
          "fileHandle",
          "mapping"
        ],
        "type": "object"
      },
      "ExecuteCtaDto": {
        "properties": {
          "overrides": {
            "description": "Override values for the CTA payload",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ExecuteHybridContactsImportDto": {
        "properties": {
          "createReviewTask": {
            "description": "If true, create a single review task containing queued duplicate candidates. Recommended for hybrid mode.",
            "example": true,
            "type": "boolean"
          },
          "customFieldMapping": {
            "description": "Optional mapping of CSV column index (0-based) to custom field key (e.g. {\"4\":\"lead_source\"})",
            "example": {
              "4": "lead_source",
              "5": "industry"
            },
            "type": "object"
          },
          "fileHandle": {
            "description": "Filestack handle returned from the analyze call",
            "example": "ABC123xyz",
            "type": "string"
          },
          "mapping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactsImportMappingDto"
              }
            ],
            "description": "Field-to-column mapping selected by the user"
          }
        },
        "required": [
          "fileHandle",
          "mapping"
        ],
        "type": "object"
      },
      "ExportFiltersDto": {
        "properties": {
          "assignedTo": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "dateRange": {
            "$ref": "#/components/schemas/DateRangeDto"
          },
          "status": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ExternalAccountDto": {
        "properties": {
          "bankAccount": {
            "$ref": "#/components/schemas/ExternalBankAccountDto"
          },
          "token": {
            "description": "Existing bank account token",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ExternalBankAccountDto": {
        "properties": {
          "accountHolderName": {
            "example": "Acme Roofing LLC",
            "type": "string"
          },
          "accountHolderType": {
            "enum": [
              "company",
              "individual"
            ],
            "example": "company",
            "type": "string"
          },
          "accountNumber": {
            "example": "000123456789",
            "type": "string"
          },
          "country": {
            "example": "US",
            "type": "string"
          },
          "currency": {
            "example": "usd",
            "type": "string"
          },
          "routingNumber": {
            "example": "110000000",
            "type": "string"
          }
        },
        "required": [
          "accountNumber"
        ],
        "type": "object"
      },
      "FeatureFlagDto": {
        "properties": {
          "config": {
            "description": "Feature flag configuration",
            "type": "object"
          },
          "createdAt": {
            "description": "Created at",
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "description": "Feature flag description",
            "type": "string"
          },
          "enabled": {
            "description": "Whether the feature is enabled",
            "type": "boolean"
          },
          "id": {
            "description": "Feature flag ID",
            "type": "string"
          },
          "key": {
            "description": "Feature flag key",
            "type": "string"
          },
          "name": {
            "description": "Feature flag name",
            "type": "string"
          },
          "organizationId": {
            "description": "Organization ID",
            "type": "string"
          },
          "updatedAt": {
            "description": "Updated at",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "organizationId",
          "key",
          "name",
          "description",
          "enabled",
          "config",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "FrontendSurveyAnswerDto": {
        "properties": {
          "questionId": {
            "type": "string"
          },
          "value": {
            "description": "Answer value (any JSON)",
            "type": "object"
          }
        },
        "required": [
          "questionId",
          "value"
        ],
        "type": "object"
      },
      "FrontendSurveyQuestionDto": {
        "properties": {
          "id": {
            "description": "Optional client-side identifier",
            "type": "string"
          },
          "options": {
            "type": "object"
          },
          "required": {
            "default": false,
            "type": "boolean"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "GenerateCustomerJourneyMapDto": {
        "properties": {},
        "type": "object"
      },
      "GenerateCustomerPredictionsDto": {
        "properties": {},
        "type": "object"
      },
      "GenerateExperienceOptimizationDto": {
        "properties": {},
        "type": "object"
      },
      "GenerateFollowUpSuggestionsDto": {
        "properties": {},
        "type": "object"
      },
      "GenerateInstantSiteDto": {
        "properties": {
          "brandKeywords": {
            "description": "Brand keywords (e.g., modern, trusted, family-owned).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "businessDescription": {
            "description": "Describe the business, services, differentiators.",
            "type": "string"
          },
          "colorPalette": {
            "description": "Preferred color palette keywords.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ctaCopy": {
            "description": "Preferred CTA copy (e.g., “Book Consultation”).",
            "type": "string"
          },
          "desiredDomain": {
            "description": "Domain preference (for slug); we append .serviceagent.site by default.",
            "type": "string"
          },
          "highlightServices": {
            "description": "Key services or offers to highlight.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "includeBookingWidget": {
            "default": true,
            "description": "Include booking widget embed in recommended sections.",
            "type": "boolean"
          },
          "includeChatWidget": {
            "default": true,
            "description": "Include chat assistant CTA.",
            "type": "boolean"
          },
          "industry": {
            "description": "Industry or vertical (e.g., medspa, hvac, legal)",
            "type": "string"
          },
          "primaryGoal": {
            "description": "Primary conversion goal (book, call, form, membership).",
            "type": "string"
          },
          "siteName": {
            "description": "Site name (used for slug and default title)",
            "maxLength": 120,
            "minLength": 2,
            "type": "string"
          },
          "targetPages": {
            "description": "Requested pages (e.g., home, services, about, gallery).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tone": {
            "description": "Tone guidance (e.g., premium, playful, clinical).",
            "type": "string"
          }
        },
        "required": [
          "siteName",
          "businessDescription"
        ],
        "type": "object"
      },
      "GenerateProjectPasscodeDto": {
        "properties": {},
        "type": "object"
      },
      "GenerateReferralLinkDto": {
        "properties": {
          "advocateContactId": {
            "example": "contact_uuid",
            "type": "string"
          },
          "programId": {
            "example": "program_uuid",
            "type": "string"
          }
        },
        "required": [
          "advocateContactId",
          "programId"
        ],
        "type": "object"
      },
      "GenerateReviewReplyDto": {
        "properties": {
          "instructions": {
            "example": "Mention our 24/7 emergency support in the reply.",
            "type": "string"
          },
          "tone": {
            "description": "Tone or style hint for the AI-generated reply",
            "example": "empathetic",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GenerateSchedulingRecommendationsDto": {
        "properties": {},
        "type": "object"
      },
      "GenerateSmartReplyDto": {
        "properties": {
          "context": {
            "description": "Additional context for reply generation",
            "example": {
              "contactId": "contact_789",
              "previousInteraction": "booking"
            },
            "type": "object"
          },
          "messageContent": {
            "description": "Deprecated alias for message body, accepted for backward compatibility",
            "example": "Customer message body",
            "type": "string"
          },
          "messageId": {
            "description": "Message ID to generate replies for",
            "example": "msg_456",
            "type": "string"
          },
          "threadId": {
            "description": "Message thread ID",
            "example": "thread_123",
            "type": "string"
          }
        },
        "required": [
          "threadId",
          "messageId"
        ],
        "type": "object"
      },
      "GenerateWorkflowWithAiDto": {
        "properties": {
          "context": {
            "$ref": "#/components/schemas/WorkflowAiGenerateContextDto"
          },
          "conversationHistory": {
            "items": {
              "$ref": "#/components/schemas/WorkflowAiConversationMessageDto"
            },
            "type": "array"
          },
          "prompt": {
            "example": "Send appointment reminder 24 hours before scheduled time",
            "type": "string"
          }
        },
        "required": [
          "prompt"
        ],
        "type": "object"
      },
      "HandleToolCallDto": {
        "properties": {
          "toolCall": {
            "example": {
              "arguments": {
                "query": "john doe",
                "type": "contact"
              },
              "id": "call_1",
              "name": "crm_lookup"
            },
            "type": "object"
          }
        },
        "required": [
          "toolCall"
        ],
        "type": "object"
      },
      "ImportReviewRecordDto": {
        "properties": {
          "authorName": {
            "example": "Jane Doe",
            "type": "string"
          },
          "authorUrl": {
            "example": "https://www.trustpilot.com/users/xyz",
            "type": "string"
          },
          "body": {
            "example": "They were on time and professional.",
            "type": "string"
          },
          "externalReviewId": {
            "description": "Stable external identifier from the provider",
            "example": "tp_abc123",
            "type": "string"
          },
          "externalUrl": {
            "description": "Optional URL to the review on the provider",
            "example": "https://www.trustpilot.com/reviews/xyz",
            "type": "string"
          },
          "postedAt": {
            "example": "2025-12-01T10:00:00.000Z",
            "type": "string"
          },
          "rating": {
            "example": 5,
            "maximum": 5,
            "minimum": 1,
            "type": "number"
          },
          "source": {
            "description": "Provider/source key",
            "example": "trustpilot",
            "type": "string"
          },
          "title": {
            "example": "Great service",
            "type": "string"
          }
        },
        "required": [
          "source",
          "externalReviewId"
        ],
        "type": "object"
      },
      "ImportReviewsDto": {
        "properties": {
          "reviews": {
            "items": {
              "$ref": "#/components/schemas/ImportReviewRecordDto"
            },
            "type": "array"
          }
        },
        "required": [
          "reviews"
        ],
        "type": "object"
      },
      "IndustryKpiResponseDto": {
        "properties": {
          "industry": {
            "description": "Industry identifier",
            "example": "roofing",
            "type": "string"
          },
          "kpis": {
            "description": "Industry-specific KPIs",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "organizations": {
            "description": "Organization information",
            "type": "object"
          },
          "summary": {
            "description": "KPI summary",
            "type": "object"
          }
        },
        "required": [
          "industry",
          "organizations",
          "kpis",
          "summary"
        ],
        "type": "object"
      },
      "InitiateCallDto": {
        "properties": {
          "contactId": {
            "description": "Optional contact ID to associate with the call",
            "example": "clx1234567890",
            "type": "string"
          },
          "notes": {
            "description": "Call notes to attach immediately when initiating",
            "type": "string"
          },
          "outboundNumberId": {
            "description": "Specific outbound number ID to use for this call",
            "type": "string"
          },
          "phoneNumber": {
            "description": "Phone number to call in E.164 format",
            "example": "+14155551234",
            "type": "string"
          },
          "tags": {
            "description": "Tags to stamp on the call record",
            "example": [
              "outbound",
              "demo"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "voicemailDropId": {
            "description": "Voicemail drop ID to preload for this call",
            "type": "string"
          }
        },
        "required": [
          "phoneNumber"
        ],
        "type": "object"
      },
      "InitiateCallResponseDto": {
        "properties": {
          "callId": {
            "description": "Internal call ID",
            "type": "string"
          },
          "contactId": {
            "description": "Associated contact ID",
            "type": "string"
          },
          "phoneNumber": {
            "description": "Phone number being called",
            "type": "string"
          },
          "providerCallId": {
            "description": "Provider Call ID (Twilio SID, FreeSWITCH UUID, etc.)",
            "type": "string"
          },
          "status": {
            "description": "Current call status",
            "type": "string"
          },
          "timestamp": {
            "description": "Timestamp when call was initiated",
            "type": "string"
          }
        },
        "required": [
          "callId",
          "providerCallId",
          "status",
          "phoneNumber",
          "timestamp"
        ],
        "type": "object"
      },
      "InitiateOutboundCallDto": {
        "properties": {},
        "type": "object"
      },
      "InitiateTestCallDto": {
        "properties": {
          "phoneNumber": {
            "description": "User's phone number to call (E.164).",
            "example": "+12025551234",
            "type": "string"
          }
        },
        "required": [
          "phoneNumber"
        ],
        "type": "object"
      },
      "InsightActionDto": {
        "properties": {
          "action": {
            "description": "Description of the action taken",
            "example": "Scheduled follow-up call for next week",
            "type": "string"
          },
          "metadata": {
            "description": "Additional metadata about the action",
            "example": {
              "scheduledDate": "2024-01-15T10:00:00Z"
            },
            "type": "object"
          },
          "notes": {
            "description": "Additional notes about the action",
            "example": "Discuss pricing options",
            "type": "string"
          }
        },
        "required": [
          "action"
        ],
        "type": "object"
      },
      "InstallClaimDto": {
        "properties": {
          "email": {
            "description": "Owner email for the newly claimed workspace",
            "type": "string"
          },
          "firstName": {
            "description": "First name",
            "type": "string"
          },
          "installToken": {
            "description": "Install token embedded in claim URL",
            "type": "string"
          },
          "lastName": {
            "description": "Last name",
            "type": "string"
          },
          "organizationName": {
            "description": "Optional override of org name after claim",
            "type": "string"
          },
          "password": {
            "description": "Password (v1 claim uses password; magic-link can replace later)",
            "type": "string"
          }
        },
        "required": [
          "installToken",
          "email",
          "firstName",
          "lastName",
          "password"
        ],
        "type": "object"
      },
      "InstallExchangeDto": {
        "properties": {
          "installToken": {
            "description": "Install token from /install/start",
            "type": "string"
          }
        },
        "required": [
          "installToken"
        ],
        "type": "object"
      },
      "InstallProvisionDto": {
        "properties": {
          "module": {
            "description": "Module to provision",
            "enum": [
              "chat",
              "voice",
              "forms",
              "location"
            ],
            "type": "string"
          },
          "name": {
            "description": "Widget/agent name",
            "type": "string"
          },
          "siteUrl": {
            "description": "Site URL for branding + origin lock",
            "type": "string"
          }
        },
        "required": [
          "module"
        ],
        "type": "object"
      },
      "InstallStartDto": {
        "properties": {
          "client": {
            "description": "Free-form sub-identifier for the originating client (e.g. MCP server version \"@serviceagent/mcp@1.0.3\"). Logged for debugging only; not validated against an enum.",
            "maxLength": 120,
            "type": "string"
          },
          "framework": {
            "description": "Framework of the calling project (separate from `platform`, which is the install source). Logged in install settings for telemetry.",
            "enum": [
              "nextjs",
              "react",
              "vite",
              "astro",
              "remix",
              "svelte",
              "nuxt",
              "html",
              "node",
              "unknown"
            ],
            "type": "string"
          },
          "module": {
            "default": "chat",
            "description": "Requested module to provision (v1 ships chat)",
            "enum": [
              "chat"
            ],
            "type": "string"
          },
          "platform": {
            "description": "Install source — the AI builder, IDE, or MCP client originating the install. Used for funnel attribution.",
            "enum": [
              "lovable",
              "bolt",
              "v0",
              "replit",
              "emergent",
              "base44",
              "stackblitz",
              "cursor",
              "windsurf",
              "continue",
              "vscode",
              "mcp",
              "cursor-mcp",
              "claude-desktop",
              "claude-code",
              "windsurf-mcp",
              "continue-mcp",
              "cline",
              "chatgpt",
              "unknown"
            ],
            "type": "string"
          },
          "siteName": {
            "description": "Business/site name to seed defaults (e.g. companyName).",
            "maxLength": 120,
            "type": "string"
          },
          "siteUrl": {
            "description": "Website URL for branding + origin lock seeding",
            "type": "string"
          }
        },
        "required": [
          "module"
        ],
        "type": "object"
      },
      "InstallWorkflowRecipeDto": {
        "properties": {
          "name": {
            "description": "Optional workflow name override.",
            "type": "string"
          },
          "overrides": {
            "description": "Optional recipe graph/config overrides.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "InstantiateWorkflowTemplateDto": {
        "properties": {
          "activate": {
            "description": "Activate workflow immediately after creation",
            "type": "boolean"
          },
          "description": {
            "description": "Override description for the workflow",
            "type": "string"
          },
          "name": {
            "description": "Override name for the new workflow",
            "type": "string"
          },
          "variables": {
            "description": "Initial variable values for the template",
            "type": "object"
          }
        },
        "type": "object"
      },
      "InviteMemberDto": {
        "properties": {
          "email": {
            "description": "Email address of the person to invite",
            "example": "john.doe@example.com",
            "type": "string"
          },
          "firstName": {
            "description": "First name of the person to invite",
            "example": "John",
            "type": "string"
          },
          "lastName": {
            "description": "Last name of the person to invite",
            "example": "Doe",
            "type": "string"
          },
          "role": {
            "default": "USER",
            "description": "Role to assign to the new member",
            "enum": [
              "OWNER",
              "ADMIN",
              "USER"
            ],
            "example": "USER",
            "type": "string"
          }
        },
        "required": [
          "email",
          "firstName",
          "lastName"
        ],
        "type": "object"
      },
      "InviteUserDto": {
        "properties": {
          "email": {
            "example": "admin@example.com",
            "type": "string"
          },
          "firstName": {
            "example": "Ada",
            "type": "string"
          },
          "lastName": {
            "example": "Lovelace",
            "type": "string"
          },
          "password": {
            "example": "TempP@ssw0rd!",
            "minLength": 8,
            "type": "string"
          },
          "role": {
            "enum": [
              "ADMIN",
              "USER",
              "member"
            ],
            "example": "ADMIN",
            "type": "string"
          }
        },
        "required": [
          "email",
          "firstName",
          "lastName"
        ],
        "type": "object"
      },
      "InvoiceBrandingDto": {
        "properties": {
          "accentColor": {
            "example": "#1E40AF",
            "type": "string"
          },
          "address": {
            "example": "123 Main St, City, State 12345",
            "type": "string"
          },
          "companyName": {
            "example": "Your Company Name",
            "type": "string"
          },
          "email": {
            "example": "contact@company.com",
            "type": "string"
          },
          "footerText": {
            "example": "Thank you for your business!",
            "type": "string"
          },
          "logo": {
            "example": "https://example.com/logo.png",
            "type": "string"
          },
          "phone": {
            "example": "+1 (555) 123-4567",
            "type": "string"
          },
          "primaryColor": {
            "example": "#3B82F6",
            "type": "string"
          }
        },
        "required": [
          "companyName",
          "primaryColor",
          "accentColor",
          "footerText"
        ],
        "type": "object"
      },
      "InvoiceItemDto": {
        "properties": {
          "amount": {
            "example": 10000,
            "type": "number"
          },
          "description": {
            "example": "Item description",
            "type": "string"
          },
          "name": {
            "example": "Service Item",
            "type": "string"
          },
          "quantity": {
            "example": 1,
            "type": "number"
          },
          "taxRate": {
            "example": 0.1,
            "type": "number"
          }
        },
        "required": [
          "name",
          "description",
          "quantity",
          "amount"
        ],
        "type": "object"
      },
      "LinkContactDto": {
        "properties": {
          "contactId": {
            "description": "Contact ID to link to this note",
            "type": "string"
          }
        },
        "required": [
          "contactId"
        ],
        "type": "object"
      },
      "ListingConnectionNapComparisonDto": {
        "properties": {
          "canonical": {
            "example": "Acme HVAC Services",
            "type": "string"
          },
          "field": {
            "enum": [
              "name",
              "phone",
              "address"
            ],
            "example": "phone",
            "type": "string"
          },
          "match": {
            "example": false,
            "type": "boolean"
          },
          "provider": {
            "example": "Acme Heating & Air",
            "type": "string"
          }
        },
        "required": [
          "field",
          "match"
        ],
        "type": "object"
      },
      "ListingConnectionNapValidationDto": {
        "properties": {
          "canonicalSource": {
            "enum": [
              "location_override",
              "location",
              "organization"
            ],
            "example": "location",
            "type": "string"
          },
          "comparedAt": {
            "example": "2025-01-18T10:15:00.000Z",
            "type": "string"
          },
          "comparisons": {
            "items": {
              "$ref": "#/components/schemas/ListingConnectionNapComparisonDto"
            },
            "type": "array"
          },
          "locationId": {
            "example": "loc_123",
            "type": "string"
          },
          "notes": {
            "example": "Phone numbers differ between Google and CRM",
            "type": "string"
          },
          "provider": {
            "enum": [
              "google_business",
              "yelp",
              "facebook",
              "apple_maps",
              "bing",
              "trustpilot"
            ],
            "example": "google_business",
            "type": "string"
          },
          "specComparisons": {
            "example": [
              {
                "actual": "+15555559876",
                "expected": "+15555551212",
                "field": "phone",
                "matches": false
              }
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "specStatus": {
            "enum": [
              "valid",
              "mismatch",
              "pending"
            ],
            "example": "mismatch",
            "type": "string"
          },
          "status": {
            "enum": [
              "match",
              "mismatch",
              "unknown"
            ],
            "example": "mismatch",
            "type": "string"
          }
        },
        "required": [
          "status",
          "comparedAt",
          "provider",
          "canonicalSource",
          "comparisons"
        ],
        "type": "object"
      },
      "ListingConnectionResponseDto": {
        "properties": {
          "authUrl": {
            "example": "https://accounts.google.com/o/oauth2/auth?...",
            "type": "string"
          },
          "createdAt": {
            "example": "2024-01-10T09:00:00Z",
            "type": "string"
          },
          "errorMessage": {
            "example": "Authorization failed",
            "type": "string"
          },
          "externalId": {
            "example": "accounts/123/locations/456",
            "type": "string"
          },
          "externalLocationId": {
            "example": "accounts/123/locations/456",
            "type": "string"
          },
          "hasAuthenticatedConnection": {
            "example": true,
            "type": "boolean"
          },
          "id": {
            "example": "mlc_123",
            "type": "string"
          },
          "lastSyncAt": {
            "example": "2024-01-16T10:00:00Z",
            "type": "string"
          },
          "lastSyncStatus": {
            "example": "success",
            "type": "string"
          },
          "locationId": {
            "example": "loc_123",
            "type": "string"
          },
          "metadata": {
            "example": {
              "autoSync": true
            },
            "type": "object"
          },
          "name": {
            "example": "Acme Heating & Air - Main Location",
            "type": "string"
          },
          "napValidation": {
            "$ref": "#/components/schemas/ListingConnectionNapValidationDto"
          },
          "provider": {
            "enum": [
              "google_business",
              "yelp",
              "facebook",
              "apple_maps",
              "bing",
              "trustpilot"
            ],
            "example": "google_business",
            "type": "string"
          },
          "status": {
            "example": "connected",
            "type": "string"
          },
          "updatedAt": {
            "example": "2024-01-16T12:00:00Z",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider",
          "status",
          "hasAuthenticatedConnection",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "LoginDeveloperDto": {
        "properties": {
          "apiKey": {
            "example": "sa_pk_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
            "type": "string"
          }
        },
        "required": [
          "apiKey"
        ],
        "type": "object"
      },
      "LoginDto": {
        "properties": {
          "email": {
            "example": "user@example.com",
            "type": "string"
          },
          "password": {
            "example": "password123",
            "type": "string"
          },
          "rememberMe": {
            "description": "If true, issue a longer-lived access token.",
            "example": true,
            "type": "boolean"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "type": "object"
      },
      "MarkMentionsReadDto": {
        "properties": {
          "mentionIds": {
            "example": [
              "mentionId1",
              "mentionId2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "mentionIds"
        ],
        "type": "object"
      },
      "MarkReadDto": {
        "properties": {
          "lastReadMessageId": {
            "example": "messageId",
            "type": "string"
          }
        },
        "required": [
          "lastReadMessageId"
        ],
        "type": "object"
      },
      "MarketingDashboardResponseDto": {
        "properties": {
          "ads": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MarketingSummaryCardDto"
              }
            ],
            "description": "Ad performance summary"
          },
          "creative": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MarketingSummaryCardDto"
              }
            ],
            "description": "Creative throughput summary"
          },
          "listings": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MarketingSummaryCardDto"
              }
            ],
            "description": "Listings health summary"
          },
          "raw": {
            "description": "Raw metric payload for custom dashboards",
            "example": {
              "blended": {
                "listings_mismatch": 5,
                "spend": 3200
              }
            },
            "type": "object"
          },
          "reviews": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MarketingSummaryCardDto"
              }
            ],
            "description": "Review funnel summary"
          },
          "timeseries": {
            "description": "Timeseries datapoints keyed by metric name",
            "example": {
              "spend": [
                {
                  "date": "2025-01-01",
                  "value": 1200
                }
              ]
            },
            "type": "object"
          }
        },
        "required": [
          "listings",
          "ads",
          "reviews",
          "creative",
          "timeseries",
          "raw"
        ],
        "type": "object"
      },
      "MarketingNapProfileDto": {
        "properties": {
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrgAddressDto"
              }
            ],
            "description": "Canonical structured address for citations."
          },
          "categories": {
            "description": "Free-form business categories shown on directory listings.",
            "example": [
              "HVAC contractor",
              "Heating contractor"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "hours": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrgBusinessHoursDto"
              }
            ],
            "description": "Public hours displayed on listings (may differ from internal availability)."
          },
          "name": {
            "description": "Canonical business name as it should appear on directory listings.",
            "example": "Acme Heating & Air",
            "type": "string"
          },
          "phone": {
            "example": "+1-555-0123",
            "type": "string"
          },
          "website": {
            "example": "https://acme.com",
            "type": "string"
          }
        },
        "type": "object"
      },
      "MarketingNotificationPreferencesDto": {
        "properties": {
          "campaignPaused": {
            "type": "boolean"
          },
          "infoMismatch": {
            "type": "boolean"
          },
          "lowBalance": {
            "type": "boolean"
          },
          "negativeReview": {
            "type": "boolean"
          },
          "newReview": {
            "type": "boolean"
          },
          "weeklyDigest": {
            "type": "boolean"
          }
        },
        "required": [
          "lowBalance",
          "campaignPaused",
          "newReview",
          "negativeReview",
          "infoMismatch",
          "weeklyDigest"
        ],
        "type": "object"
      },
      "MarketingOnboardingAdsDto": {
        "properties": {
          "dailyBudget": {
            "description": "Daily budget in dollars (frontend spec)",
            "example": 50,
            "type": "number"
          },
          "enabled": {
            "type": "boolean"
          },
          "monthlyBudget": {
            "description": "Monthly budget in dollars (frontend spec)",
            "example": 1500,
            "type": "number"
          }
        },
        "required": [
          "enabled",
          "dailyBudget",
          "monthlyBudget"
        ],
        "type": "object"
      },
      "MarketingOnboardingConfigDto": {
        "properties": {
          "ads": {
            "$ref": "#/components/schemas/MarketingOnboardingAdsDto"
          },
          "presence": {
            "$ref": "#/components/schemas/MarketingOnboardingPresenceDto"
          },
          "reviews": {
            "$ref": "#/components/schemas/MarketingOnboardingReviewsDto"
          },
          "websites": {
            "$ref": "#/components/schemas/MarketingOnboardingWebsitesDto"
          }
        },
        "required": [
          "ads",
          "reviews",
          "presence",
          "websites"
        ],
        "type": "object"
      },
      "MarketingOnboardingPresenceDto": {
        "properties": {
          "autoSync": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "autoSync"
        ],
        "type": "object"
      },
      "MarketingOnboardingReviewsDto": {
        "properties": {
          "autoSend": {
            "type": "boolean"
          },
          "delayHours": {
            "example": 24,
            "type": "number"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "autoSend",
          "delayHours"
        ],
        "type": "object"
      },
      "MarketingOnboardingWebsitesDto": {
        "properties": {
          "analytics": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "analytics"
        ],
        "type": "object"
      },
      "MarketingSummaryCardDto": {
        "properties": {
          "breakdown": {
            "description": "Breakdown by channel/provider/status",
            "example": {
              "google_ads": 12
            },
            "type": "object"
          },
          "metrics": {
            "description": "Additional metric fields (CTR, CPM, conversions)",
            "example": {
              "conversions": 18,
              "ctr": 3.2
            },
            "type": "object"
          },
          "total": {
            "description": "Total count across the dimension",
            "example": 42,
            "type": "number"
          }
        },
        "required": [
          "total",
          "breakdown",
          "metrics"
        ],
        "type": "object"
      },
      "McpTelemetryDto": {
        "properties": {
          "authenticated": {
            "description": "Whether the calling org/user was authenticated to the MCP server.",
            "type": "boolean"
          },
          "client": {
            "description": "Stable identifier for the originating MCP client (e.g. `cursor-mcp`).",
            "maxLength": 60,
            "type": "string"
          },
          "durationMs": {
            "description": "Total tool execution time in milliseconds",
            "type": "number"
          },
          "errorMessage": {
            "description": "Error message (when status=error)",
            "maxLength": 500,
            "type": "string"
          },
          "serverVersion": {
            "description": "MCP server package version (e.g. `1.1.0`)",
            "maxLength": 32,
            "type": "string"
          },
          "status": {
            "enum": [
              "success",
              "error"
            ],
            "type": "string"
          },
          "tool": {
            "description": "Tool name, e.g. `create_voice_agent`",
            "type": "string"
          },
          "transport": {
            "description": "Transport used to reach the MCP server",
            "enum": [
              "stdio",
              "http"
            ],
            "type": "string"
          }
        },
        "required": [
          "tool",
          "status",
          "durationMs"
        ],
        "type": "object"
      },
      "McpToolRequestDto": {
        "properties": {
          "arguments": {
            "description": "Tool arguments",
            "example": {
              "phone": "+15551234567",
              "script_id": "scr_hvac_v1",
              "session_type": "outbound"
            },
            "type": "object"
          },
          "metadata": {
            "description": "Request metadata",
            "example": {
              "context": "missed_call_recovery",
              "priority": "high"
            },
            "type": "object"
          },
          "tool": {
            "description": "Tool name (e.g., agents.start_call, leads.upsert)",
            "example": "agents.start_call",
            "type": "string"
          }
        },
        "required": [
          "tool",
          "arguments"
        ],
        "type": "object"
      },
      "McpToolResponseDto": {
        "properties": {
          "content": {
            "description": "Tool execution result",
            "example": {
              "call_id": "call_002",
              "call_session_id": "rts_456",
              "dial_status": "initiated"
            },
            "type": "object"
          },
          "error": {
            "description": "Error message if execution failed",
            "example": "Invalid phone number format",
            "type": "string"
          },
          "isError": {
            "description": "Whether the tool execution was successful",
            "example": true,
            "type": "boolean"
          },
          "metadata": {
            "description": "Execution metadata",
            "example": {
              "cached": false,
              "execution_time_ms": 150
            },
            "type": "object"
          }
        },
        "required": [
          "content",
          "isError"
        ],
        "type": "object"
      },
      "MergeCompaniesDto": {
        "properties": {
          "primaryId": {
            "example": "primary-company-id",
            "type": "string"
          },
          "secondaryIds": {
            "example": [
              "secondary-company-id-1",
              "secondary-company-id-2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "primaryId",
          "secondaryIds"
        ],
        "type": "object"
      },
      "MineConversationDto": {
        "properties": {},
        "type": "object"
      },
      "MineMultipleConversationsDto": {
        "properties": {},
        "type": "object"
      },
      "NapChangeResponseDto": {
        "properties": {
          "canonicalValue": {
            "example": "Acme HVAC Services",
            "type": "string"
          },
          "detectedAt": {
            "example": "2025-01-20T15:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "field": {
            "enum": [
              "name",
              "phone",
              "address"
            ],
            "example": "address",
            "type": "string"
          },
          "id": {
            "example": "mnc_123",
            "type": "string"
          },
          "lastObservedAt": {
            "example": "2025-01-21T08:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "listingConnectionId": {
            "example": "loc_conn_123",
            "type": "string"
          },
          "metadata": {
            "example": {
              "history": []
            },
            "type": "object"
          },
          "notes": {
            "example": "Customer moved locations, updating listing",
            "type": "string"
          },
          "provider": {
            "enum": [
              "google_business",
              "yelp",
              "facebook",
              "apple_maps",
              "bing",
              "trustpilot"
            ],
            "example": "google",
            "type": "string"
          },
          "providerValue": {
            "example": "Acme Heating & Cooling",
            "type": "string"
          },
          "remediationJobId": {
            "example": "job_abc123",
            "type": "string"
          },
          "resolutionType": {
            "example": "canonical_update",
            "type": "string"
          },
          "resolvedAt": {
            "example": "2025-01-22T09:30:00Z",
            "format": "date-time",
            "type": "string"
          },
          "resolvedByUserId": {
            "example": "user_456",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "in_progress",
              "resolved",
              "ignored"
            ],
            "example": "pending",
            "type": "string"
          },
          "triggeredByUserId": {
            "example": "user_123",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider",
          "field",
          "status",
          "detectedAt",
          "lastObservedAt",
          "listingConnectionId"
        ],
        "type": "object"
      },
      "OnboardingDataDto": {
        "properties": {},
        "type": "object"
      },
      "OnboardingPhase1AcceptDraftDto": {
        "properties": {
          "markOnboardingComplete": {
            "description": "Set true to also mark onboarding as fully complete if your UX treats Accept Draft as finalization.",
            "example": false,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "OnboardingPhase1ChatDto": {
        "properties": {
          "message": {
            "example": "Our business name is Cooling Pros LLC and we offer AC repair, maintenance, and duct cleaning.",
            "type": "string"
          },
          "patch": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OnboardingPhase1DraftPatchDto"
              }
            ],
            "description": "Optional structured patch to update draft fields directly."
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "OnboardingPhase1DraftPatchDto": {
        "properties": {
          "address": {
            "example": "123 Main St, Austin, TX 78701",
            "type": "string"
          },
          "businessName": {
            "example": "Cooling Pros LLC",
            "type": "string"
          },
          "email": {
            "example": "support@coolingprosllc.com",
            "type": "string"
          },
          "gbpUrl": {
            "example": "https://maps.google.com/?cid=12345678901234567890",
            "type": "string"
          },
          "hours": {
            "example": {
              "monday": {
                "close": "17:00",
                "open": "09:00"
              },
              "tuesday": {
                "close": "17:00",
                "open": "09:00"
              }
            },
            "type": "object"
          },
          "phone": {
            "example": "+1 555 010 2200",
            "type": "string"
          },
          "services": {
            "items": {
              "$ref": "#/components/schemas/OnboardingPhase1ServiceDraftDto"
            },
            "type": "array"
          },
          "websiteUrl": {
            "example": "https://coolingprosllc.com",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OnboardingPhase1IngestUrlDto": {
        "properties": {
          "source": {
            "default": "auto",
            "description": "Source hint; auto infers from URL.",
            "enum": [
              "auto",
              "website",
              "gbp"
            ],
            "type": "string"
          },
          "url": {
            "description": "Single URL to ingest (website or Google Business Profile URL).",
            "example": "https://coolingprosllc.com",
            "type": "string"
          },
          "urls": {
            "description": "Batch URL ingestion; merged into one onboarding draft.",
            "example": [
              "https://coolingprosllc.com",
              "https://maps.google.com/?cid=12345678901234567890"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "OnboardingPhase1ServiceDraftDto": {
        "properties": {
          "description": {
            "example": "24/7 emergency AC repair and diagnostics",
            "type": "string"
          },
          "name": {
            "example": "AC Repair",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "OrgAddressDto": {
        "properties": {
          "city": {
            "example": "Dallas",
            "type": "string"
          },
          "country": {
            "example": "US",
            "type": "string"
          },
          "postalCode": {
            "description": "Postal/zip code (alias of `zip`). Either field may be sent.",
            "example": "75201",
            "type": "string"
          },
          "state": {
            "example": "TX",
            "type": "string"
          },
          "street": {
            "example": "123 Main St",
            "type": "string"
          },
          "zip": {
            "description": "Postal/zip code. `zip` and `postalCode` are aliases — both are accepted.",
            "example": "75201",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrgBusinessHoursDto": {
        "properties": {
          "schedule": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrgBusinessHoursScheduleDto"
              }
            ],
            "description": "Per-weekday array of HH:mm open intervals. Days omitted from this object are treated as closed."
          },
          "timezone": {
            "description": "IANA timezone name applied to all schedule slots.",
            "example": "America/New_York",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrgBusinessHoursScheduleDto": {
        "properties": {
          "friday": {
            "items": {
              "$ref": "#/components/schemas/OrgBusinessHoursSlotDto"
            },
            "type": "array"
          },
          "monday": {
            "items": {
              "$ref": "#/components/schemas/OrgBusinessHoursSlotDto"
            },
            "type": "array"
          },
          "saturday": {
            "items": {
              "$ref": "#/components/schemas/OrgBusinessHoursSlotDto"
            },
            "type": "array"
          },
          "sunday": {
            "items": {
              "$ref": "#/components/schemas/OrgBusinessHoursSlotDto"
            },
            "type": "array"
          },
          "thursday": {
            "items": {
              "$ref": "#/components/schemas/OrgBusinessHoursSlotDto"
            },
            "type": "array"
          },
          "tuesday": {
            "items": {
              "$ref": "#/components/schemas/OrgBusinessHoursSlotDto"
            },
            "type": "array"
          },
          "wednesday": {
            "items": {
              "$ref": "#/components/schemas/OrgBusinessHoursSlotDto"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "OrgBusinessHoursSlotDto": {
        "properties": {
          "end": {
            "description": "24-hour HH:mm clock time for slot end.",
            "example": "17:00",
            "type": "string"
          },
          "start": {
            "description": "24-hour HH:mm clock time for slot start.",
            "example": "09:00",
            "type": "string"
          }
        },
        "required": [
          "start",
          "end"
        ],
        "type": "object"
      },
      "OrgSettingsDto": {
        "properties": {
          "currency": {
            "description": "Default currency code for invoices/workflows.",
            "example": "USD",
            "type": "string"
          },
          "emailSendMethod": {
            "description": "Which transport sends transactional and outbound emails for this org. `system` = the org's connected SMTP/Gmail/etc; `serviceagent` = our shared sending domain.",
            "enum": [
              "system",
              "serviceagent"
            ],
            "example": "serviceagent",
            "type": "string"
          },
          "ownerEmail": {
            "description": "Primary owner email used in workflow variables.",
            "type": "string"
          },
          "ownerId": {
            "description": "User ID of the primary owner.",
            "type": "string"
          },
          "ownerPhone": {
            "description": "Primary owner phone number (E.164 recommended).",
            "type": "string"
          },
          "supportEmail": {
            "description": "Support email displayed in templates.",
            "type": "string"
          },
          "supportPhone": {
            "description": "Support phone number displayed in templates.",
            "type": "string"
          },
          "timezone": {
            "description": "Default timezone for workflows.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrganizationResponseDto": {
        "properties": {
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrgAddressDto"
              }
            ],
            "description": "Structured business address used across settings and AI profiles"
          },
          "agencySettings": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AgencySettingsDto"
              }
            ],
            "description": "Agency-mode features and limits (returned for agency-managed organizations)."
          },
          "billingModel": {
            "description": "Billing model applied when the organization is managed by an agency",
            "enum": [
              "agency_pays",
              "client_pays",
              "hybrid"
            ],
            "type": "string"
          },
          "businessHours": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrgBusinessHoursDto"
              }
            ],
            "description": "Business hours configuration referencing timezone-aware slots"
          },
          "callIntelligenceEnabled": {
            "description": "Whether post-call intelligence (transcription analysis, summaries, action items) is enabled",
            "example": true,
            "type": "boolean"
          },
          "createdAt": {
            "description": "When the organization was created",
            "example": "2024-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "domain": {
            "description": "Domain of the organization",
            "example": "acme.com",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for the organization",
            "example": "org_123",
            "type": "string"
          },
          "industry": {
            "description": "Industry type of the organization (defaults to general)",
            "enum": [
              "general",
              "construction",
              "general_contractor",
              "roofing",
              "hvac",
              "plumbing",
              "electrical",
              "solar",
              "garage",
              "pest_control",
              "pool_service",
              "appliance_repair",
              "restoration",
              "moving",
              "legal",
              "insurance",
              "healthcare",
              "medical",
              "automotive",
              "real-estate",
              "realestate",
              "salon",
              "fitness",
              "restaurant",
              "dental",
              "spa",
              "home_services",
              "consulting",
              "cleaning",
              "landscaping",
              "painting",
              "photography",
              "event_planning",
              "pet_services",
              "education",
              "transportation",
              "it_services",
              "accounting",
              "seo_services",
              "marketing_agency",
              "advertising_agency",
              "other"
            ],
            "example": "roofing",
            "type": "string"
          },
          "invoiceBranding": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceBrandingDto"
              }
            ],
            "description": "Branding overrides applied to invoice templates for this organization."
          },
          "isActive": {
            "description": "Whether the organization is active",
            "example": true,
            "type": "boolean"
          },
          "isOwner": {
            "description": "Whether the current user has owner-level access for this organization",
            "example": true,
            "type": "boolean"
          },
          "managedByAgency": {
            "description": "Indicates if the organization is managed by its parent agency",
            "example": true,
            "type": "boolean"
          },
          "managerEmail": {
            "description": "Default manager email used for escalations and templates",
            "example": "gm@acme.com",
            "type": "string"
          },
          "managerPhone": {
            "description": "Primary manager phone number used in templates",
            "example": "+15550100",
            "type": "string"
          },
          "marketingNapProfile": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MarketingNapProfileDto"
              }
            ],
            "description": "Canonical name, address, and phone profile for directory listings"
          },
          "marketingServiceAreaZipCodes": {
            "description": "Service area zip codes used for localized marketing",
            "example": [
              "75201",
              "75202"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "marketingVerticals": {
            "description": "Marketing vertical tags associated with this organization",
            "example": [
              "hvac",
              "plumbing"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "description": "Name of the organization",
            "example": "Acme Corporation",
            "type": "string"
          },
          "parentOrganizationId": {
            "description": "Parent organization identifier when part of an agency hierarchy",
            "example": "org_parent_456",
            "type": "string"
          },
          "reviewLink": {
            "description": "Public review link used in workflows and templates",
            "example": "https://reviews.acme.com/share",
            "type": "string"
          },
          "settings": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrganizationSettingsDto"
              }
            ],
            "description": "Organization-level settings for workflow and template variables."
          },
          "timezone": {
            "description": "Timezone of the organization",
            "example": "America/New_York",
            "type": "string"
          },
          "type": {
            "description": "Organization type (agency, client, standalone)",
            "enum": [
              "agency",
              "client",
              "standalone"
            ],
            "type": "string"
          },
          "updatedAt": {
            "description": "When the organization was last updated",
            "example": "2024-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "timezone",
          "isActive",
          "isOwner",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "OrganizationSettingsDto": {
        "properties": {
          "currency": {
            "description": "Default currency code for invoices/workflows.",
            "example": "USD",
            "type": "string"
          },
          "emailSendMethod": {
            "description": "Which transport sends transactional and outbound emails for this org. `system` = the org's connected SMTP/Gmail/etc; `serviceagent` = our shared sending domain.",
            "enum": [
              "system",
              "serviceagent"
            ],
            "example": "serviceagent",
            "type": "string"
          },
          "ownerEmail": {
            "description": "Primary owner email used in workflow variables.",
            "type": "string"
          },
          "ownerId": {
            "description": "User ID of the primary owner.",
            "type": "string"
          },
          "ownerPhone": {
            "description": "Primary owner phone number (E.164 recommended).",
            "type": "string"
          },
          "supportEmail": {
            "description": "Support email displayed in templates.",
            "type": "string"
          },
          "supportPhone": {
            "description": "Support phone number displayed in templates.",
            "type": "string"
          },
          "timezone": {
            "description": "Default timezone for workflows.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrganizationTagDto": {
        "properties": {
          "color": {
            "example": "#6366f1",
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "description": {
            "example": "High-value customers requiring priority service",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "locationId": {
            "description": "Multi-location v1: null means global default; otherwise location-owned.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "example": "VIP",
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "usageCount": {
            "example": 0,
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "color",
          "usageCount",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "OutboundAttachmentDto": {
        "properties": {
          "filename": {
            "example": "invoice.pdf",
            "type": "string"
          },
          "mimeType": {
            "example": "application/pdf",
            "type": "string"
          },
          "size": {
            "example": 245000,
            "type": "number"
          },
          "url": {
            "example": "https://storage.example.com/files/invoice.pdf",
            "type": "string"
          }
        },
        "required": [
          "filename",
          "url"
        ],
        "type": "object"
      },
      "OutboundCallRequestDto": {
        "properties": {
          "contactId": {
            "description": "Link the call to a CRM contact.",
            "example": "contact_abc123",
            "type": "string"
          },
          "context": {
            "description": "Context for the AI agent about the call purpose (contract alias for purpose).",
            "example": "Following up on quote request for HVAC repair",
            "type": "string"
          },
          "dealId": {
            "description": "Link the call to a CRM deal.",
            "example": "deal_xyz789",
            "type": "string"
          },
          "initialMessage": {
            "description": "Optional initial message to prime the call.",
            "example": "Hi {{contact.firstName}}, this is a quick follow-up call...",
            "type": "string"
          },
          "maxDurationSeconds": {
            "default": 300,
            "description": "Maximum call duration in seconds used for pre-flight credit estimation.",
            "example": 300,
            "type": "number"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "Arbitrary metadata passed through to the voice agent context.",
            "type": "object"
          },
          "phoneNumber": {
            "description": "Destination phone number in E.164 format.",
            "example": "+12025551234",
            "type": "string"
          },
          "purpose": {
            "description": "Optional purpose or context for the call.",
            "example": "Post-demo follow-up",
            "type": "string"
          },
          "recordCall": {
            "description": "Whether to record the call (provider-dependent).",
            "example": true,
            "type": "boolean"
          },
          "voiceAgentId": {
            "description": "Voice agent configuration to use for the outbound call.",
            "example": "voiceagent_123",
            "type": "string"
          },
          "voiceId": {
            "description": "Optional voice ID (provider-specific).",
            "example": "alloy",
            "type": "string"
          }
        },
        "required": [
          "phoneNumber",
          "voiceAgentId"
        ],
        "type": "object"
      },
      "OutboundCallResponseDto": {
        "properties": {
          "callId": {
            "type": "string"
          },
          "estimatedConnectTime": {
            "description": "Estimated time in seconds before the call connects.",
            "type": "number"
          },
          "initiatedAt": {
            "description": "ISO timestamp for when the call was initiated.",
            "type": "string"
          },
          "phoneNumber": {
            "description": "Destination number dialed.",
            "type": "string"
          },
          "status": {
            "enum": [
              "initiated",
              "connecting",
              "failed"
            ],
            "type": "string"
          },
          "voiceAgentId": {
            "description": "Voice agent configuration used for the call.",
            "type": "string"
          }
        },
        "required": [
          "callId",
          "status",
          "phoneNumber",
          "voiceAgentId",
          "initiatedAt"
        ],
        "type": "object"
      },
      "ParseSchedulingRequestDto": {
        "properties": {},
        "type": "object"
      },
      "PasswordResetDto": {
        "properties": {
          "newPassword": {
            "minLength": 8,
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PasswordResetRequestDto": {
        "properties": {
          "email": {
            "example": "owner@serviceagent.ai",
            "type": "string"
          },
          "resetUrl": {
            "example": "https://os.serviceagent.ai/reset-password",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PayoutScheduleDto": {
        "properties": {
          "delayDays": {
            "description": "Delay days for payouts",
            "example": "minimum",
            "type": "object"
          },
          "interval": {
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "manual"
            ],
            "example": "daily",
            "type": "string"
          },
          "monthlyAnchor": {
            "description": "Day of the month for monthly payouts",
            "example": 15,
            "type": "number"
          },
          "weeklyAnchor": {
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday"
            ],
            "example": "monday",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PayoutSettingsDto": {
        "properties": {
          "debitNegativeBalances": {
            "example": true,
            "type": "boolean"
          },
          "schedule": {
            "$ref": "#/components/schemas/PayoutScheduleDto"
          },
          "statementDescriptor": {
            "example": "SERVICEAGENT",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PersonDto": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/AddressDto"
          },
          "dateOfBirth": {
            "$ref": "#/components/schemas/DateOfBirthDto"
          },
          "director": {
            "example": false,
            "type": "boolean"
          },
          "email": {
            "example": "jane@example.com",
            "type": "string"
          },
          "executive": {
            "example": true,
            "type": "boolean"
          },
          "firstName": {
            "example": "Jane",
            "type": "string"
          },
          "lastName": {
            "example": "Doe",
            "type": "string"
          },
          "ownershipPercentage": {
            "example": 100,
            "type": "number"
          },
          "phone": {
            "example": "+15125551234",
            "type": "string"
          },
          "ssnLast4": {
            "example": "1234",
            "type": "string"
          },
          "title": {
            "example": "CEO",
            "type": "string"
          },
          "verificationDocumentBack": {
            "description": "Stripe file ID for document back",
            "type": "string"
          },
          "verificationDocumentFront": {
            "description": "Stripe file ID for document front",
            "type": "string"
          }
        },
        "required": [
          "firstName",
          "lastName"
        ],
        "type": "object"
      },
      "PostCallRuleActionDto": {
        "properties": {
          "actionId": {
            "description": "Catalog action id",
            "type": "string"
          },
          "id": {
            "description": "Stable per-rule action identifier. Assign when the UI wants to preserve optimistic-update keys across saves; omit to let the backend generate one.",
            "type": "string"
          },
          "params": {
            "description": "Per-action parameters keyed by param id.",
            "type": "object"
          }
        },
        "required": [
          "actionId"
        ],
        "type": "object"
      },
      "PostCallRuleConditionDto": {
        "properties": {
          "id": {
            "description": "Catalog condition id",
            "type": "string"
          },
          "params": {
            "description": "Per-condition parameters keyed by param id.",
            "type": "object"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "PostCallRuleDto": {
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/PostCallRuleActionDto"
            },
            "type": "array"
          },
          "condition": {
            "$ref": "#/components/schemas/PostCallRuleConditionDto"
          },
          "enabled": {
            "description": "When false, the rule exists but is paused. Defaults to true.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "condition",
          "actions"
        ],
        "type": "object"
      },
      "PredictiveAnalyticsDto": {
        "properties": {
          "acquisitionCost": {
            "description": "Acquisition cost",
            "example": 5000,
            "type": "number"
          },
          "confidence": {
            "description": "Prediction confidence metrics",
            "example": {
              "dataPoints": 12,
              "lastUpdated": "2024-01-15T10:00:00Z",
              "overall": 85
            },
            "type": "object"
          },
          "contactId": {
            "description": "Contact ID",
            "example": "cm123456789",
            "type": "string"
          },
          "estimatedDealSize": {
            "description": "Estimated deal size",
            "example": 50000,
            "type": "number"
          },
          "lifetimeValue": {
            "description": "Lifetime value",
            "example": 150000,
            "type": "number"
          },
          "likelihoodToBuy": {
            "description": "Likelihood to buy (0-100)",
            "example": 75,
            "type": "number"
          },
          "nextMilestone": {
            "description": "Next milestone",
            "example": "Technical evaluation",
            "type": "string"
          },
          "optimalContactChannel": {
            "description": "Optimal contact channel",
            "example": "PHONE",
            "type": "string"
          },
          "optimalContactTime": {
            "description": "Optimal contact time",
            "example": "Tuesday 2-4 PM",
            "type": "string"
          },
          "predictedChurnDate": {
            "description": "Predicted churn date",
            "example": null,
            "type": "string"
          }
        },
        "required": [
          "contactId",
          "likelihoodToBuy",
          "estimatedDealSize",
          "optimalContactTime",
          "optimalContactChannel",
          "nextMilestone",
          "predictedChurnDate",
          "lifetimeValue",
          "acquisitionCost",
          "confidence"
        ],
        "type": "object"
      },
      "PrefillAddressDto": {
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "raw": {
            "description": "If we only have an unstructured address string.",
            "type": "string"
          },
          "source": {
            "description": "Where this address was sourced from (org, NAP, location).",
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "street": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PreviewContactsImportDto": {
        "properties": {
          "customFieldMapping": {
            "description": "Optional mapping of CSV column index (0-based) to custom field key (e.g. {\"4\":\"lead_source\"})",
            "example": {
              "4": "lead_source",
              "5": "industry"
            },
            "type": "object"
          },
          "fileHandle": {
            "description": "Filestack handle returned from the analyze call",
            "example": "ABC123xyz",
            "type": "string"
          },
          "mapping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContactsImportMappingDto"
              }
            ],
            "description": "Field-to-column mapping selected by the user"
          }
        },
        "required": [
          "fileHandle",
          "mapping"
        ],
        "type": "object"
      },
      "PreviewVoicePromptDto": {
        "properties": {
          "callType": {
            "description": "Optional call-type override for the base prompt stack.",
            "enum": [
              "support",
              "sales",
              "general"
            ],
            "type": "string"
          },
          "direction": {
            "default": "inbound",
            "description": "Preview the prompt as if the call were inbound or outbound.",
            "enum": [
              "inbound",
              "outbound"
            ],
            "type": "string"
          },
          "handlingProfileMode": {
            "description": "Optional handling-profile mode override for the preview session contract.",
            "enum": [
              "inbound_category",
              "neutral_outbound",
              "custom_campaign"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PriorityOrderEntry": {
        "properties": {
          "id": {
            "description": "Priority ID",
            "type": "string"
          },
          "level": {
            "description": "New level/order (1 = highest)",
            "type": "number"
          }
        },
        "required": [
          "id",
          "level"
        ],
        "type": "object"
      },
      "ProcessMessageDto": {
        "properties": {
          "context": {
            "example": {
              "contextSummaryTarget": {
                "entityId": "contact-id-123",
                "entityType": "contact"
              },
              "conversationId": "conv-123",
              "userId": "user-456"
            },
            "type": "object"
          },
          "message": {
            "example": "I need to book an appointment for tomorrow",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "ProcurePhoneNumberDto": {
        "properties": {},
        "type": "object"
      },
      "ProviderLocationResponseDto": {
        "properties": {
          "accountName": {
            "description": "Provider account resource name for this location",
            "example": "accounts/123",
            "type": "string"
          },
          "address": {
            "description": "Formatted storefront address shown by the provider",
            "example": "10 Main St, Bridgewater, NJ, 08807, US",
            "type": "string"
          },
          "displayName": {
            "description": "Human-readable listing name for picker UI",
            "example": "Acme HVAC - Downtown",
            "type": "string"
          },
          "externalId": {
            "description": "Stable provider identifier to persist",
            "example": "accounts/123/locations/456",
            "type": "string"
          },
          "locationName": {
            "description": "Provider location resource name",
            "example": "locations/456",
            "type": "string"
          },
          "phone": {
            "description": "Primary phone shown by the provider",
            "example": "(908) 555-0199",
            "type": "string"
          },
          "provider": {
            "description": "Listings provider that owns this location",
            "example": "google_business",
            "type": "string"
          },
          "raw": {
            "description": "Raw provider payload for diagnostics and future UI fields",
            "example": {
              "name": "locations/456",
              "title": "Acme HVAC - Downtown"
            },
            "type": "object"
          },
          "website": {
            "description": "Website shown by the provider",
            "example": "https://acme.example",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "accountName",
          "locationName",
          "externalId",
          "displayName"
        ],
        "type": "object"
      },
      "ProvisionResendInboxDto": {
        "properties": {
          "domain": {
            "description": "Inbound domain. If omitted, backend uses RESEND_INBOUND_DOMAIN / RESEND_DOMAIN.",
            "example": "reply.serviceagent.ai",
            "type": "string"
          },
          "fromName": {
            "example": "Acme Service Team",
            "type": "string"
          },
          "isShared": {
            "default": false,
            "type": "boolean"
          },
          "localPart": {
            "description": "Email local-part for managed inbox. If omitted, defaults to inbox+<orgId>.",
            "example": "inbox+org_123",
            "type": "string"
          },
          "locationId": {
            "description": "Location to own this channel; defaults to active location context.",
            "type": "string"
          },
          "replyTo": {
            "example": "support@acme.com",
            "type": "string"
          },
          "resendApiKey": {
            "description": "Optional per-channel Resend API key override. If omitted, backend global RESEND_API_KEY is used.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicSurveyRespondFrontendDto": {
        "properties": {
          "answers": {
            "items": {
              "$ref": "#/components/schemas/FrontendSurveyAnswerDto"
            },
            "type": "array"
          },
          "comment": {
            "type": "string"
          },
          "sentiment": {
            "type": "string"
          }
        },
        "required": [
          "answers"
        ],
        "type": "object"
      },
      "PublishAdCampaignDto": {
        "properties": {
          "force": {
            "default": false,
            "description": "If true, skip certain validations (internal use only)",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "PublishSiteDto": {
        "properties": {
          "payload": {
            "description": "Extra metadata for provider integration.",
            "type": "object"
          },
          "previewOnly": {
            "default": false,
            "description": "Preview-only publish (does not mark site LIVE).",
            "type": "boolean"
          },
          "provider": {
            "description": "Publishing provider/cdn (e.g., vercel, cloudflare).",
            "type": "string"
          },
          "subdomain": {
            "description": "Subdomain (e.g., demo). Defaults to org slug on serviceagent.site",
            "type": "string"
          },
          "targetDomain": {
            "description": "Domain to publish to (e.g., example.com)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublishedSnapshotDto": {
        "properties": {
          "compiledHash": {
            "description": "Hash of the compiled prompt (content digest)",
            "type": "string"
          },
          "fullText": {
            "description": "Full compiled prompt text as published",
            "type": "string"
          },
          "scalars": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PublishedSnapshotScalarsDto"
              }
            ],
            "description": "Scalar projection of the published config"
          },
          "sections": {
            "description": "Section-level breakdown of the compiled prompt",
            "items": {
              "$ref": "#/components/schemas/PublishedSnapshotSectionDto"
            },
            "type": "array"
          }
        },
        "required": [
          "compiledHash",
          "fullText",
          "sections",
          "scalars"
        ],
        "type": "object"
      },
      "PublishedSnapshotScalarsDto": {
        "properties": {
          "handlingProfileCategory": {
            "description": "Resolved handling profile category",
            "type": "string"
          },
          "initialGreetingText": {
            "description": "Initial greeting text as spoken",
            "type": "string"
          },
          "name": {
            "description": "Voice agent display name",
            "type": "string"
          },
          "systemPrompt": {
            "description": "Raw system prompt as published",
            "type": "string"
          },
          "transferNumber": {
            "description": "Configured transfer number",
            "type": "string"
          },
          "voiceId": {
            "description": "Selected voice id (provider:voice)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublishedSnapshotSectionDto": {
        "properties": {
          "id": {
            "description": "Stable section id (e.g. \"identity\", \"faqs\")",
            "type": "string"
          },
          "text": {
            "description": "Rendered section text at publish time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "text"
        ],
        "type": "object"
      },
      "PurchaseCreditsDto": {
        "properties": {
          "credits": {
            "description": "Number of credits to purchase",
            "example": 500,
            "type": "number"
          },
          "customerEmail": {
            "example": "owner@business.com",
            "type": "string"
          },
          "customerName": {
            "example": "Jane Owner",
            "type": "string"
          },
          "paymentMethod": {
            "example": "credit_card",
            "type": "string"
          },
          "paymentMethodId": {
            "example": "pm_1234567890",
            "type": "string"
          }
        },
        "required": [
          "credits"
        ],
        "type": "object"
      },
      "PurchaseDomainDto": {
        "properties": {
          "domain": {
            "description": "The domain to purchase",
            "example": "example.com",
            "type": "string"
          },
          "expectedPriceCents": {
            "description": "The expected price in cents (for verification)",
            "example": 1500,
            "type": "number"
          },
          "paymentMethodId": {
            "description": "Stripe Payment Method ID",
            "example": "pm_123",
            "type": "string"
          },
          "siteId": {
            "description": "The ID of the site to attach this domain to",
            "example": "site_123",
            "type": "string"
          }
        },
        "required": [
          "domain",
          "siteId",
          "paymentMethodId",
          "expectedPriceCents"
        ],
        "type": "object"
      },
      "PushNotificationsDto": {
        "properties": {
          "deals": {
            "type": "boolean"
          },
          "messages": {
            "type": "boolean"
          },
          "tasks": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "QuickLaunchQuietHoursDto": {
        "properties": {
          "end": {
            "description": "24h end time (HH:mm)",
            "example": "08:00",
            "type": "string"
          },
          "start": {
            "description": "24h start time (HH:mm)",
            "example": "21:00",
            "type": "string"
          },
          "timezone": {
            "description": "IANA timezone identifier",
            "example": "America/Los_Angeles",
            "type": "string"
          }
        },
        "required": [
          "start",
          "end"
        ],
        "type": "object"
      },
      "QuietHoursDto": {
        "properties": {
          "enabled": {
            "example": true,
            "type": "boolean"
          },
          "endHour": {
            "description": "End hour in org timezone (0-23)",
            "example": 8,
            "type": "number"
          },
          "enforceManual": {
            "description": "When true, manual sends from Inbox composer are also blocked during quiet hours. Default false.",
            "example": false,
            "type": "boolean"
          },
          "startHour": {
            "description": "Start hour in org timezone (0-23)",
            "example": 21,
            "type": "number"
          }
        },
        "type": "object"
      },
      "RealtimeSessionRequestDto": {
        "properties": {
          "agentId": {
            "description": "Unified agent id (string). Numeric values will be coerced to string for compatibility.",
            "example": "agent_123",
            "type": "string"
          }
        },
        "required": [
          "agentId"
        ],
        "type": "object"
      },
      "RecentCallDto": {
        "properties": {
          "callId": {
            "description": "Internal call ID",
            "type": "string"
          },
          "contactAvatar": {
            "description": "Contact avatar URL",
            "type": "string"
          },
          "contactId": {
            "description": "Contact ID",
            "type": "string"
          },
          "contactName": {
            "description": "Contact name",
            "type": "string"
          },
          "createdAt": {
            "description": "Call created timestamp",
            "type": "string"
          },
          "direction": {
            "description": "Call direction",
            "type": "string"
          },
          "disposition": {
            "description": "Call disposition label",
            "type": "string"
          },
          "duration": {
            "description": "Call duration in seconds",
            "type": "number"
          },
          "endedAt": {
            "description": "Call ended timestamp",
            "type": "string"
          },
          "hasTranscript": {
            "description": "Whether transcript is available",
            "type": "boolean"
          },
          "notes": {
            "description": "Internal notes attached to the call",
            "type": "string"
          },
          "phoneNumber": {
            "description": "Phone number",
            "type": "string"
          },
          "providerCallId": {
            "description": "Provider Call ID (Twilio SID, FreeSWITCH UUID, etc.)",
            "type": "string"
          },
          "recordingUrl": {
            "description": "Recording URL",
            "type": "string"
          },
          "sentiment": {
            "description": "Call sentiment",
            "type": "string"
          },
          "status": {
            "description": "Call status",
            "type": "string"
          },
          "tags": {
            "description": "Tags applied to the call",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "threadId": {
            "description": "Inbox thread ID associated with this call",
            "type": "string"
          },
          "voicemailDropId": {
            "description": "Voicemail drop used for this call",
            "type": "string"
          }
        },
        "required": [
          "callId",
          "phoneNumber",
          "duration",
          "status",
          "direction",
          "hasTranscript",
          "createdAt"
        ],
        "type": "object"
      },
      "RecentCallsResponseDto": {
        "properties": {
          "calls": {
            "items": {
              "$ref": "#/components/schemas/RecentCallDto"
            },
            "type": "array"
          },
          "pagination": {
            "description": "Pagination info",
            "type": "object"
          }
        },
        "required": [
          "calls",
          "pagination"
        ],
        "type": "object"
      },
      "RecordAssetMovementDto": {
        "properties": {
          "fromLocationId": {
            "description": "Location the asset is moving from.",
            "type": "string"
          },
          "metadata": {
            "description": "Arbitrary metadata payload.",
            "type": "object"
          },
          "movementType": {
            "enum": [
              "ADDED",
              "REMOVED",
              "CONSUMED",
              "ADJUSTED",
              "TRANSFERRED"
            ],
            "type": "string"
          },
          "note": {
            "description": "Notes or reason for the movement.",
            "maxLength": 500,
            "type": "string"
          },
          "occurredAt": {
            "description": "Optional timestamp override (ISO date). Defaults to now.",
            "type": "string"
          },
          "quantityDelta": {
            "description": "Quantity delta to apply. Positive numbers add inventory, negative numbers remove.",
            "example": 2,
            "type": "number"
          },
          "referenceId": {
            "description": "External reference id.",
            "type": "string"
          },
          "referenceType": {
            "description": "External reference type (e.g., WORK_ORDER, PURCHASE_ORDER).",
            "type": "string"
          },
          "toLocationId": {
            "description": "Destination location (required for transfers).",
            "type": "string"
          }
        },
        "required": [
          "movementType",
          "quantityDelta"
        ],
        "type": "object"
      },
      "RecurrenceRuleDto": {
        "properties": {
          "count": {
            "description": "Total number of occurrences (including the original appointment). Mutually inclusive with `until`.",
            "example": 6,
            "maximum": 52,
            "minimum": 1,
            "type": "number"
          },
          "frequency": {
            "description": "How often the appointment should repeat. Lowercase variants are accepted and uppercased server-side.",
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY"
            ],
            "example": "WEEKLY",
            "type": "string"
          },
          "interval": {
            "description": "Spacing between occurrences in `frequency` units (e.g. `interval: 2` with `frequency: WEEKLY` = every other week). Defaults to 1.",
            "example": 1,
            "maximum": 52,
            "minimum": 1,
            "type": "number"
          },
          "until": {
            "description": "ISO 8601 datetime after which no further occurrences are generated. The engine stops generating once the next end-time would exceed this.",
            "example": "2026-12-31T23:59:59Z",
            "type": "string"
          }
        },
        "required": [
          "frequency"
        ],
        "type": "object"
      },
      "RedeemReferralDto": {
        "properties": {
          "amountCents": {
            "description": "Amount to redeem in cents",
            "example": 2500,
            "type": "number"
          },
          "contactId": {
            "description": "Contact receiving the redemption",
            "type": "string"
          },
          "note": {
            "description": "Optional note or purpose for the redemption",
            "type": "string"
          }
        },
        "required": [
          "contactId",
          "amountCents"
        ],
        "type": "object"
      },
      "RefineWorkflowWithAiDto": {
        "properties": {
          "context": {
            "$ref": "#/components/schemas/WorkflowAiGenerateContextDto"
          },
          "conversationHistory": {
            "items": {
              "$ref": "#/components/schemas/WorkflowAiConversationMessageDto"
            },
            "type": "array"
          },
          "currentWorkflow": {
            "$ref": "#/components/schemas/WorkflowGraphPayloadDto"
          },
          "refinement": {
            "example": "Also add an email reminder and skip if appointment is cancelled",
            "type": "string"
          }
        },
        "required": [
          "currentWorkflow",
          "refinement"
        ],
        "type": "object"
      },
      "RefreshTokenDto": {
        "properties": {
          "refreshToken": {
            "description": "Long-lived refresh token returned by login/register responses.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RegenerateBlockDto": {
        "properties": {
          "contextOverrides": {
            "description": "Optional highlight or theme overrides",
            "type": "object"
          },
          "instructions": {
            "description": "Instructions for the AI (tone tweaks, new offers, etc.)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RegisterClientDto": {
        "properties": {
          "client_name": {
            "description": "Client name",
            "example": "OpenAI Custom Action",
            "type": "string"
          },
          "client_uri": {
            "description": "Client URI",
            "example": "https://chat.openai.com",
            "type": "string"
          },
          "grant_types": {
            "description": "Grant types",
            "example": [
              "authorization_code"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "initial_access_token": {
            "description": "Initial access token (if required)",
            "type": "string"
          },
          "redirect_uris": {
            "description": "Redirect URIs",
            "example": [
              "https://chat.openai.com/aip/g-xxx/oauth/callback"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "response_types": {
            "description": "Response types",
            "example": [
              "code"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "scope": {
            "description": "Scopes (space-separated)",
            "example": "crm:* appointments:* leads:*",
            "type": "string"
          },
          "token_endpoint_auth_method": {
            "description": "Token endpoint authentication method",
            "example": "client_secret_post",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RegisterDeveloperDto": {
        "properties": {
          "company": {
            "example": "Acme Integrations",
            "type": "string"
          },
          "email": {
            "example": "dev@example.com",
            "type": "string"
          },
          "name": {
            "example": "Jane Dev",
            "type": "string"
          }
        },
        "required": [
          "email",
          "name"
        ],
        "type": "object"
      },
      "ReorderBlocksDto": {
        "properties": {
          "blocks": {
            "items": {
              "$ref": "#/components/schemas/BlockOrderEntry"
            },
            "type": "array"
          }
        },
        "required": [
          "blocks"
        ],
        "type": "object"
      },
      "ReorderPrioritiesDto": {
        "properties": {
          "priorities": {
            "description": "Array of priority IDs with their new levels",
            "items": {
              "$ref": "#/components/schemas/PriorityOrderEntry"
            },
            "type": "array"
          }
        },
        "required": [
          "priorities"
        ],
        "type": "object"
      },
      "ReplacePostCallRulesDto": {
        "properties": {
          "rules": {
            "description": "The full set of rules for this agent. Replaces any existing rules — this is a PUT, not a PATCH.",
            "items": {
              "$ref": "#/components/schemas/PostCallRuleDto"
            },
            "type": "array"
          }
        },
        "required": [
          "rules"
        ],
        "type": "object"
      },
      "RescheduleSurveyInvitationDto": {
        "properties": {
          "sendAt": {
            "description": "ISO timestamp for new send time",
            "type": "string"
          }
        },
        "required": [
          "sendAt"
        ],
        "type": "object"
      },
      "ResetPasswordDto": {
        "properties": {
          "newPassword": {
            "example": "S3cureP@ssw0rd",
            "type": "string"
          },
          "resetUrl": {
            "example": "https://os.serviceagent.ai/reset-password",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ResolveImportReviewDecisionDto": {
        "properties": {
          "action": {
            "enum": [
              "MERGE",
              "CREATE_NEW",
              "IGNORE"
            ],
            "type": "string"
          },
          "contactId": {
            "description": "Target contactId for MERGE action",
            "example": "cuid_contact_id",
            "type": "string"
          },
          "row": {
            "description": "CSV row number (as shown in preview)",
            "example": 12,
            "type": "number"
          }
        },
        "required": [
          "row",
          "action"
        ],
        "type": "object"
      },
      "ResolveImportReviewTaskDto": {
        "properties": {
          "closeTask": {
            "description": "If true, mark the review task DONE when all candidates are resolved.",
            "example": true,
            "type": "boolean"
          },
          "decisions": {
            "items": {
              "$ref": "#/components/schemas/ResolveImportReviewDecisionDto"
            },
            "type": "array"
          }
        },
        "required": [
          "decisions"
        ],
        "type": "object"
      },
      "ResolveNapChangeDto": {
        "properties": {
          "notes": {
            "example": "Updated Google listing to match CRM address",
            "type": "string"
          },
          "resolutionType": {
            "description": "How the inconsistency was resolved (e.g., provider_update, canonical_update, manual_confirmation).",
            "example": "provider_update",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RetellWebhookDto": {
        "properties": {},
        "type": "object"
      },
      "RetryWorkflowRunDto": {
        "properties": {
          "baseDelaySeconds": {
            "description": "Override base backoff seconds",
            "example": 60,
            "type": "number"
          },
          "maxRetries": {
            "description": "Override max retries for this request",
            "example": 3,
            "type": "number"
          }
        },
        "type": "object"
      },
      "ReviewCommentDto": {
        "properties": {
          "authorId": {
            "example": "usr_123",
            "type": "string"
          },
          "body": {
            "example": "Called customer, offered re-service tomorrow.",
            "type": "string"
          },
          "createdAt": {
            "example": "2025-01-21T10:15:00.000Z",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "example": "mrc_123",
            "type": "string"
          },
          "metadata": {
            "example": {
              "channel": "phone"
            },
            "type": "object"
          },
          "reviewId": {
            "example": "mrev_123",
            "type": "string"
          },
          "updatedAt": {
            "example": "2025-01-21T10:30:00.000Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "reviewId",
          "authorId",
          "body",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "ReviewInboxItemDto": {
        "properties": {
          "assignedToId": {
            "example": "usr_123",
            "type": "string"
          },
          "authorName": {
            "example": "Jane Doe",
            "type": "string"
          },
          "authorUrl": {
            "example": "https://maps.google.com/?cid=123",
            "type": "string"
          },
          "body": {
            "example": "Technician arrived on time and fixed the issue quickly.",
            "type": "string"
          },
          "commentCount": {
            "example": 2,
            "type": "number"
          },
          "createdAt": {
            "example": "2025-01-21T10:15:00.000Z",
            "format": "date-time",
            "type": "string"
          },
          "externalReviewId": {
            "example": "accounts/123/locations/456/reviews/789",
            "type": "string"
          },
          "externalUrl": {
            "description": "Deep-link to the review on the platform if available (for manual reply flow)",
            "example": "https://www.yelp.com/biz/xyz#reviews",
            "type": "string"
          },
          "id": {
            "example": "mrev_123",
            "type": "string"
          },
          "lastViewedAt": {
            "example": "2025-12-24T12:34:56.000Z",
            "format": "date-time",
            "type": "string"
          },
          "listingConnectionId": {
            "example": "mlc_123",
            "type": "string"
          },
          "locationId": {
            "example": "loc_123",
            "type": "string"
          },
          "metadata": {
            "example": {
              "aiSuggestedReply": {
                "text": "..."
              }
            },
            "type": "object"
          },
          "postedAt": {
            "example": "2025-01-20T15:04:23.000Z",
            "format": "date-time",
            "type": "string"
          },
          "rating": {
            "example": 5,
            "type": "number"
          },
          "repliedAt": {
            "example": "2025-01-22T11:00:00.000Z",
            "format": "date-time",
            "type": "string"
          },
          "replyText": {
            "example": "Thank you for the great feedback!",
            "type": "string"
          },
          "reviewRequestId": {
            "example": "mrr_123",
            "type": "string"
          },
          "sentiment": {
            "enum": [
              "positive",
              "neutral",
              "negative"
            ],
            "example": "positive",
            "type": "string"
          },
          "source": {
            "example": "google",
            "type": "string"
          },
          "title": {
            "example": "Excellent service",
            "type": "string"
          },
          "updatedAt": {
            "example": "2025-01-21T10:30:00.000Z",
            "format": "date-time",
            "type": "string"
          },
          "workflowStatus": {
            "enum": [
              "new",
              "needs_response",
              "responded",
              "resolved"
            ],
            "example": "needs_response",
            "type": "string"
          }
        },
        "required": [
          "id",
          "source",
          "workflowStatus",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "ReviewMetricsDto": {
        "properties": {
          "averageRating": {
            "example": 4.6,
            "nullable": true,
            "type": "number"
          },
          "mostRecentReviewAt": {
            "example": "2025-01-25T16:42:10.000Z",
            "nullable": true,
            "type": "string"
          },
          "negativeCount": {
            "example": 38,
            "type": "number"
          },
          "neutralCount": {
            "example": 38,
            "type": "number"
          },
          "positiveCount": {
            "example": 52,
            "type": "number"
          },
          "ratingDistribution": {
            "description": "Distribution of reviews across the 1-5 star scale. Always returns all five keys (zeros when no reviews of that rating exist) so the frontend can render the histogram without gap-handling.",
            "example": {
              "1": 4,
              "2": 2,
              "3": 8,
              "4": 18,
              "5": 96
            },
            "type": "object"
          },
          "sources": {
            "description": "Per-provider review counts. Keys correspond to the listing provider enum (google, yelp, facebook, etc); only providers with at least one review appear.",
            "example": {
              "facebook": 12,
              "google": 80,
              "yelp": 24
            },
            "type": "object"
          },
          "total": {
            "example": 128,
            "type": "number"
          },
          "withReplies": {
            "example": 70,
            "type": "number"
          },
          "withoutReplies": {
            "example": 58,
            "type": "number"
          }
        },
        "required": [
          "total",
          "averageRating",
          "positiveCount",
          "neutralCount",
          "negativeCount",
          "withReplies",
          "withoutReplies",
          "mostRecentReviewAt",
          "ratingDistribution",
          "sources"
        ],
        "type": "object"
      },
      "ReviewProviderDto": {
        "properties": {
          "displayName": {
            "example": "Google",
            "type": "string"
          },
          "key": {
            "example": "google",
            "type": "string"
          },
          "supportsIngestion": {
            "description": "Whether we can ingest reviews via an integration connection",
            "type": "boolean"
          },
          "supportsManualReply": {
            "default": true,
            "description": "Whether manual reply flow is supported (copy/paste + deep-link)",
            "type": "boolean"
          },
          "supportsReplyPublishing": {
            "description": "Whether we can publish replies via API (if false, use manual reply flow)",
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "displayName",
          "supportsIngestion",
          "supportsReplyPublishing",
          "supportsManualReply"
        ],
        "type": "object"
      },
      "ReviewRequestContactDto": {
        "properties": {
          "consentStatus": {
            "example": {
              "call": "unknown",
              "email": "unknown",
              "marketing": "unknown",
              "sms": "unknown"
            },
            "type": "object"
          },
          "email": {
            "example": "jane@example.com",
            "type": "string"
          },
          "firstName": {
            "example": "Jane",
            "type": "string"
          },
          "id": {
            "example": "contact_123",
            "type": "string"
          },
          "lastName": {
            "example": "Doe",
            "type": "string"
          },
          "phone": {
            "example": "15555550123",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "ReviewRequestLocationDto": {
        "properties": {
          "id": {
            "example": "loc_123",
            "type": "string"
          },
          "name": {
            "example": "Main Office",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "ReviewRequestMessageDto": {
        "properties": {
          "emailBody": {
            "example": "<p>We value your feedback...</p>",
            "type": "string"
          },
          "emailSubject": {
            "example": "How did we do?",
            "type": "string"
          },
          "reviewUrl": {
            "example": "https://example.com/review",
            "type": "string"
          },
          "smsBody": {
            "example": "Thanks for choosing us! Leave a review: https://example.com/review",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReviewRequestResponseDto": {
        "properties": {
          "appointmentId": {
            "example": "appt_123",
            "type": "string"
          },
          "channel": {
            "enum": [
              "email",
              "sms"
            ],
            "example": "email",
            "type": "string"
          },
          "clickedAt": {
            "example": "2025-01-21T10:07:00.000Z",
            "type": "string"
          },
          "contact": {
            "$ref": "#/components/schemas/ReviewRequestContactDto"
          },
          "contactEmail": {
            "example": "jane@example.com",
            "type": "string"
          },
          "contactId": {
            "example": "contact_123",
            "type": "string"
          },
          "contactName": {
            "example": "Jane Doe",
            "type": "string"
          },
          "createdAt": {
            "example": "2025-01-21T09:55:00.000Z",
            "type": "string"
          },
          "errorMessage": {
            "example": "Contact does not have email address",
            "type": "string"
          },
          "id": {
            "example": "mrr_123",
            "type": "string"
          },
          "internalStatus": {
            "description": "Internal status (back-compat)",
            "enum": [
              "queued",
              "sending",
              "sent",
              "failed"
            ],
            "example": "queued",
            "type": "string"
          },
          "jobId": {
            "example": "job_123",
            "type": "string"
          },
          "location": {
            "$ref": "#/components/schemas/ReviewRequestLocationDto"
          },
          "locationId": {
            "example": "loc_123",
            "type": "string"
          },
          "metadata": {
            "example": {
              "settings": {
                "mode": "manual"
              }
            },
            "type": "object"
          },
          "openedAt": {
            "example": "2025-01-21T10:06:00.000Z",
            "type": "string"
          },
          "rating": {
            "example": 5,
            "type": "number"
          },
          "responseReceivedAt": {
            "example": "2025-01-22T12:00:00.000Z",
            "type": "string"
          },
          "responseStatus": {
            "example": "DELIVERED",
            "type": "string"
          },
          "reviewedAt": {
            "example": "2025-01-22T12:00:00.000Z",
            "type": "string"
          },
          "sendAfter": {
            "example": "2025-01-21T10:00:00.000Z",
            "type": "string"
          },
          "sentAt": {
            "example": "2025-01-21T10:05:00.000Z",
            "type": "string"
          },
          "specStatus": {
            "description": "Deprecated; use `status`",
            "enum": [
              "pending",
              "sent",
              "opened",
              "clicked",
              "reviewed",
              "failed"
            ],
            "example": "pending",
            "type": "string"
          },
          "status": {
            "description": "Spec status (Marketing Suite frontend)",
            "enum": [
              "pending",
              "sent",
              "opened",
              "clicked",
              "reviewed",
              "failed"
            ],
            "example": "pending",
            "type": "string"
          },
          "triggerType": {
            "example": "manual",
            "type": "string"
          },
          "updatedAt": {
            "example": "2025-01-21T09:55:00.000Z",
            "type": "string"
          }
        },
        "required": [
          "id",
          "channel",
          "status"
        ],
        "type": "object"
      },
      "ReviewResponseDto": {
        "properties": {
          "authorName": {
            "example": "Jane Doe",
            "type": "string"
          },
          "authorUrl": {
            "example": "https://maps.google.com/?cid=123",
            "type": "string"
          },
          "body": {
            "example": "Technician arrived on time and fixed the issue quickly.",
            "type": "string"
          },
          "createdAt": {
            "example": "2025-01-21T10:15:00.000Z",
            "format": "date-time",
            "type": "string"
          },
          "externalReviewId": {
            "example": "accounts/123/locations/456/reviews/789",
            "type": "string"
          },
          "id": {
            "example": "mrev_123",
            "type": "string"
          },
          "listingConnectionId": {
            "example": "mlc_123",
            "type": "string"
          },
          "locationId": {
            "example": "loc_123",
            "type": "string"
          },
          "metadata": {
            "example": {
              "aiSuggestedReply": {
                "text": "Thanks!"
              }
            },
            "type": "object"
          },
          "postedAt": {
            "example": "2025-01-20T15:04:23.000Z",
            "format": "date-time",
            "type": "string"
          },
          "provider": {
            "enum": [
              "google_business",
              "yelp",
              "facebook",
              "apple_maps",
              "bing",
              "trustpilot"
            ],
            "example": "google",
            "type": "string"
          },
          "rating": {
            "example": 5,
            "type": "number"
          },
          "repliedAt": {
            "example": "2025-01-22T11:00:00.000Z",
            "format": "date-time",
            "type": "string"
          },
          "replyText": {
            "example": "Thank you for the great feedback!",
            "type": "string"
          },
          "reviewRequestId": {
            "example": "mrr_123",
            "type": "string"
          },
          "sentiment": {
            "enum": [
              "positive",
              "neutral",
              "negative"
            ],
            "example": "positive",
            "type": "string"
          },
          "title": {
            "example": "Excellent service",
            "type": "string"
          },
          "updatedAt": {
            "example": "2025-01-21T10:30:00.000Z",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider",
          "listingConnectionId",
          "rating",
          "postedAt",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "ReviewSettingsDto": {
        "properties": {
          "autoTrigger": {
            "default": "appointment_completed",
            "enum": [
              "appointment_completed",
              "job_completed"
            ],
            "type": "string"
          },
          "autoTriggers": {
            "description": "Auto trigger toggles (spec field)",
            "example": {
              "afterAppointment": true,
              "afterInvoicePaid": false
            },
            "type": "object"
          },
          "channels": {
            "default": [
              "email"
            ],
            "items": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "delayHours": {
            "description": "Delay before sending, in hours (spec field)",
            "example": 0,
            "type": "number"
          },
          "delayMinutes": {
            "description": "Delay before sending, in minutes",
            "example": 0,
            "type": "number"
          },
          "emailTemplateId": {
            "description": "Email template ID to use for review requests",
            "type": "string"
          },
          "fromEmail": {
            "description": "Fallback from-email address",
            "type": "string"
          },
          "fromPhone": {
            "description": "Fallback from-phone number in E.164 format",
            "type": "string"
          },
          "mode": {
            "default": "manual",
            "enum": [
              "manual",
              "auto"
            ],
            "type": "string"
          },
          "reviewUrl": {
            "description": "Primary review URL to include in messages",
            "type": "string"
          },
          "smsTemplateId": {
            "description": "SMS template ID or campaign identifier",
            "type": "string"
          },
          "template": {
            "description": "Default template (spec field)",
            "example": {
              "body": "<p>We value your feedback...</p>",
              "subject": "How did we do?"
            },
            "type": "object"
          }
        },
        "required": [
          "mode",
          "channels"
        ],
        "type": "object"
      },
      "ReviewTemplateOverrideDto": {
        "properties": {
          "body": {
            "example": "<p>We value your feedback...</p>",
            "type": "string"
          },
          "subject": {
            "example": "How did we do?",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ScrapeGbpDto": {
        "properties": {
          "gbpUrl": {
            "example": "https://maps.google.com/?cid=12345678901234567890",
            "type": "string"
          }
        },
        "required": [
          "gbpUrl"
        ],
        "type": "object"
      },
      "ScrapeWebsiteDto": {
        "properties": {
          "websiteUrl": {
            "example": "https://coolingprosllc.com",
            "type": "string"
          }
        },
        "required": [
          "websiteUrl"
        ],
        "type": "object"
      },
      "SelectProviderLocationDto": {
        "properties": {
          "displayName": {
            "description": "Optional display name to store with the selected listing",
            "example": "Acme HVAC - Downtown",
            "type": "string"
          },
          "externalId": {
            "description": "Selected provider listing identifier returned by the provider-locations endpoint",
            "example": "accounts/123/locations/456",
            "type": "string"
          },
          "syncAfterSelection": {
            "default": true,
            "description": "When true, queue a listing sync immediately after saving the selection",
            "example": true,
            "type": "boolean"
          }
        },
        "required": [
          "externalId"
        ],
        "type": "object"
      },
      "SendAgentMessageDto": {
        "properties": {},
        "type": "object"
      },
      "SendBulkEmailDto": {
        "properties": {
          "bodyHtml": {
            "description": "Inline email body HTML (required when not using template)",
            "example": "<p>Special offer for {{contact.firstName}}</p>",
            "type": "string"
          },
          "filter": {
            "description": "Filter criteria for selecting recipients",
            "example": {
              "industry": "legal",
              "lastActivityDate": {
                "gte": "2024-01-01"
              }
            },
            "type": "object"
          },
          "recipientIds": {
            "description": "Array of contact IDs to send to",
            "example": [
              "contact-uuid-1",
              "contact-uuid-2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "subject": {
            "description": "Email subject with template variables (required when not using template)",
            "example": "{{contact.firstName}}, your property match",
            "type": "string"
          },
          "templateId": {
            "description": "Email template ID",
            "example": "template-uuid-123",
            "type": "string"
          },
          "trackClicks": {
            "default": true,
            "description": "Enable click tracking",
            "example": true,
            "type": "boolean"
          },
          "trackOpens": {
            "default": true,
            "description": "Enable open tracking",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SendEmailCampaignDto": {
        "properties": {
          "scheduledAt": {
            "description": "If provided and in the future, campaign will be scheduled",
            "example": "2025-01-01T12:00:00.000Z",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SendEmailDto": {
        "properties": {
          "attachmentIds": {
            "description": "Uploaded attachment IDs (e.g. Filestack handles).",
            "example": [
              "A1B2C3D4"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "attachmentUrls": {
            "description": "Uploaded attachment file URLs (e.g. Filestack CDN URLs)",
            "example": [
              "https://cdn.example.com/file.pdf"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "body": {
            "description": "Email body in HTML format",
            "example": "<h1>Hello {{contact.firstName}}</h1><p>This is your case update...</p>",
            "type": "string"
          },
          "bodyFormat": {
            "default": "markdown",
            "description": "Format of the provided body content",
            "enum": [
              "markdown",
              "plain",
              "html"
            ],
            "example": "markdown",
            "type": "string"
          },
          "campaignId": {
            "description": "Email campaign ID for tracking (optional)",
            "example": "campaign-uuid-123",
            "type": "string"
          },
          "companyId": {
            "description": "Company ID for tracking (optional)",
            "example": "company-uuid-123",
            "type": "string"
          },
          "contactId": {
            "description": "Contact ID for tracking (optional)",
            "example": "contact-uuid-123",
            "type": "string"
          },
          "dealId": {
            "description": "Deal ID for tracking (optional)",
            "example": "deal-uuid-123",
            "type": "string"
          },
          "sendAt": {
            "description": "Schedule email for future delivery (ISO 8601)",
            "example": "2025-10-20T10:00:00Z",
            "type": "string"
          },
          "subject": {
            "description": "Email subject",
            "example": "Your case update",
            "type": "string"
          },
          "templateId": {
            "description": "Email template ID (optional)",
            "example": "template-uuid-123",
            "type": "string"
          },
          "to": {
            "description": "Recipient email address",
            "example": "client@example.com",
            "type": "string"
          },
          "trackClicks": {
            "default": true,
            "description": "Enable click tracking",
            "example": true,
            "type": "boolean"
          },
          "trackOpens": {
            "default": true,
            "description": "Enable open tracking",
            "example": true,
            "type": "boolean"
          }
        },
        "required": [
          "to",
          "subject",
          "body"
        ],
        "type": "object"
      },
      "SendMagicLinkDto": {
        "properties": {
          "email": {
            "description": "Email address to send magic link to",
            "example": "customer@example.com",
            "type": "string"
          },
          "organizationId": {
            "description": "Optional organization ID to scope contact lookup",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "SendMessageDto": {
        "properties": {
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/OutboundAttachmentDto"
            },
            "type": "array"
          },
          "bcc": {
            "example": [
              "bcc@example.com"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cc": {
            "example": [
              "cc@example.com"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "channelId": {
            "description": "Send-from identity (must match thread channel for replies)",
            "example": "channel-id",
            "type": "string"
          },
          "contactId": {
            "description": "Start a new thread to a contact (mutually exclusive with threadId)",
            "example": "contact-id",
            "type": "string"
          },
          "content": {
            "example": "Hello, this is your service provider.",
            "type": "string"
          },
          "scheduledAt": {
            "example": "2026-03-02T14:30:00Z",
            "type": "string"
          },
          "subject": {
            "example": "Re: Your inquiry",
            "type": "string"
          },
          "threadId": {
            "description": "Reply to an existing thread (mutually exclusive with contactId)",
            "example": "thread-id",
            "type": "string"
          },
          "type": {
            "enum": [
              "SMS",
              "EMAIL",
              "WHATSAPP",
              "TELEGRAM",
              "WIDGET"
            ],
            "example": "SMS",
            "type": "string"
          }
        },
        "required": [
          "channelId",
          "type",
          "content"
        ],
        "type": "object"
      },
      "SendRoiReportDto": {
        "properties": {},
        "type": "object"
      },
      "SendTeamMessageDto": {
        "properties": {
          "content": {
            "example": "Hello team!",
            "type": "string"
          },
          "fileIds": {
            "example": [
              "fileId1",
              "fileId2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "linkedEntityId": {
            "example": "dealId",
            "type": "string"
          },
          "linkedEntityType": {
            "example": "deal",
            "type": "string"
          },
          "mentions": {
            "example": [
              "userId1",
              "userId2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "messageType": {
            "default": "TEXT",
            "enum": [
              "TEXT",
              "FILE",
              "IMAGE",
              "STATUS_UPDATE",
              "SYSTEM"
            ],
            "type": "string"
          },
          "parentMessageId": {
            "example": null,
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "SendWidgetMessageDto": {
        "properties": {},
        "type": "object"
      },
      "ServiceAreaCenterDto": {
        "properties": {
          "lat": {
            "example": 40.5942,
            "type": "number"
          },
          "lng": {
            "example": -74.5547,
            "type": "number"
          }
        },
        "required": [
          "lat",
          "lng"
        ],
        "type": "object"
      },
      "ServiceAreaInputDto": {
        "properties": {
          "center": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ServiceAreaCenterDto"
              }
            ],
            "description": "Pre-resolved center coordinates. Required when `centerAddress` is not provided. Skips geocoding."
          },
          "centerAddress": {
            "description": "Operator-supplied center address. Geocoded at create time. Required when `center` coords are not provided.",
            "example": "123 Main St, Bridgewater NJ 08807",
            "type": "string"
          },
          "radiusMiles": {
            "description": "Radius in miles. Clamped to [1, 100] by the service.",
            "example": 15,
            "type": "number"
          }
        },
        "required": [
          "radiusMiles"
        ],
        "type": "object"
      },
      "SetLocationStaffDto": {
        "properties": {
          "primaryStaffId": {
            "description": "Optional staff ID or same-org user ID to mark as primary for this location",
            "example": "staff_1",
            "type": "string"
          },
          "staffIds": {
            "description": "Staff IDs, or same-org user IDs that should be promoted to staff, assigned to this location",
            "example": [
              "staff_1",
              "user_1"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "staffIds"
        ],
        "type": "object"
      },
      "SetPasswordDto": {
        "properties": {
          "password": {
            "example": "SecureP@ssw0rd!",
            "minLength": 8,
            "type": "string"
          },
          "token": {
            "example": "your-secure-token-here",
            "type": "string"
          }
        },
        "required": [
          "token",
          "password"
        ],
        "type": "object"
      },
      "SetWorkingHoursDto": {
        "properties": {
          "workingHours": {
            "items": {
              "$ref": "#/components/schemas/WorkingHourDto"
            },
            "type": "array"
          }
        },
        "required": [
          "workingHours"
        ],
        "type": "object"
      },
      "SettingsDto": {
        "properties": {
          "payouts": {
            "$ref": "#/components/schemas/PayoutSettingsDto"
          }
        },
        "type": "object"
      },
      "ShareProjectMagicLinkDto": {
        "properties": {},
        "type": "object"
      },
      "SipTrunkInputDto": {
        "properties": {
          "gateway": {
            "description": "Named gateway on FreeSWITCH if pre-configured",
            "type": "string"
          },
          "host": {
            "example": "sip.telnyx.com",
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SipTrunkSummaryDto": {
        "properties": {
          "gateway": {
            "type": "string"
          },
          "hasPassword": {
            "description": "Always masked, true if a password is configured",
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SiteAnalyticsEventDto": {
        "properties": {
          "eventType": {
            "description": "Event type identifier",
            "type": "string"
          },
          "metadata": {
            "description": "Event metadata payload",
            "type": "object"
          },
          "siteId": {
            "description": "Associated site ID",
            "type": "string"
          },
          "timestamp": {
            "description": "ISO timestamp for the event",
            "type": "string"
          }
        },
        "required": [
          "eventType",
          "timestamp"
        ],
        "type": "object"
      },
      "SmsA2pEndUserInputDto": {
        "properties": {
          "assignTo": {
            "description": "Which bundles to assign this end-user to. Defaults to BOTH bundles when omitted.",
            "example": [
              "CUSTOMER_PROFILE",
              "A2P_PROFILE"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "attributes": {
            "description": "Attributes object for the selected end user type. Keys/shape depend on Twilio end user type fields.",
            "type": "object"
          },
          "friendlyName": {
            "example": "Acme Heating & Air - Business",
            "type": "string"
          },
          "type": {
            "description": "Twilio TrustHub end user type. Common values include 'business' or 'individual'. Use the end-user-types endpoint to discover what's available.",
            "example": "business",
            "type": "string"
          }
        },
        "required": [
          "friendlyName",
          "type",
          "attributes"
        ],
        "type": "object"
      },
      "SmsA2pSubmitBrandDto": {
        "properties": {
          "a2pProfileEmail": {
            "description": "Optional separate email for A2P profile bundle creation notifications.",
            "example": "owner@acme.com",
            "type": "string"
          },
          "a2pProfilePolicySid": {
            "description": "TrustHub policy SID for the A2P Messaging Profile bundle.",
            "example": "RNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "type": "string"
          },
          "brandType": {
            "description": "Brand type. STANDARD recommended for most use cases. SOLE_PROPRIETOR is low-volume and more restrictive.",
            "example": "STANDARD",
            "type": "string"
          },
          "customerProfileEmail": {
            "description": "Email used for TrustHub bundle creation notifications.",
            "example": "owner@acme.com",
            "type": "string"
          },
          "customerProfilePolicySid": {
            "description": "TrustHub policy SID for the Customer Profile bundle.",
            "example": "RNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "type": "string"
          },
          "endUsers": {
            "description": "One or more TrustHub End Users to attach to the created TrustHub bundles. For best results include a business end-user and an authorized representative end-user when applicable.",
            "items": {
              "$ref": "#/components/schemas/SmsA2pEndUserInputDto"
            },
            "type": "array"
          },
          "mock": {
            "default": false,
            "description": "Create as a mock brand (testing only).",
            "type": "boolean"
          },
          "skipAutomaticSecVet": {
            "description": "Disable automatic secondary vetting (advanced).",
            "type": "boolean"
          }
        },
        "required": [
          "customerProfilePolicySid",
          "a2pProfilePolicySid",
          "customerProfileEmail",
          "endUsers"
        ],
        "type": "object"
      },
      "SmsA2pSubmitCampaignDto": {
        "properties": {
          "ageGated": {
            "default": false,
            "type": "boolean"
          },
          "description": {
            "description": "A short description of what this SMS campaign does (Twilio requires min 40 chars).",
            "example": "We send appointment reminders and customer support updates to customers who have opted in via our website/booking flow.",
            "type": "string"
          },
          "directLending": {
            "default": false,
            "type": "boolean"
          },
          "hasEmbeddedLinks": {
            "example": false,
            "type": "boolean"
          },
          "hasEmbeddedPhone": {
            "example": true,
            "type": "boolean"
          },
          "helpKeywords": {
            "example": [
              "HELP"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "helpMessage": {
            "description": "If managing help keywords yourself, provide the help message.",
            "example": "Acme: For help call 555-0123 or email support@acme.com. Reply STOP to opt out.",
            "type": "string"
          },
          "messageFlow": {
            "description": "Message flow / opt-in description (Twilio requires min 40 chars). Explain how users opt in and what they receive.",
            "example": "Customers opt in by checking a consent box on our booking form and by texting START to our business number. We send reminders and service updates.",
            "type": "string"
          },
          "messageSamples": {
            "description": "2–5 sample message strings (Twilio requires min 2).",
            "example": [
              "Acme: Reminder—your appointment is tomorrow at 3pm. Reply YES to confirm. Reply STOP to opt out.",
              "Acme: Your technician is on the way and will arrive in ~15 minutes. Reply STOP to opt out."
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "optInKeywords": {
            "example": [
              "START"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "optInMessage": {
            "description": "If managing opt-in keywords yourself, provide the opt-in message.",
            "example": "Acme: You are subscribed to recurring messages. Msg&data rates may apply. Reply STOP to opt out, HELP for help.",
            "type": "string"
          },
          "optOutKeywords": {
            "example": [
              "STOP",
              "UNSUBSCRIBE"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "optOutMessage": {
            "description": "If managing opt-out keywords yourself, provide the opt-out message.",
            "example": "Acme: You are opted out and will receive no further messages.",
            "type": "string"
          },
          "subscriberOptIn": {
            "default": true,
            "description": "If you require subscriber opt-in (Twilio flag).",
            "type": "boolean"
          },
          "type": {
            "enum": [
              "CUSTOMER_CARE",
              "MARKETING"
            ],
            "example": "CUSTOMER_CARE",
            "type": "string"
          },
          "usecase": {
            "description": "Twilio US A2P use-case string. Common examples include MARKETING, 2FA, ACCOUNT_NOTIFICATIONS, CUSTOMER_CARE. (Twilio validates this.)",
            "example": "MARKETING",
            "type": "string"
          }
        },
        "required": [
          "type",
          "usecase",
          "description",
          "messageFlow",
          "messageSamples",
          "hasEmbeddedLinks",
          "hasEmbeddedPhone"
        ],
        "type": "object"
      },
      "SmsBrandAddressDto": {
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "street": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SmsBrandPrefillDto": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/PrefillAddressDto"
          },
          "businessEmail": {
            "type": "string"
          },
          "businessName": {
            "type": "string"
          },
          "businessPhone": {
            "type": "string"
          },
          "industry": {
            "type": "string"
          },
          "marketingVerticals": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "missingRequiredFields": {
            "description": "Fields we cannot reliably infer and should require user confirmation.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sources": {
            "description": "Field-level sources for UI \"prefilled from\" badges.",
            "type": "object"
          },
          "websiteUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SmsCompliancePrefillResponseDto": {
        "properties": {
          "brand": {
            "$ref": "#/components/schemas/SmsBrandPrefillDto"
          },
          "contact": {
            "$ref": "#/components/schemas/SmsContactPrefillDto"
          },
          "recommendationReason": {
            "type": "string"
          },
          "recommendedTemplateIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "templates": {
            "items": {
              "$ref": "#/components/schemas/SmsComplianceTemplateDto"
            },
            "type": "array"
          }
        },
        "required": [
          "brand",
          "contact",
          "templates",
          "recommendedTemplateIds"
        ],
        "type": "object"
      },
      "SmsComplianceStatusBrandDto": {
        "properties": {
          "brandType": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "rejectionReason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "submittedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "type": "object"
      },
      "SmsComplianceStatusCampaignDto": {
        "properties": {
          "campaignId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "messagingServiceSid": {
            "type": "string"
          },
          "rejectionReason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "submittedAt": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "usa2pSid": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "messagingServiceSid"
        ],
        "type": "object"
      },
      "SmsComplianceStatusDto": {
        "properties": {
          "brand": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SmsComplianceStatusBrandDto"
              }
            ],
            "nullable": true
          },
          "campaigns": {
            "items": {
              "$ref": "#/components/schemas/SmsComplianceStatusCampaignDto"
            },
            "type": "array"
          },
          "canSendConversational": {
            "type": "boolean"
          },
          "canSendMarketing": {
            "type": "boolean"
          },
          "numbers": {
            "items": {
              "$ref": "#/components/schemas/SmsComplianceStatusNumberDto"
            },
            "type": "array"
          },
          "step": {
            "enum": [
              "BRAND",
              "CAMPAIGN",
              "NUMBER",
              "READY"
            ],
            "type": "string"
          }
        },
        "required": [
          "canSendConversational",
          "canSendMarketing",
          "step",
          "brand",
          "campaigns",
          "numbers"
        ],
        "type": "object"
      },
      "SmsComplianceStatusNumberDto": {
        "properties": {
          "compliant": {
            "type": "boolean"
          },
          "messagingServiceSid": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          }
        },
        "required": [
          "phoneNumber",
          "compliant"
        ],
        "type": "object"
      },
      "SmsComplianceTemplateDto": {
        "properties": {
          "description": {
            "type": "string"
          },
          "expectedVolume": {
            "type": "string"
          },
          "helpText": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "linkShorteningAllowed": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "optInTextSamples": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "optOutText": {
            "type": "string"
          },
          "sampleMessages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "description",
          "sampleMessages",
          "optInTextSamples",
          "optOutText",
          "helpText",
          "expectedVolume",
          "linkShorteningAllowed"
        ],
        "type": "object"
      },
      "SmsContactPrefillDto": {
        "properties": {
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SmsRawEndUserDto": {
        "properties": {
          "assignTo": {
            "example": [
              "CUSTOMER_PROFILE",
              "A2P_PROFILE"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "attributes": {
            "type": "object"
          },
          "friendlyName": {
            "example": "Acme Heating & Air - Business",
            "type": "string"
          },
          "type": {
            "description": "Twilio TrustHub end user type. Common values include 'business' or 'individual'. Use the end-user-types endpoint to discover what's available.",
            "example": "business",
            "type": "string"
          }
        },
        "required": [
          "friendlyName",
          "type",
          "attributes"
        ],
        "type": "object"
      },
      "SmsThrottleDto": {
        "properties": {
          "minSecondsBetweenRecipient": {
            "description": "Minimum seconds between outbound SMS to the same recipient",
            "example": 10,
            "type": "number"
          }
        },
        "type": "object"
      },
      "SmtpConnectionDto": {
        "properties": {
          "host": {
            "example": "smtp.gmail.com",
            "type": "string"
          },
          "password": {
            "example": "app-password-or-smtp-password",
            "type": "string"
          },
          "port": {
            "example": 587,
            "type": "number"
          },
          "secure": {
            "example": false,
            "type": "boolean"
          },
          "username": {
            "example": "ops@acme.com",
            "type": "string"
          }
        },
        "required": [
          "host",
          "port",
          "secure",
          "username",
          "password"
        ],
        "type": "object"
      },
      "StartDeveloperPortalSsoDto": {
        "properties": {
          "nextPath": {
            "example": "/org/org_123/webhooks",
            "type": "string"
          },
          "orgId": {
            "example": "org_123",
            "type": "string"
          }
        },
        "required": [
          "orgId"
        ],
        "type": "object"
      },
      "StartEvalRunDto": {
        "properties": {
          "promptOverride": {
            "description": "Override the agent system prompt for this run",
            "type": "string"
          },
          "voiceAgentId": {
            "description": "Voice agent unified ID to test. Uses suite default if omitted.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StartFollowUpSequenceDto": {
        "properties": {},
        "type": "object"
      },
      "StartMagicDto": {
        "properties": {
          "gbpUrl": {
            "example": "https://maps.google.com/maps/place/?q=...",
            "type": "string"
          },
          "googlePlaceId": {
            "example": "ChIJxxxxxxxxxxxxxxx",
            "type": "string"
          },
          "websiteUrl": {
            "example": "https://comfortairhvac.com",
            "type": "string"
          }
        },
        "required": [
          "websiteUrl"
        ],
        "type": "object"
      },
      "SubjectVariantDto": {
        "properties": {
          "id": {
            "description": "Stable variant id. Operators typically use \"A\", \"B\", or descriptive labels like \"urgency\" / \"curiosity\". Persists onto each Email row so analytics can compute per-variant open / click rates.",
            "example": "A",
            "maxLength": 32,
            "type": "string"
          },
          "subject": {
            "description": "Subject line used when this variant is selected for a recipient.",
            "example": "It's 95° outside — book your AC service today",
            "maxLength": 200,
            "type": "string"
          },
          "weight": {
            "description": "Optional weight for non-equal splits. Defaults to 1. A 50/50 test is `[{weight:1}, {weight:1}]`; a 70/30 gradual rollout is `[{weight:7}, {weight:3}]`.",
            "example": 1,
            "type": "number"
          }
        },
        "required": [
          "id",
          "subject"
        ],
        "type": "object"
      },
      "SubmitSurveyResponseDto": {
        "properties": {
          "answers": {
            "type": "object"
          },
          "comment": {
            "type": "string"
          },
          "score": {
            "maximum": 10,
            "minimum": 0,
            "type": "number"
          },
          "sentiment": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SubmitWidgetLeadDto": {
        "properties": {
          "details": {
            "example": "Need HVAC tune-up this weekend",
            "type": "string"
          },
          "email": {
            "example": "alex@example.com",
            "type": "string"
          },
          "name": {
            "example": "Alex Homeowner",
            "type": "string"
          },
          "phone": {
            "example": "+1 (555) 555-1188",
            "type": "string"
          }
        },
        "required": [
          "name",
          "email"
        ],
        "type": "object"
      },
      "SuggestWorkflowDto": {
        "properties": {
          "industry": {
            "description": "Override the organization industry if needed",
            "example": "roofing",
            "type": "string"
          },
          "maxSuggestions": {
            "description": "Maximum number of workflow suggestions to return",
            "example": 3,
            "type": "number"
          },
          "prompt": {
            "description": "Natural language description of the business challenge",
            "example": "We need to automatically follow up with customers for Google reviews after HVAC service visits.",
            "type": "string"
          }
        },
        "required": [
          "prompt"
        ],
        "type": "object"
      },
      "SurveyQuestionInputDto": {
        "properties": {
          "logic": {
            "description": "Conditional logic for showing the question",
            "type": "object"
          },
          "options": {
            "description": "Question specific options or metadata (display, scale labels, etc.)",
            "type": "object"
          },
          "orderIndex": {
            "description": "Overrides default ordering (0-based)",
            "type": "number"
          },
          "required": {
            "default": false,
            "type": "boolean"
          },
          "subtitle": {
            "example": "0 = Not likely, 10 = Extremely likely",
            "type": "string"
          },
          "title": {
            "description": "Canonical question prompt. Use `title`; legacy `text` payloads are not part of the API contract.",
            "example": "How likely are you to recommend us?",
            "type": "string"
          },
          "type": {
            "enum": [
              "NPS_SCALE",
              "CSAT_STARS",
              "CSAT_THUMBS",
              "LIKERT",
              "MULTI_SELECT",
              "SINGLE_SELECT",
              "FREE_TEXT",
              "BOOLEAN"
            ],
            "example": "NPS_SCALE",
            "type": "string"
          }
        },
        "required": [
          "title",
          "type"
        ],
        "type": "object"
      },
      "SurveyQuestionResponseDto": {
        "properties": {
          "id": {
            "type": "string"
          },
          "logic": {
            "type": "object"
          },
          "options": {
            "type": "object"
          },
          "orderIndex": {
            "type": "number"
          },
          "required": {
            "default": false,
            "type": "boolean"
          },
          "subtitle": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "enum": [
              "NPS_SCALE",
              "CSAT_STARS",
              "CSAT_THUMBS",
              "LIKERT",
              "MULTI_SELECT",
              "SINGLE_SELECT",
              "FREE_TEXT",
              "BOOLEAN"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "type",
          "required",
          "orderIndex"
        ],
        "type": "object"
      },
      "SurveyTemplateListResponseDto": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SurveyTemplateResponseDto"
            },
            "type": "array"
          },
          "limit": {
            "type": "number"
          },
          "meta": {
            "$ref": "#/components/schemas/SurveyTemplatePaginationMetaDto"
          },
          "page": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "totalPages": {
            "type": "number"
          }
        },
        "required": [
          "total",
          "page",
          "limit",
          "totalPages",
          "data",
          "meta"
        ],
        "type": "object"
      },
      "SurveyTemplatePaginationMetaDto": {
        "properties": {
          "limit": {
            "type": "number"
          },
          "page": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "totalPages": {
            "type": "number"
          }
        },
        "required": [
          "total",
          "page",
          "limit",
          "totalPages"
        ],
        "type": "object"
      },
      "SurveyTemplateResponseDto": {
        "properties": {
          "channels": {
            "items": {
              "enum": [
                "EMAIL",
                "SMS",
                "WHATSAPP",
                "CHAT_WIDGET",
                "TICKET",
                "CALL_IVR"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdByUserId": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "questions": {
            "items": {
              "$ref": "#/components/schemas/SurveyQuestionResponseDto"
            },
            "type": "array"
          },
          "scoreType": {
            "enum": [
              "NPS",
              "CSAT",
              "CES",
              "CUSTOM"
            ],
            "type": "string"
          },
          "theme": {
            "type": "object"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "createdAt",
          "updatedAt",
          "organizationId",
          "name",
          "scoreType",
          "channels",
          "isActive",
          "questions"
        ],
        "type": "object"
      },
      "SwitchOrganizationDto": {
        "properties": {
          "organizationId": {
            "description": "ID of the organization to switch to",
            "example": "org_123",
            "type": "string"
          }
        },
        "required": [
          "organizationId"
        ],
        "type": "object"
      },
      "SyncKnowledgeDto": {
        "properties": {},
        "type": "object"
      },
      "TelephonyConfigDto": {
        "properties": {
          "configSource": {
            "description": "Where this config was resolved from. platform-env means the org is using the managed default; org-db means a BYOC or admin override is active.",
            "enum": [
              "org-db",
              "platform-env",
              "twilio-fallback"
            ],
            "type": "string"
          },
          "hasSipBridgeSecret": {
            "description": "true if a bridge secret is set for the managed platform bridge or a custom override",
            "type": "boolean"
          },
          "provider": {
            "enum": [
              "twilio",
              "freeswitch"
            ],
            "type": "string"
          },
          "sipBridgeApiUrl": {
            "description": "Bridge API URL. Present for the platform-managed default or a custom BYOC override.",
            "type": "string"
          },
          "sipTrunk": {
            "$ref": "#/components/schemas/SipTrunkSummaryDto"
          },
          "sipTrunkBackup": {
            "$ref": "#/components/schemas/SipTrunkSummaryDto"
          }
        },
        "required": [
          "provider",
          "configSource"
        ],
        "type": "object"
      },
      "TestAllowedDomainDto": {
        "properties": {
          "url": {
            "description": "Full URL or hostname to test against the widget allowlist.",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "TestCallStatusResponseDto": {
        "properties": {
          "callId": {
            "type": "string"
          },
          "duration": {
            "description": "Duration in seconds (when completed).",
            "type": "number"
          },
          "startedAt": {
            "type": "string"
          },
          "status": {
            "enum": [
              "initiating",
              "ringing",
              "connected",
              "completed",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "callId",
          "status"
        ],
        "type": "object"
      },
      "TestEmailCampaignDto": {
        "properties": {
          "to": {
            "example": "test@acme.com",
            "type": "string"
          }
        },
        "required": [
          "to"
        ],
        "type": "object"
      },
      "TestNotificationDto": {
        "properties": {
          "type": {
            "enum": [
              "email",
              "push"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "TestWidgetWebhookDto": {
        "properties": {
          "event": {
            "description": "Event to send as a test payload.",
            "enum": [
              "widget.chat.started",
              "widget.chat.message",
              "widget.chat.ended",
              "widget.lead.captured",
              "widget.booking.requested",
              "widget.phone.call"
            ],
            "type": "string"
          }
        },
        "required": [
          "event"
        ],
        "type": "object"
      },
      "TokenRequestDto": {
        "properties": {
          "client_id": {
            "description": "OAuth2 client ID",
            "example": "cmhw6k04i001j3m0rp2icr3ax",
            "type": "string"
          },
          "client_secret": {
            "description": "OAuth2 client secret (required for confidential clients)",
            "example": "feeb59b7...",
            "type": "string"
          },
          "code": {
            "description": "Authorization code returned by the /authorize endpoint",
            "type": "string"
          },
          "code_verifier": {
            "description": "PKCE code verifier used to generate the code challenge (optional for non-PKCE flows like OpenAI)",
            "type": "string"
          },
          "grant_type": {
            "description": "OAuth2 grant type",
            "enum": [
              "client_credentials",
              "authorization_code"
            ],
            "example": "client_credentials",
            "type": "string"
          },
          "redirect_uri": {
            "description": "Redirect URI used in the authorization request",
            "type": "string"
          },
          "resource": {
            "description": "Resource indicator (RFC 8707)",
            "example": "https://process.serviceagent.ai/v1/mcp",
            "type": "string"
          },
          "scope": {
            "description": "Requested scopes (space-separated)",
            "example": "agents:start_call leads:upsert",
            "type": "string"
          }
        },
        "required": [
          "grant_type",
          "client_id"
        ],
        "type": "object"
      },
      "TokenResponseDto": {
        "properties": {
          "access_token": {
            "description": "Access token",
            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
            "type": "string"
          },
          "expires_in": {
            "description": "Token expiration time in seconds",
            "example": 3600,
            "type": "number"
          },
          "scope": {
            "description": "Granted scopes",
            "example": "agents:start_call leads:upsert quotes:generate",
            "type": "string"
          },
          "token_type": {
            "description": "Token type",
            "example": "Bearer",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope"
        ],
        "type": "object"
      },
      "ToolResultWebhookDto": {
        "properties": {},
        "type": "object"
      },
      "TosAcceptanceDto": {
        "properties": {
          "date": {
            "example": 1732945923,
            "type": "number"
          },
          "ip": {
            "example": "203.0.113.42",
            "type": "string"
          },
          "userAgent": {
            "example": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)...",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TransferAppointmentDto": {
        "properties": {
          "reason": {
            "description": "Reason for transfer (stored in audit trail)",
            "type": "string"
          },
          "toLocationId": {
            "description": "Destination location ID",
            "type": "string"
          }
        },
        "required": [
          "toLocationId"
        ],
        "type": "object"
      },
      "TransferDealDto": {
        "properties": {
          "reason": {
            "description": "Reason for transfer (stored in audit trail)",
            "type": "string"
          },
          "toLocationId": {
            "description": "Destination location ID",
            "type": "string"
          }
        },
        "required": [
          "toLocationId"
        ],
        "type": "object"
      },
      "TriggerAdSyncDto": {
        "properties": {
          "runImmediately": {
            "default": false,
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TriggerListingSyncDto": {
        "properties": {
          "runImmediately": {
            "default": false,
            "description": "When true, sync occurs immediately; otherwise queued for background processing",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TriggerNudgeDto": {
        "properties": {},
        "type": "object"
      },
      "TriggerReviewIngestDto": {
        "properties": {
          "connectionId": {
            "description": "Specific listing connection to ingest reviews for",
            "example": "mlc_123",
            "type": "string"
          },
          "since": {
            "description": "Only ingest reviews posted after this ISO timestamp",
            "example": "2025-01-01T00:00:00.000Z",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TriggerWorkflowDto": {
        "properties": {
          "context": {
            "example": {
              "chatSummary": "Customer asked about pricing for 50 users",
              "intent": "pricing",
              "leadScore": 75,
              "productInterest": [
                "Enterprise Plan"
              ],
              "urgency": "medium"
            },
            "type": "object"
          },
          "executeImmediately": {
            "default": true,
            "example": true,
            "type": "boolean"
          },
          "triggerId": {
            "example": "widget_pricing_interest",
            "type": "string"
          },
          "workflowId": {
            "example": "workflow-id",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TwilioCallStatusWebhookDto": {
        "properties": {
          "AccountSid": {
            "description": "Twilio Account SID",
            "type": "string"
          },
          "ApiVersion": {
            "description": "API version",
            "type": "string"
          },
          "CallSid": {
            "description": "Twilio Call SID",
            "type": "string"
          },
          "CallStatus": {
            "description": "Call status",
            "enum": [
              "initiated",
              "ringing",
              "in-progress",
              "completed",
              "busy",
              "failed",
              "no-answer",
              "canceled"
            ],
            "type": "string"
          },
          "CallerName": {
            "description": "Caller name (if available)",
            "type": "string"
          },
          "Direction": {
            "description": "Call direction",
            "type": "string"
          },
          "Duration": {
            "description": "Call duration in seconds",
            "type": "string"
          },
          "From": {
            "description": "From phone number",
            "type": "string"
          },
          "Timestamp": {
            "description": "Timestamp of the event",
            "type": "string"
          },
          "To": {
            "description": "To phone number",
            "type": "string"
          }
        },
        "required": [
          "CallSid",
          "AccountSid",
          "From",
          "To",
          "CallStatus"
        ],
        "type": "object"
      },
      "TwilioRecordingWebhookDto": {
        "properties": {
          "AccountSid": {
            "description": "Twilio Account SID",
            "type": "string"
          },
          "CallSid": {
            "description": "Twilio Call SID",
            "type": "string"
          },
          "RecordingChannels": {
            "description": "Number of recording channels",
            "type": "string"
          },
          "RecordingDuration": {
            "description": "Recording duration in seconds",
            "type": "string"
          },
          "RecordingSid": {
            "description": "Twilio Recording SID",
            "type": "string"
          },
          "RecordingSource": {
            "description": "Recording source",
            "type": "string"
          },
          "RecordingStatus": {
            "description": "Recording status",
            "enum": [
              "in-progress",
              "completed",
              "absent",
              "failed"
            ],
            "type": "string"
          },
          "RecordingUrl": {
            "description": "Recording URL (without extension)",
            "type": "string"
          }
        },
        "required": [
          "CallSid",
          "RecordingSid",
          "RecordingUrl",
          "RecordingStatus"
        ],
        "type": "object"
      },
      "UpdateActivityDto": {
        "properties": {
          "body": {
            "description": "Activity description/body",
            "example": "Discussed project requirements and timeline",
            "type": "string"
          },
          "callId": {
            "description": "Related call ID",
            "example": "call_abc",
            "type": "string"
          },
          "companyId": {
            "description": "Related company ID",
            "example": "company_456",
            "type": "string"
          },
          "contactId": {
            "description": "Related contact ID",
            "example": "contact_123",
            "type": "string"
          },
          "customJson": {
            "description": "Custom JSON data",
            "example": "{\"customField\": \"value\"}",
            "type": "object"
          },
          "dealId": {
            "description": "Related deal ID",
            "example": "deal_789",
            "type": "string"
          },
          "durationSec": {
            "description": "Duration in seconds",
            "example": 1800,
            "type": "number"
          },
          "messageId": {
            "description": "Related message ID",
            "example": "message_def",
            "type": "string"
          },
          "ownerId": {
            "description": "Activity owner ID",
            "example": "user_123",
            "type": "string"
          },
          "subject": {
            "description": "Activity subject/title",
            "example": "Follow-up call with John Doe",
            "type": "string"
          },
          "type": {
            "description": "Type of activity",
            "enum": [
              "CALL",
              "EMAIL",
              "SMS",
              "MEETING",
              "NOTE",
              "REVIEW_REQUEST",
              "QUOTE_SENT",
              "PAYMENT_RECEIVED"
            ],
            "example": "CALL",
            "type": "string"
          },
          "whenAt": {
            "description": "When the activity occurred or is scheduled",
            "example": "2024-01-15T10:00:00Z",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateAdAccountDto": {
        "properties": {
          "credentials": {
            "example": {
              "accessToken": "token"
            },
            "type": "object"
          },
          "errorMessage": {
            "example": "Authorization failed",
            "type": "string"
          },
          "externalAccountId": {
            "example": "123-456-7890",
            "type": "string"
          },
          "googleCustomerId": {
            "description": "Google Ads customer ID (digits only)",
            "example": "1234567890",
            "type": "string"
          },
          "googleLocationGroupId": {
            "description": "Google Ads location group ID",
            "example": "987654321",
            "type": "string"
          },
          "metaBusinessAccountId": {
            "description": "Meta Business Manager ID",
            "example": "123456789012345",
            "type": "string"
          },
          "metaPageId": {
            "description": "Meta Facebook Page ID",
            "example": "123456789012345",
            "type": "string"
          },
          "metaPixelId": {
            "description": "Meta Pixel ID",
            "example": "123456789012345",
            "type": "string"
          },
          "metadata": {
            "example": {
              "currency": "USD"
            },
            "type": "object"
          },
          "provider": {
            "enum": [
              "google_ads",
              "meta_ads"
            ],
            "type": "string"
          },
          "status": {
            "example": "connected",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateAdsBillingSettingsDto": {
        "properties": {
          "autopauseEnabled": {
            "default": true,
            "example": true,
            "type": "boolean"
          },
          "spendCapDailyCents": {
            "description": "Daily spend cap in cents",
            "example": 20000,
            "type": "number"
          },
          "spendCapMonthlyCents": {
            "description": "Monthly spend cap in cents",
            "example": 200000,
            "type": "number"
          }
        },
        "type": "object"
      },
      "UpdateAgentDto": {
        "properties": {
          "capabilities": {
            "description": "Capabilities of the AI agent",
            "example": [
              "crm_lookup",
              "kb_search",
              "appointment_booking"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "description": "Description of the AI agent",
            "example": "Handles customer inquiries and support requests",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "description": "Whether the agent is active",
            "example": true,
            "type": "boolean"
          },
          "maxTokens": {
            "default": 4000,
            "description": "Maximum tokens for AI responses",
            "example": 4000,
            "maximum": 8000,
            "minimum": 100,
            "type": "number"
          },
          "model": {
            "default": "gpt-4",
            "description": "AI model to use",
            "example": "gpt-4",
            "type": "string"
          },
          "name": {
            "description": "Name of the AI agent",
            "example": "Customer Service Agent",
            "type": "string"
          },
          "systemPrompt": {
            "description": "System prompt for the AI agent",
            "example": "You are a helpful customer service assistant...",
            "type": "string"
          },
          "temperature": {
            "default": 0.7,
            "description": "Temperature for AI responses (0-1)",
            "example": 0.7,
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          }
        },
        "type": "object"
      },
      "UpdateAgentKnowledgeDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateAgentReadDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateAgentTypingDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateAiAgentDto": {
        "properties": {
          "capabilities": {
            "example": [
              "crm_lookup",
              "kb_search",
              "appointment_booking"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "example": "Handles customer inquiries and support",
            "type": "string"
          },
          "industry": {
            "description": "Industry type for the agent",
            "example": "roofing",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "description": "Whether the agent is active",
            "example": true,
            "type": "boolean"
          },
          "knowledgeBase": {
            "description": "Array of knowledge base article IDs to associate with this agent",
            "example": [
              "kb_article_id_1",
              "kb_article_id_2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "maxTokens": {
            "example": 4000,
            "minimum": 1,
            "type": "number"
          },
          "model": {
            "example": "gpt-5-nano-2025-08-07",
            "type": "string"
          },
          "name": {
            "example": "Customer Service Agent",
            "type": "string"
          },
          "personality": {
            "description": "Personality style for the agent (e.g., professional, friendly, casual)",
            "example": "professional",
            "type": "string"
          },
          "systemPrompt": {
            "example": "You are a helpful customer service assistant...",
            "type": "string"
          },
          "temperature": {
            "example": 0.7,
            "maximum": 2,
            "minimum": 0,
            "type": "number"
          }
        },
        "type": "object"
      },
      "UpdateAiSettingsDto": {
        "properties": {
          "autoHandoff": {
            "$ref": "#/components/schemas/AutoHandoffDto"
          },
          "businessHours": {
            "$ref": "#/components/schemas/BusinessHoursDto"
          },
          "enabledTools": {
            "example": [
              "crm",
              "calendar",
              "payments",
              "kb"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "systemPrompt": {
            "example": "You are a helpful AI assistant for service businesses.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateAllowedDomainsDto": {
        "properties": {
          "blockedMessage": {
            "description": "Message rendered when the widget is blocked.",
            "maxLength": 200,
            "type": "string"
          },
          "domains": {
            "description": "Allowed hostnames. Supports exact hosts and leading *. wildcard.",
            "items": {
              "type": "array"
            },
            "type": "array"
          },
          "enabled": {
            "description": "Enable domain allowlist enforcement.",
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "domains"
        ],
        "type": "object"
      },
      "UpdateAppointmentDto": {
        "properties": {
          "bufferAfterMinutes": {
            "description": "Minutes of buffer time after the appointment",
            "example": 15,
            "type": "number"
          },
          "bufferBeforeMinutes": {
            "description": "Minutes of buffer time before the appointment",
            "example": 15,
            "type": "number"
          },
          "customJson": {
            "additionalProperties": true,
            "description": "Free-form metadata blob attached to the appointment (e.g. partner-specific tags, internal notes). The server stores this passthrough — schema is intentionally open-ended so workflows and integrations can stash whatever they need.",
            "example": {
              "priority": "high",
              "internalNotes": "VIP customer"
            },
            "type": "object"
          },
          "customerEmail": {
            "description": "Required when `customerId` is not provided. Server upserts a `Contact` by email when this path is taken. Ignored when `customerId` is set.",
            "example": "jane@example.com",
            "type": "string"
          },
          "customerId": {
            "description": "Optional: pass the FK of an existing CRM `Contact` to attach the appointment without an email upsert. When provided, `customerName` and `customerEmail` are not required (and are ignored if sent — the contact row is the source of truth). When omitted, the public/inline booking path runs and `customerName` + `customerEmail` are required.",
            "example": "cnt_123",
            "type": "string"
          },
          "customerName": {
            "description": "Required when `customerId` is not provided. Ignored when `customerId` is set.",
            "example": "Jane Smith",
            "type": "string"
          },
          "customerPhone": {
            "example": "+1234567890",
            "type": "string"
          },
          "description": {
            "example": "Please clean the kitchen thoroughly",
            "type": "string"
          },
          "duration": {
            "description": "Duration in minutes. Used to derive endAt when it is omitted.",
            "example": 90,
            "type": "number"
          },
          "endAt": {
            "example": "2024-01-15T12:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "locationId": {
            "description": "Location ID for this appointment (multi-location)",
            "example": "loc_123",
            "type": "string"
          },
          "notes": {
            "example": "Customer prefers morning appointment",
            "type": "string"
          },
          "ownerId": {
            "example": "user-id",
            "type": "string"
          },
          "recurrenceRule": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RecurrenceRuleDto"
              }
            ],
            "description": "Recurrence rule describing how this appointment should repeat"
          },
          "resourceIds": {
            "description": "Resource IDs required for this appointment (rooms/equipment/vehicles)",
            "example": [
              "res_123"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "scheduledAt": {
            "description": "Legacy alias for startAt (ISO 8601).",
            "example": "2024-01-15T10:00:00Z",
            "type": "string"
          },
          "serviceId": {
            "description": "Optional. Defaults to the first active service offering when omitted.",
            "example": "service-id",
            "type": "string"
          },
          "serviceOfferingId": {
            "description": "Alias for serviceId kept for backward compatibility.",
            "example": "service-offering-id",
            "type": "string"
          },
          "staffId": {
            "description": "Optional. Defaults to the first active staff member when omitted.",
            "example": "staff-id",
            "type": "string"
          },
          "startAt": {
            "description": "Appointment start time. Required unless scheduledAt is provided.",
            "example": "2024-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "example": "scheduled",
            "type": "string"
          },
          "title": {
            "example": "House Cleaning Service",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateBrandKitDto": {
        "properties": {
          "brandName": {
            "example": "Acme HVAC",
            "type": "string"
          },
          "colors": {
            "example": {
              "primary": "#6366f1"
            },
            "type": "object"
          },
          "contact": {
            "example": {
              "phone": "+15551234567"
            },
            "type": "object"
          },
          "faviconUrl": {
            "example": "https://cdn.example.com/favicon.png",
            "type": "string"
          },
          "legal": {
            "example": {
              "privacyPolicyUrl": "https://example.com/privacy"
            },
            "type": "object"
          },
          "logoDarkUrl": {
            "example": "https://cdn.example.com/logo-dark.png",
            "type": "string"
          },
          "logoUrl": {
            "example": "https://cdn.example.com/logo.png",
            "type": "string"
          },
          "social": {
            "example": {
              "facebook": "https://facebook.com/acme"
            },
            "type": "object"
          },
          "tagline": {
            "example": "Cooling You Since 1995",
            "type": "string"
          },
          "typography": {
            "example": {
              "body": "Inter",
              "heading": "Inter",
              "mono": "JetBrains Mono"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateBrandKitOverrideDto": {
        "properties": {
          "overrides": {
            "example": {
              "logoUrl": "https://cdn.example.com/invoice-logo.png"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateBusinessHoursDto": {
        "properties": {
          "schedule": {
            "items": {
              "$ref": "#/components/schemas/BusinessHoursScheduleEntryDto"
            },
            "type": "array"
          },
          "timezone": {
            "example": "America/New_York",
            "type": "string"
          }
        },
        "required": [
          "timezone",
          "schedule"
        ],
        "type": "object"
      },
      "UpdateBusinessProfileDto": {
        "properties": {
          "about": {
            "type": "string"
          },
          "contact": {
            "type": "object"
          },
          "faqs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "pricebook": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "services": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "websiteUrl": {
            "type": "string"
          },
          "workingHours": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateCadenceStatusDto": {
        "properties": {
          "status": {
            "enum": [
              "DRAFT",
              "ACTIVE",
              "ARCHIVED"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "UpdateCalendarConfigDto": {
        "properties": {
          "config": {
            "$ref": "#/components/schemas/ConfigDto"
          },
          "description": {
            "example": "Primary booking calendar",
            "type": "string"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "name": {
            "example": "Main Calendar",
            "type": "string"
          },
          "settings": {
            "description": "Alias for `config` (legacy frontend). Stored as CalendarConfig.config JSON.",
            "type": "object"
          },
          "slug": {
            "description": "Optional booking slug. If provided, it will be used to derive the public bookingKey (best-effort unique).",
            "example": "main-calendar",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateCallNoteDto": {
        "properties": {
          "actionItems": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "decisions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "nextSteps": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "summary": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateCampaignBudgetDto": {
        "properties": {
          "dailyBudgetMicros": {
            "description": "New daily budget in micros (1 USD = 1,000,000 micros)",
            "example": 75000000,
            "type": "number"
          }
        },
        "required": [
          "dailyBudgetMicros"
        ],
        "type": "object"
      },
      "UpdateCampaignStatusDto": {
        "properties": {
          "note": {
            "description": "Optional note for audit logs.",
            "maxLength": 500,
            "type": "string"
          },
          "status": {
            "enum": [
              "enabled",
              "paused",
              "removed"
            ],
            "example": "paused",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "UpdateChannelConfigDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateChannelDto": {
        "properties": {
          "externalId": {
            "description": "Canonical send-from identity (phone number or email address)",
            "type": "string"
          },
          "friendlyName": {
            "description": "Friendly display name for UI",
            "example": "Support Email",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "description": "Active/inactive state",
            "type": "boolean"
          },
          "isShared": {
            "default": false,
            "type": "boolean"
          },
          "locationId": {
            "description": "Location to own this channel; if omitted, uses active location context.",
            "type": "string"
          },
          "provider": {
            "description": "Provider key (twilio/sendgrid/etc.)",
            "type": "string"
          },
          "type": {
            "enum": [
              "SMS",
              "EMAIL",
              "WHATSAPP",
              "TELEGRAM",
              "WIDGET",
              "CALL"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateCompanyDto": {
        "properties": {
          "address": {
            "example": "123 Main St",
            "type": "string"
          },
          "addressJson": {
            "example": {
              "street": "123 Main St",
              "city": "Anytown",
              "state": "CA",
              "zip": "12345"
            },
            "type": "object"
          },
          "customJson": {
            "example": {
              "customField": "value"
            },
            "type": "object"
          },
          "domain": {
            "example": "acme.com",
            "type": "string"
          },
          "industry": {
            "example": "Technology",
            "type": "string"
          },
          "name": {
            "example": "Acme Corporation",
            "type": "string"
          },
          "phone": {
            "example": "+1234567890",
            "type": "string"
          },
          "size": {
            "example": "50-100",
            "type": "string"
          },
          "tags": {
            "example": [
              "tag1",
              "tag2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "website": {
            "example": "https://acme.com",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateContactDto": {
        "properties": {
          "behavioralProfile": {
            "description": "Behavioral intelligence profile",
            "example": {
              "engagementScore": 75,
              "responseRate": 80,
              "preferredChannel": "EMAIL",
              "communicationStyle": "FORMAL",
              "decisionMakingStyle": "ANALYTICAL",
              "riskTolerance": "MEDIUM",
              "urgencyPreference": "HIGH",
              "lastEngagementAt": "2024-01-15T10:00:00Z",
              "engagementFrequency": "WEEKLY"
            },
            "type": "object"
          },
          "companyId": {
            "example": "company-id",
            "type": "string"
          },
          "contextualProfile": {
            "description": "Contextual intelligence profile",
            "example": {
              "industry": "Technology",
              "companySize": "MEDIUM",
              "budgetRange": "50K_100K",
              "decisionTimeline": "3_MONTHS",
              "painPoints": [
                "Integration challenges",
                "Cost concerns"
              ],
              "goals": [
                "Increase efficiency",
                "Reduce costs"
              ],
              "challenges": [
                "Legacy systems"
              ],
              "successMetrics": [
                "ROI",
                "User adoption"
              ],
              "competitors": [
                "Competitor A",
                "Competitor B"
              ],
              "currentSolutions": [
                "Current solution X"
              ]
            },
            "type": "object"
          },
          "customJson": {
            "example": {
              "customField": "value"
            },
            "type": "object"
          },
          "email": {
            "example": "john.doe@example.com",
            "type": "string"
          },
          "firstName": {
            "example": "John",
            "type": "string"
          },
          "identityProfile": {
            "description": "Enhanced identity information",
            "example": {
              "preferredName": "Johnny",
              "title": "VP of Sales",
              "department": "Sales",
              "role": "Decision Maker",
              "seniority": "SENIOR",
              "timezone": "America/New_York",
              "language": "en",
              "avatar": "https://example.com/avatar.jpg",
              "socialProfiles": []
            },
            "type": "object"
          },
          "lastName": {
            "example": "Doe",
            "type": "string"
          },
          "leadScore": {
            "description": "Explicit lead score override. If omitted the system auto-calculates.",
            "example": 65,
            "type": "number"
          },
          "lifecycleStageId": {
            "description": "Lifecycle stage identifier.",
            "example": "stage_cuid",
            "type": "string"
          },
          "lifecycleStageKey": {
            "description": "Lifecycle stage key (e.g., MQL, SQL). Takes precedence over lifecycleStageId.",
            "example": "SQL",
            "type": "string"
          },
          "ownerId": {
            "example": "user-id",
            "type": "string"
          },
          "phone": {
            "example": "+1234567890",
            "type": "string"
          },
          "predictiveProfile": {
            "description": "Predictive intelligence profile",
            "example": {
              "nextBestAction": "Schedule demo call",
              "likelihoodToBuy": 75,
              "estimatedDealSize": 50000,
              "optimalContactTime": "Tuesday 2-4 PM",
              "optimalContactChannel": "PHONE",
              "nextMilestone": "Technical evaluation",
              "predictedChurnDate": null,
              "lifetimeValue": 150000,
              "acquisitionCost": 5000
            },
            "type": "object"
          },
          "relationshipProfile": {
            "description": "Relationship intelligence profile",
            "example": {
              "relationshipStrength": 85,
              "relationshipStage": "WARM",
              "influenceLevel": "HIGH",
              "networkConnections": [],
              "referralPotential": 70,
              "loyaltyScore": 80,
              "churnRisk": 20
            },
            "type": "object"
          },
          "status": {
            "example": "LEAD",
            "type": "string"
          },
          "tags": {
            "example": [
              "tag1",
              "tag2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdateContextDto": {
        "properties": {
          "focusAreas": {
            "description": "Areas of focus",
            "example": [
              "deals",
              "contacts",
              "activities"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "metadata": {
            "description": "Additional context metadata",
            "example": {
              "category": "sales",
              "priority": "high"
            },
            "type": "object"
          },
          "notes": {
            "description": "User notes or preferences",
            "example": "Focus on closing deals this week",
            "type": "string"
          },
          "timeframe": {
            "description": "Timeframe for the context",
            "example": "week",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateCustomFieldDefinitionDto": {
        "properties": {
          "fieldType": {
            "example": "select",
            "type": "string"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "label": {
            "example": "Preferred Contact Method",
            "type": "string"
          },
          "options": {
            "example": [
              "Phone",
              "Email"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "validation": {
            "example": {
              "required": false
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateDealDto": {
        "properties": {
          "amountCents": {
            "example": 250000,
            "type": "number"
          },
          "closeDate": {
            "example": "2025-12-31",
            "type": "string"
          },
          "companyId": {
            "example": "comp_123",
            "type": "string"
          },
          "contactId": {
            "example": "contact_123",
            "type": "string"
          },
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "ownerId": {
            "example": "user_123",
            "type": "string"
          },
          "pipelineId": {
            "example": "pipe_123",
            "type": "string"
          },
          "source": {
            "example": "inbound",
            "type": "string"
          },
          "stage": {
            "description": "Deprecated alias for stageId. Will be coerced into stageId if provided.",
            "example": "stage_legacy",
            "type": "string"
          },
          "stageId": {
            "example": "stage_123",
            "type": "string"
          },
          "status": {
            "enum": [
              "OPEN",
              "WON",
              "LOST"
            ],
            "example": "OPEN",
            "type": "string"
          },
          "title": {
            "example": "New Website Project",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateDeveloperAppDto": {
        "properties": {
          "status": {
            "enum": [
              "draft",
              "active",
              "disabled",
              "archived"
            ],
            "example": "active",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateDeveloperAppPromptDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateDeveloperAppScopesDto": {
        "properties": {
          "scopes": {
            "example": [
              "developer_apps.read",
              "developer_credentials.write"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "scopes"
        ],
        "type": "object"
      },
      "UpdateDeveloperOAuthClientDto": {
        "properties": {
          "allowedScopes": {
            "example": [
              "tickets:read",
              "tickets:write",
              "webhooks:read"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "developerAppId": {
            "example": "devapp_123",
            "type": "string"
          },
          "name": {
            "example": "Support OAuth Client",
            "type": "string"
          },
          "redirectUris": {
            "example": [
              "https://developer.serviceagent.ai/auth/callback"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdateDeveloperPortalAccessDto": {
        "properties": {
          "capabilities": {
            "example": [
              "developer_portal.access",
              "developer_apps.read"
            ],
            "items": {
              "enum": [
                "developer_portal.access",
                "developer_docs.access",
                "developer_apps.read",
                "developer_apps.write",
                "developer_credentials.read",
                "developer_credentials.write",
                "developer_webhooks.read",
                "developer_webhooks.write",
                "developer_gateway.read",
                "developer_gateway.write",
                "developer_oauth.read",
                "developer_oauth.write",
                "developer_mcp.read",
                "developer_mcp.write",
                "developer_audit.read"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "roleBundle": {
            "enum": [
              "developer_viewer",
              "developer_operator",
              "developer_admin"
            ],
            "example": "developer_operator",
            "type": "string"
          }
        },
        "required": [
          "roleBundle"
        ],
        "type": "object"
      },
      "UpdateDialerCallDto": {
        "properties": {
          "disposition": {
            "description": "Updated call disposition label (e.g., connected, voicemail, no_show)",
            "example": "left_voicemail",
            "type": "string"
          },
          "notes": {
            "description": "Internal notes captured by the agent",
            "example": "Customer asked for proposal follow-up next Tuesday",
            "type": "string"
          },
          "tags": {
            "description": "Tags to help segment or filter call logs",
            "example": [
              "warm-lead",
              "pricing"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "voicemailDropId": {
            "description": "Voicemail drop ID to associate with this call (for reporting/reference)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateDialerRingGroupDto": {
        "properties": {
          "description": {
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "members": {
            "description": "Replace all members if provided",
            "items": {
              "$ref": "#/components/schemas/DialerRingGroupMemberInputDto"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateDialerSettingsDto": {
        "properties": {
          "afterHoursRoutingJson": {
            "type": "string"
          },
          "callRecordingEnabled": {
            "type": "boolean"
          },
          "callerIdName": {
            "type": "string"
          },
          "complianceJson": {
            "type": "string"
          },
          "defaultOutboundNumberId": {
            "type": "string"
          },
          "dispositions": {
            "description": "Custom disposition codes available in the dialer",
            "example": [
              "interested",
              "follow_up",
              "demo_scheduled"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "fallbackNumber": {
            "type": "string"
          },
          "forwardingStrategy": {
            "description": "Forwarding strategy, e.g., SIMULTANEOUS or SEQUENTIAL",
            "type": "string"
          },
          "metadataJson": {
            "type": "string"
          },
          "recordingConsentEnabled": {
            "type": "boolean"
          },
          "recordingConsentMessage": {
            "type": "string"
          },
          "ringTimeoutSeconds": {
            "type": "number"
          },
          "sipBridgeApiUrl": {
            "description": "Optional FreeSWITCH bridge API override. Leave empty for the platform-managed SIP bridge default.",
            "type": "string"
          },
          "sipBridgeSecret": {
            "description": "Optional SIP bridge secret override. Leave empty when using the platform-managed SIP bridge.",
            "type": "string"
          },
          "sipTrunk": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SipTrunkInputDto"
              }
            ],
            "description": "Optional primary BYOC SIP trunk. Leave empty to use the platform-managed SIP trunk by default."
          },
          "sipTrunkBackup": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SipTrunkInputDto"
              }
            ],
            "description": "Optional backup BYOC SIP trunk for failover when you bring your own carrier."
          },
          "telephonyProvider": {
            "description": "Active telephony provider for this org",
            "enum": [
              "twilio",
              "freeswitch"
            ],
            "type": "string"
          },
          "voicemailDropDefaultId": {
            "type": "string"
          },
          "voicemailDropDelaySeconds": {
            "type": "number"
          },
          "voicemailDropEnabled": {
            "type": "boolean"
          },
          "voicemailGreetingFileId": {
            "type": "string"
          },
          "voicemailGreetingUrl": {
            "type": "string"
          },
          "welcomeGreetingFileId": {
            "type": "string"
          },
          "welcomeGreetingUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateDialerUserSettingsDto": {
        "properties": {
          "availabilityJson": {
            "description": "JSON blob describing user availability windows",
            "type": "string"
          },
          "forwardingPreferenceJson": {
            "description": "JSON describing forwarding overrides for the user",
            "type": "string"
          },
          "metadataJson": {
            "description": "Opaque metadata blob for future extensions",
            "type": "string"
          },
          "outboundNumberId": {
            "type": "string"
          },
          "recordingOptOut": {
            "description": "When true, disables call recording just for this user",
            "type": "boolean"
          },
          "voicemailDropId": {
            "type": "string"
          },
          "wrapUpTimeSeconds": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "UpdateDispositionCodeDto": {
        "properties": {
          "code": {
            "description": "Replacement code value",
            "example": "follow_up_next_week",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "UpdateEmailCampaignDto": {
        "properties": {
          "channelId": {
            "description": "Send-from email channel",
            "example": "channel-uuid-123",
            "type": "string"
          },
          "fromEmail": {
            "example": "newsletter@acme.com",
            "type": "string"
          },
          "fromName": {
            "example": "Acme Co.",
            "type": "string"
          },
          "htmlContent": {
            "example": "<h1>Hello</h1>",
            "type": "string"
          },
          "listId": {
            "description": "Alias of recipientListId",
            "example": "cuid_list_123",
            "type": "string"
          },
          "name": {
            "example": "January Newsletter",
            "type": "string"
          },
          "previewText": {
            "example": "A quick overview of updates…",
            "type": "string"
          },
          "recipientFilters": {
            "$ref": "#/components/schemas/ContactFiltersDto"
          },
          "recipientListId": {
            "example": "cuid_list_123",
            "type": "string"
          },
          "replyTo": {
            "example": "support@acme.com",
            "type": "string"
          },
          "scheduledAt": {
            "example": "2025-01-01T12:00:00.000Z",
            "type": "string"
          },
          "subject": {
            "example": "What’s new this month",
            "type": "string"
          },
          "subjectVariants": {
            "description": "Optional A/B subject test config. When set, recipients are split deterministically across the variants by hashed (campaignId, contactId) bucket — same recipient always lands on the same variant across retries. Maximum 6 variants. The campaign-level `subject` field is still required (used as the fallback when this is null and as the operator-facing default in the UI).",
            "items": {
              "$ref": "#/components/schemas/SubjectVariantDto"
            },
            "type": "array"
          },
          "templateId": {
            "example": "cuid_template_123",
            "type": "string"
          },
          "textContent": {
            "example": "Hello",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateEmailTemplateApiDto": {
        "properties": {
          "category": {
            "example": "newsletter",
            "type": "string"
          },
          "htmlContent": {
            "example": "<h1>Hello {{firstName}}</h1>",
            "type": "string"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "example": "Holiday Newsletter",
            "type": "string"
          },
          "subject": {
            "example": "Happy Holidays from Acme!",
            "type": "string"
          },
          "textContent": {
            "example": "Hello {{firstName}}",
            "type": "string"
          },
          "variables": {
            "example": [
              "{{firstName}}",
              "{{companyName}}"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdateEmailTemplateDto": {
        "properties": {
          "body": {
            "description": "Alias for bodyHtml",
            "example": "<html>...</html>",
            "type": "string"
          },
          "bodyHtml": {
            "description": "Email body in HTML format with template variables",
            "example": "<h2>Proposal Follow-up</h2><p>Dear {{contact.firstName}},</p><p>I wanted to follow up on the proposal...</p>",
            "type": "string"
          },
          "category": {
            "description": "Template category",
            "example": "sales",
            "type": "string"
          },
          "isActive": {
            "description": "Whether the template is active",
            "example": true,
            "type": "boolean"
          },
          "name": {
            "description": "Template name",
            "example": "Proposal Follow-up",
            "type": "string"
          },
          "subject": {
            "description": "Email subject with template variables",
            "example": "Follow-up: {{proposal.title}}",
            "type": "string"
          },
          "variables": {
            "description": "Array of template variables used",
            "example": [
              "contact.firstName",
              "proposal.title",
              "user.name"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdateEvalPersonaDto": {
        "properties": {
          "description": {
            "description": "Detailed description of the persona",
            "type": "string"
          },
          "industry": {
            "description": "Industry context",
            "example": "hvac",
            "type": "string"
          },
          "name": {
            "description": "Persona display name",
            "example": "Impatient first-time caller",
            "type": "string"
          },
          "personality": {
            "description": "Personality trait",
            "example": "impatient",
            "type": "string"
          },
          "speakingStyle": {
            "description": "How this persona speaks",
            "example": "short, demanding sentences",
            "type": "string"
          },
          "tags": {
            "description": "Freeform tags for filtering",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdateEvalScenarioDto": {
        "properties": {
          "criteria": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EvalCriteriaDto"
              }
            ],
            "description": "Scoring criteria"
          },
          "label": {
            "description": "Scenario label",
            "example": "After-hours booking pressure",
            "type": "string"
          },
          "offlineResponse": {
            "description": "Canned response for offline eval mode",
            "type": "string"
          },
          "personaId": {
            "description": "Reference to an EvalPersona ID",
            "type": "string"
          },
          "tags": {
            "description": "Freeform tags for filtering",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "userMessage": {
            "description": "The message the simulated caller sends",
            "example": "I need an appointment Sunday at 11:30 PM.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateEvalSuiteDto": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "description": "Suite name",
            "type": "string"
          },
          "scenarioIds": {
            "description": "Replace scenario list (if provided)",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "weights": {
            "$ref": "#/components/schemas/EvalWeightsDto"
          }
        },
        "type": "object"
      },
      "UpdateFeatureFlagDto": {
        "properties": {
          "config": {
            "description": "Feature flag configuration",
            "type": "object"
          },
          "description": {
            "description": "Feature flag description",
            "type": "string"
          },
          "enabled": {
            "description": "Whether the feature is enabled",
            "type": "boolean"
          },
          "name": {
            "description": "Feature flag name",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateInvoiceDto": {
        "properties": {
          "amount": {
            "example": 10000,
            "type": "number"
          },
          "autoSend": {
            "example": false,
            "type": "boolean"
          },
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "description": {
            "example": "Invoice description",
            "type": "string"
          },
          "dueDate": {
            "example": "2025-12-31",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvoiceItemDto"
            },
            "type": "array"
          },
          "notes": {
            "example": "Payment notes",
            "type": "string"
          },
          "number": {
            "example": "INV-001",
            "type": "string"
          },
          "paymentTerms": {
            "example": "Net 30",
            "type": "string"
          },
          "template": {
            "example": "default",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateKbArticleDto": {
        "properties": {
          "aiAgentId": {
            "example": "cleaning",
            "type": "string"
          },
          "category": {
            "example": "pricing",
            "type": "string"
          },
          "content": {
            "example": "Our standard service includes cleaning, maintenance, and repair work...",
            "type": "string"
          },
          "fileHandles": {
            "description": "Filestack file handles for attachments",
            "example": [
              "handle1",
              "handle2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tags": {
            "example": [
              "pricing",
              "services",
              "costs"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "example": "Service Pricing Information",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateLifecycleStageDto": {
        "properties": {
          "allowedNextStageIds": {
            "example": [
              "stage_sql",
              "stage_customer"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "defaultAssignmentRuleId": {
            "example": "rule_cuid",
            "type": "string"
          },
          "description": {
            "example": "On-site or virtual estimate booked",
            "type": "string"
          },
          "entryCriteriaJson": {
            "description": "JSON criteria (stringified) for auto entry",
            "type": "string"
          },
          "exitCriteriaJson": {
            "description": "JSON criteria (stringified) for auto exit",
            "type": "string"
          },
          "isDefault": {
            "example": true,
            "type": "boolean"
          },
          "name": {
            "example": "Estimate Scheduled",
            "type": "string"
          },
          "order": {
            "example": 2,
            "type": "number"
          },
          "probability": {
            "description": "Probability of closing from this stage (0-100)",
            "example": 60,
            "type": "number"
          }
        },
        "type": "object"
      },
      "UpdateListingConnectionDto": {
        "properties": {
          "credentials": {
            "description": "Updated provider credentials",
            "example": {
              "accessToken": "token"
            },
            "type": "object"
          },
          "errorMessage": {
            "example": "Authorization failed",
            "type": "string"
          },
          "externalId": {
            "description": "Spec alias for externalLocationId",
            "example": "accounts/123/locations/456",
            "type": "string"
          },
          "externalLocationId": {
            "example": "accounts/123/locations/456",
            "type": "string"
          },
          "locationId": {
            "example": "loc_123",
            "type": "string"
          },
          "metadata": {
            "example": {
              "autoSync": true
            },
            "type": "object"
          },
          "provider": {
            "enum": [
              "google_business",
              "yelp",
              "facebook",
              "apple_maps",
              "bing",
              "trustpilot"
            ],
            "example": "google_business",
            "type": "string"
          },
          "status": {
            "example": "connected",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateLocationDto": {
        "properties": {
          "address": {
            "description": "Primary address of the location",
            "example": "123 Main St, Dallas, TX 75201",
            "type": "string"
          },
          "addressJson": {
            "description": "Structured address object (optional). Useful for maps + formatting.",
            "example": {
              "city": "Dallas",
              "country": "US",
              "state": "TX",
              "street": "123 Main St",
              "zip": "75201"
            },
            "type": "object"
          },
          "googlePlaceId": {
            "description": "Google Place ID for this location (optional).",
            "example": "ChIJN1t_tDeuEmsRUsoyG83frY4",
            "type": "string"
          },
          "isActive": {
            "description": "Whether the location is active",
            "example": true,
            "type": "boolean"
          },
          "latitude": {
            "description": "Latitude (optional)",
            "example": 32.7767,
            "type": "number"
          },
          "longitude": {
            "description": "Longitude (optional)",
            "example": -96.797,
            "type": "number"
          },
          "marketingNapOverride": {
            "description": "Location-specific override for listings NAP data",
            "example": {
              "address": {
                "city": "Dallas",
                "state": "TX",
                "street": "123 Main St",
                "zip": "75201"
              },
              "name": "Acme Heating & Air - Downtown",
              "phone": "+1-555-0123"
            },
            "type": "object"
          },
          "name": {
            "description": "Display name for the location",
            "example": "Downtown Office",
            "type": "string"
          },
          "phone": {
            "description": "Contact phone number for the location",
            "example": "+1-555-0123",
            "type": "string"
          },
          "serviceAreaZipCodes": {
            "description": "Zip codes served by this location for localized marketing",
            "example": [
              "75201",
              "75202",
              "75001"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "timezone": {
            "description": "Timezone identifier for scheduling and availability",
            "example": "America/Chicago",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateMarketingNotificationPreferencesDto": {
        "properties": {
          "campaignPaused": {
            "type": "boolean"
          },
          "infoMismatch": {
            "type": "boolean"
          },
          "lowBalance": {
            "type": "boolean"
          },
          "negativeReview": {
            "type": "boolean"
          },
          "newReview": {
            "type": "boolean"
          },
          "weeklyDigest": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UpdateMessageDto": {
        "properties": {
          "agentId": {
            "description": "Human/AI/system actor id that authored this message.",
            "example": "agent_123",
            "type": "string"
          },
          "agentName": {
            "description": "Display name for the authoring agent.",
            "example": "AIVA Front Desk",
            "type": "string"
          },
          "agentType": {
            "enum": [
              "human",
              "ai",
              "automation",
              "system"
            ],
            "example": "ai",
            "type": "string"
          },
          "body": {
            "example": "Message content here",
            "type": "string"
          },
          "customJson": {
            "example": {
              "attachments": []
            },
            "type": "object"
          },
          "direction": {
            "enum": [
              "INBOUND",
              "OUTBOUND"
            ],
            "example": "OUTBOUND",
            "type": "string"
          },
          "externalId": {
            "example": "twilio-message-id",
            "type": "string"
          },
          "fromAddress": {
            "example": "+1234567890",
            "type": "string"
          },
          "sentAt": {
            "example": "2024-01-15T10:00:00Z",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "example": "sent",
            "type": "string"
          },
          "subject": {
            "example": "Subject line",
            "type": "string"
          },
          "threadId": {
            "example": "thread-id",
            "type": "string"
          },
          "toAddress": {
            "example": "+0987654321",
            "type": "string"
          },
          "type": {
            "enum": [
              "SMS",
              "EMAIL",
              "WHATSAPP",
              "TELEGRAM",
              "WIDGET"
            ],
            "example": "SMS",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateMessageThreadDto": {
        "properties": {
          "assignedTo": {
            "example": "user-id",
            "type": "string"
          },
          "assignedToId": {
            "example": "user-id",
            "type": "string"
          },
          "customJson": {
            "example": {
              "priority": "high"
            },
            "type": "object"
          },
          "externalId": {
            "example": "twilio-sid-123",
            "type": "string"
          },
          "fromEmail": {
            "example": "sender@example.com",
            "type": "string"
          },
          "fromNumber": {
            "example": "+1234567890",
            "type": "string"
          },
          "starred": {
            "example": true,
            "type": "boolean"
          },
          "status": {
            "enum": [
              "OPEN",
              "CLOSED",
              "NEEDS_REPLY",
              "SPAM",
              "ARCHIVED",
              "active",
              "archived",
              "closed"
            ],
            "example": "OPEN",
            "type": "string"
          },
          "subject": {
            "example": "Subject of the message",
            "type": "string"
          },
          "tags": {
            "example": [
              "priority",
              "vip"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "toEmail": {
            "example": "recipient@example.com",
            "type": "string"
          },
          "toNumber": {
            "example": "+0987654321",
            "type": "string"
          },
          "type": {
            "enum": [
              "SMS",
              "EMAIL",
              "WHATSAPP",
              "TELEGRAM",
              "WIDGET"
            ],
            "example": "SMS",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateMessagingSettingsDto": {
        "properties": {
          "consent": {
            "$ref": "#/components/schemas/ConsentSettingsDto"
          },
          "extra": {
            "description": "Extra config bucket for future use",
            "example": {},
            "type": "object"
          },
          "quietHours": {
            "$ref": "#/components/schemas/QuietHoursDto"
          },
          "smsThrottle": {
            "$ref": "#/components/schemas/SmsThrottleDto"
          }
        },
        "type": "object"
      },
      "UpdateNapChangeNotesDto": {
        "properties": {
          "notes": {
            "example": "Business requested no further changes.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateNotificationPreferencesDto": {
        "properties": {
          "emailNotifications": {
            "$ref": "#/components/schemas/EmailNotificationsDto"
          },
          "emailPreferences": {
            "$ref": "#/components/schemas/EmailPreferencesDto"
          },
          "pushNotifications": {
            "$ref": "#/components/schemas/PushNotificationsDto"
          }
        },
        "required": [
          "emailNotifications",
          "pushNotifications",
          "emailPreferences"
        ],
        "type": "object"
      },
      "UpdateNotificationsDto": {
        "properties": {
          "notifications": {
            "description": "Notification settings object",
            "example": {
              "email": {
                "activities": false,
                "deals": true,
                "reports": true,
                "tasks": true
              },
              "push": {
                "activities": true,
                "deals": false,
                "reports": false,
                "tasks": true
              },
              "sms": {
                "activities": false,
                "deals": false,
                "reports": false,
                "tasks": false
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateOnboardingProgressDto": {
        "properties": {
          "aiBrainTrained": {
            "type": "boolean"
          },
          "bookingSystemSetup": {
            "type": "boolean"
          },
          "businessProfileComplete": {
            "type": "boolean"
          },
          "chatWidgetSetup": {
            "type": "boolean"
          },
          "contactsImported": {
            "type": "boolean"
          },
          "firstShareCompleted": {
            "type": "boolean"
          },
          "paymentsSetup": {
            "type": "boolean"
          },
          "teamInvited": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UpdateOrganizationDto": {
        "properties": {
          "address": {
            "description": "Accepts either a free-form address string (legacy textarea) OR a structured `OrgAddressDto`. Pass `null` to clear.",
            "example": {
              "city": "New York",
              "state": "NY",
              "street": "123 Main St",
              "zip": "10001"
            },
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrgAddressDto"
              },
              {
                "type": "string"
              }
            ]
          },
          "addressJson": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrgAddressDto"
              }
            ],
            "description": "Legacy serialized address blob. The server JSON-stringifies this into the `addressJson` column on write. Prefer the structured `address` field for new code.",
            "example": {
              "city": "New York",
              "state": "NY",
              "street": "123 Main St",
              "zip": "10001"
            }
          },
          "agencySettings": {
            "$ref": "#/components/schemas/AgencySettingsDto"
          },
          "billingModel": {
            "enum": [
              "agency_pays",
              "client_pays",
              "hybrid"
            ],
            "type": "string"
          },
          "businessHours": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrgBusinessHoursDto"
              }
            ],
            "description": "Business hours definition keyed by weekday. Pass `null` to clear (organization will use the global default schedule)."
          },
          "callIntelligenceEnabled": {
            "description": "Enable or disable post-call intelligence (transcription analysis, summaries, action items)",
            "example": true,
            "type": "boolean"
          },
          "clientOnboardingStatus": {
            "enum": [
              "PENDING",
              "IN_PROGRESS",
              "COMPLETED",
              "SUSPENDED"
            ],
            "type": "string"
          },
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "domain": {
            "example": "acme.com",
            "type": "string"
          },
          "industry": {
            "description": "Industry slug. The canonical list lives in `industry.enum.ts`; FE picks values from this enum. Adding values requires a BE deploy + `openapi:emit`.",
            "enum": [
              "general",
              "construction",
              "general_contractor",
              "roofing",
              "hvac",
              "plumbing",
              "electrical",
              "solar",
              "garage",
              "pest_control",
              "pool_service",
              "appliance_repair",
              "restoration",
              "moving",
              "legal",
              "insurance",
              "healthcare",
              "medical",
              "automotive",
              "real-estate",
              "realestate",
              "salon",
              "fitness",
              "restaurant",
              "dental",
              "spa",
              "home_services",
              "consulting",
              "cleaning",
              "landscaping",
              "painting",
              "photography",
              "event_planning",
              "pet_services",
              "education",
              "transportation",
              "it_services",
              "accounting",
              "seo_services",
              "marketing_agency",
              "advertising_agency",
              "other"
            ],
            "example": "roofing",
            "type": "string"
          },
          "invoiceBranding": {
            "$ref": "#/components/schemas/InvoiceBrandingDto"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "managedByAgency": {
            "example": false,
            "type": "boolean"
          },
          "managerEmail": {
            "example": "gm@acme.com",
            "type": "string"
          },
          "managerPhone": {
            "example": "+15551234567",
            "type": "string"
          },
          "marketingNapProfile": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MarketingNapProfileDto"
              }
            ],
            "description": "Canonical NAP (name, address, phone) profile for listings and citations"
          },
          "marketingServiceAreaZipCodes": {
            "description": "Zip codes or service areas targeted by marketing campaigns",
            "example": [
              "75201",
              "75202"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "marketingVerticals": {
            "description": "Marketing vertical tags that help drive AI recommendations",
            "example": [
              "hvac",
              "plumbing"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "example": "Acme Corporation",
            "type": "string"
          },
          "phone": {
            "example": "+1-555-0123",
            "type": "string"
          },
          "reviewLink": {
            "example": "https://reviews.acme.com/share",
            "type": "string"
          },
          "settings": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrgSettingsDto"
              }
            ],
            "description": "Organization-level preference blob (workflow defaults, email send transport, etc). Persisted as a merge into `Organization.settings` (`Json?`) — keys not present on the request keep their existing values."
          },
          "timezone": {
            "example": "America/New_York",
            "type": "string"
          },
          "type": {
            "enum": [
              "AGENCY",
              "CLIENT",
              "STANDALONE"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateOrganizationSettingsDto": {
        "properties": {
          "currency": {
            "description": "Default currency code for invoices/workflows.",
            "example": "USD",
            "type": "string"
          },
          "ownerEmail": {
            "description": "Primary owner email used in workflow variables.",
            "type": "string"
          },
          "ownerId": {
            "description": "User ID of the primary owner.",
            "type": "string"
          },
          "ownerPhone": {
            "description": "Primary owner phone number (E.164 recommended).",
            "type": "string"
          },
          "supportEmail": {
            "description": "Support email displayed in templates.",
            "type": "string"
          },
          "supportPhone": {
            "description": "Support phone number displayed in templates.",
            "type": "string"
          },
          "timezone": {
            "description": "Default timezone for workflows.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdatePipelineDto": {
        "properties": {
          "isDefault": {
            "description": "Set as default pipeline",
            "type": "boolean"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "description": "Pipeline name",
            "type": "string"
          },
          "stages": {
            "description": "Pipeline stages",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdatePreferencesDto": {
        "properties": {
          "preferences": {
            "description": "User preferences object",
            "example": {
              "currency": "USD",
              "dashboard": "default",
              "dateFormat": "MM/DD/YYYY",
              "defaultView": "list",
              "theme": "light",
              "timeFormat": "12h"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdatePresenceDto": {
        "properties": {
          "status": {
            "default": "ONLINE",
            "enum": [
              "ONLINE",
              "AWAY",
              "BUSY",
              "OFFLINE"
            ],
            "type": "string"
          },
          "statusMessage": {
            "example": "In a meeting until 3pm",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdatePricingPlanDto": {
        "properties": {
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "description": {
            "example": "Best for growing teams",
            "type": "string"
          },
          "features": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "industry": {
            "example": "home_services",
            "type": "string"
          },
          "limitations": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "maxStorage": {
            "example": 100,
            "type": "number"
          },
          "maxUsers": {
            "example": 5,
            "type": "number"
          },
          "name": {
            "example": "Pro",
            "type": "string"
          },
          "popular": {
            "example": true,
            "type": "boolean"
          },
          "priceMonthly": {
            "example": 99,
            "type": "number"
          },
          "priceYearly": {
            "example": 990,
            "type": "number"
          },
          "recommended": {
            "example": false,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UpdatePricingTierDto": {
        "properties": {
          "billingInterval": {
            "description": "Billing interval",
            "enum": [
              "MONTHLY",
              "YEARLY"
            ],
            "example": "YEARLY",
            "type": "string"
          },
          "description": {
            "description": "Description of the pricing tier",
            "example": "Updated description for the pricing tier",
            "type": "string"
          },
          "features": {
            "description": "List of features included in this tier",
            "example": [
              "Updated Feature 1",
              "Updated Feature 2"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "isActive": {
            "description": "Whether the tier is active",
            "example": false,
            "type": "boolean"
          },
          "limits": {
            "description": "Usage limits for this tier",
            "example": {
              "activities": 4000,
              "contacts": 2000,
              "deals": 400,
              "storage": "20GB"
            },
            "type": "object"
          },
          "name": {
            "description": "Name of the pricing tier",
            "example": "Updated Tier Name",
            "type": "string"
          },
          "priceCents": {
            "description": "Price in cents",
            "example": 12900,
            "type": "number"
          }
        },
        "type": "object"
      },
      "UpdateProfileDto": {
        "properties": {
          "firstName": {
            "description": "First name of the user",
            "maxLength": 50,
            "type": "string"
          },
          "lastName": {
            "description": "Last name of the user",
            "maxLength": 50,
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateProjectDto": {
        "properties": {
          "budgetCents": {
            "description": "Budget in cents",
            "example": 5000000,
            "type": "number"
          },
          "companyId": {
            "example": "company-id",
            "type": "string"
          },
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "customJson": {
            "type": "object"
          },
          "dealId": {
            "example": "deal-id",
            "type": "string"
          },
          "description": {
            "example": "Complete redesign of company website",
            "type": "string"
          },
          "name": {
            "example": "Website Redesign Project",
            "type": "string"
          },
          "phases": {
            "items": {
              "$ref": "#/components/schemas/CreateProjectPhaseDto"
            },
            "type": "array"
          },
          "progressPercent": {
            "description": "Progress percentage (0-100)",
            "example": 0,
            "type": "number"
          },
          "startDate": {
            "type": "string"
          },
          "status": {
            "example": "planning",
            "type": "string"
          },
          "targetCompletionDate": {
            "type": "string"
          },
          "targetDate": {
            "description": "Alias for targetCompletionDate",
            "type": "string"
          },
          "templateId": {
            "example": "template-id",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateProjectTemplateDto": {
        "properties": {
          "category": {
            "example": "web-development",
            "type": "string"
          },
          "customJson": {
            "type": "object"
          },
          "description": {
            "example": "Standard template for website development projects",
            "type": "string"
          },
          "estimatedCostCents": {
            "description": "Estimated cost in cents",
            "example": 5000000,
            "type": "number"
          },
          "estimatedHours": {
            "description": "Estimated hours",
            "example": 40,
            "type": "number"
          },
          "isDefault": {
            "example": false,
            "type": "boolean"
          },
          "name": {
            "example": "Website Development Template",
            "type": "string"
          },
          "phases": {
            "example": [
              {
                "name": "Planning",
                "order": 0,
                "status": "not_started"
              },
              {
                "name": "Design",
                "order": 1,
                "status": "not_started"
              },
              {
                "name": "Development",
                "order": 2,
                "status": "not_started"
              },
              {
                "name": "Testing",
                "order": 3,
                "status": "not_started"
              },
              {
                "name": "Launch",
                "order": 4,
                "status": "not_started"
              }
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdateReferralProgramDto": {
        "properties": {
          "advocateRewardAmount": {
            "type": "number"
          },
          "advocateRewardType": {
            "enum": [
              "credits",
              "cash",
              "discount",
              "perk"
            ],
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "friendRewardAmount": {
            "type": "number"
          },
          "friendRewardType": {
            "enum": [
              "credits",
              "cash",
              "discount",
              "perk"
            ],
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "maxReferralsPerAdvocate": {
            "type": "number"
          },
          "minPurchaseAmount": {
            "type": "number"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateRequirementStatusDto": {
        "properties": {
          "dueDate": {
            "description": "Due date for the requirement",
            "example": "2024-02-15T00:00:00Z",
            "type": "string"
          },
          "notes": {
            "description": "Notes about the status update",
            "example": "Documentation submitted for review",
            "type": "string"
          },
          "status": {
            "description": "New status for the compliance requirement",
            "enum": [
              "NOT_STARTED",
              "IN_PROGRESS",
              "COMPLETED",
              "REJECTED"
            ],
            "example": "IN_PROGRESS",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "UpdateResourceDto": {
        "properties": {
          "capacity": {
            "description": "Capacity (default 1)",
            "example": 2,
            "type": "number"
          },
          "customJson": {
            "description": "Additional custom data",
            "example": {
              "note": "shared resource"
            },
            "type": "object"
          },
          "description": {
            "description": "Free-form description of the resource",
            "example": "Shared across both bays during peak hours",
            "type": "string"
          },
          "isActive": {
            "description": "Active flag",
            "example": true,
            "type": "boolean"
          },
          "name": {
            "description": "Resource name",
            "example": "Bay 2",
            "type": "string"
          },
          "type": {
            "description": "Resource type (free-form)",
            "example": "VEHICLE",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateReviewReplyDto": {
        "properties": {
          "publish": {
            "description": "When true, publish the reply to the connected listings provider if supported.",
            "example": true,
            "type": "boolean"
          },
          "replyText": {
            "example": "Thanks for the feedback! We are reaching out to schedule a follow-up visit.",
            "type": "string"
          }
        },
        "required": [
          "replyText"
        ],
        "type": "object"
      },
      "UpdateReviewSettingsDto": {
        "properties": {
          "autoTrigger": {
            "default": "appointment_completed",
            "enum": [
              "appointment_completed",
              "job_completed"
            ],
            "type": "string"
          },
          "autoTriggers": {
            "description": "Auto triggers (spec field)",
            "example": {
              "afterAppointment": true,
              "afterInvoicePaid": false
            },
            "type": "object"
          },
          "channels": {
            "items": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "delayHours": {
            "description": "Delay before sending, in hours (spec field)",
            "example": 24,
            "type": "number"
          },
          "delayMinutes": {
            "description": "Delay before sending, in minutes",
            "example": 0,
            "type": "number"
          },
          "emailTemplateId": {
            "description": "Email template ID to use for review requests",
            "type": "string"
          },
          "fromEmail": {
            "description": "Fallback from-email address",
            "type": "string"
          },
          "fromPhone": {
            "description": "Fallback from-phone number in E.164 format",
            "type": "string"
          },
          "locationId": {
            "description": "Location override for settings",
            "type": "string"
          },
          "mode": {
            "default": "manual",
            "enum": [
              "manual",
              "auto"
            ],
            "type": "string"
          },
          "reviewUrl": {
            "description": "Primary review URL to include in messages",
            "type": "string"
          },
          "smsTemplateId": {
            "description": "SMS template ID or campaign identifier",
            "type": "string"
          },
          "template": {
            "description": "Default template (spec field)",
            "example": {
              "body": "<p>We value your feedback...</p>",
              "subject": "How did we do?"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateReviewWorkflowDto": {
        "properties": {
          "assignedToId": {
            "description": "Assign to user id. Use null to unassign.",
            "example": "usr_123",
            "type": "string"
          },
          "workflowStatus": {
            "enum": [
              "new",
              "needs_response",
              "responded",
              "resolved"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateSavedFilterDto": {
        "properties": {
          "criteria": {
            "description": "Filter criteria object using the same keys as list endpoints",
            "example": {
              "status": "inactive",
              "tags": [
                "needs-follow-up"
              ]
            },
            "type": "object"
          },
          "isFavorite": {
            "example": true,
            "type": "boolean"
          },
          "name": {
            "example": "Updated Name",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateScheduledMessageDto": {
        "properties": {
          "content": {
            "type": "string"
          },
          "scheduledAt": {
            "example": "2026-03-02T14:30:00Z",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateServiceOfferingAiMetadataDto": {
        "properties": {
          "aftercare": {
            "description": "Aftercare instructions following the service",
            "example": "We will provide a detailed report and next steps.",
            "type": "string"
          },
          "aiDescription": {
            "description": "Enhanced description for AI training",
            "example": "Comprehensive 60-minute inspection of your AC system...",
            "type": "string"
          },
          "commonQuestions": {
            "description": "Common customer questions and answers",
            "example": [
              {
                "answer": "About 60 minutes.",
                "question": "How long does it take?"
              }
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "preparationInstructions": {
            "description": "Preparation instructions for customers",
            "example": "Ensure the AC unit is accessible before the appointment.",
            "type": "string"
          },
          "targetAudience": {
            "description": "Target audience for the service",
            "example": "Homeowners experiencing cooling issues",
            "type": "string"
          },
          "whatToExpect": {
            "description": "What customers should expect during the service",
            "example": "Our technician will inspect the system and identify issues.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateServiceOfferingDto": {
        "properties": {
          "category": {
            "example": "cleaning",
            "type": "string"
          },
          "color": {
            "description": "Hex color code for calendar display",
            "example": "#3B82F6",
            "type": "string"
          },
          "customJson": {
            "example": {
              "bufferTime": 15,
              "requiresDeposit": true
            },
            "type": "object"
          },
          "description": {
            "example": "Professional house cleaning service",
            "type": "string"
          },
          "duration": {
            "description": "Duration in minutes",
            "example": 60,
            "type": "number"
          },
          "durationMin": {
            "deprecated": true,
            "description": "Legacy field; use duration instead (minutes)",
            "type": "number"
          },
          "isActive": {
            "description": "Whether the service offering is active",
            "example": true,
            "type": "boolean"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "example": "House Cleaning",
            "type": "string"
          },
          "ownerId": {
            "example": "user-id",
            "type": "string"
          },
          "price": {
            "description": "Price in dollars",
            "example": 50,
            "type": "number"
          },
          "priceCents": {
            "deprecated": true,
            "description": "Legacy field; use price instead (cents)",
            "type": "number"
          }
        },
        "type": "object"
      },
      "UpdateSessionContextDto": {
        "properties": {
          "customContext": {
            "example": {
              "products": [
                "Enterprise Plan"
              ],
              "urgency": "high"
            },
            "type": "object"
          },
          "intent": {
            "example": "pricing",
            "type": "string"
          },
          "leadScore": {
            "example": 75,
            "maximum": 100,
            "minimum": 0,
            "type": "number"
          },
          "resolutionConfidence": {
            "example": 0.85,
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "sentimentScore": {
            "example": 0.8,
            "maximum": 1,
            "minimum": -1,
            "type": "number"
          }
        },
        "type": "object"
      },
      "UpdateSessionStatusDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateSiteBlockDto": {
        "properties": {
          "content": {
            "description": "New content JSON",
            "type": "object"
          },
          "metadata": {
            "description": "Metadata updates",
            "type": "object"
          },
          "variant": {
            "description": "Update block variant",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateSiteMetadataDto": {
        "properties": {
          "description": {
            "description": "Short description for the site.",
            "type": "string"
          },
          "heroStatement": {
            "description": "Hero statement / subtitle.",
            "type": "string"
          },
          "palette": {
            "description": "Color palette metadata",
            "type": "object"
          },
          "primaryGoal": {
            "description": "Primary conversion goal (book, call, form).",
            "type": "string"
          },
          "theme": {
            "description": "Global theme settings (typography, spacing, etc.)",
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateSitePageDto": {
        "properties": {
          "description": {
            "description": "Meta description",
            "type": "string"
          },
          "hero": {
            "description": "Optional hero overrides for this page",
            "type": "object"
          },
          "order": {
            "description": "New display order index",
            "type": "number"
          },
          "seo": {
            "description": "SEO config JSON",
            "type": "object"
          },
          "title": {
            "description": "Page title",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateSmsTemplateApiDto": {
        "properties": {
          "category": {
            "example": "promotion",
            "type": "string"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "message": {
            "example": "Hi {{firstName}}, save 20% this week. Reply STOP to opt out.",
            "type": "string"
          },
          "name": {
            "example": "Promo - Winter Discount",
            "type": "string"
          },
          "variables": {
            "example": [
              "{{firstName}}",
              "{{appointmentTime}}"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdateStaffDto": {
        "properties": {
          "bio": {
            "example": "Experienced HVAC technician with 10+ years",
            "type": "string"
          },
          "calendarId": {
            "example": "google-calendar-id",
            "type": "string"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "skills": {
            "example": [
              "hvac",
              "maintenance",
              "repair"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "example": "Senior Technician",
            "type": "string"
          },
          "userId": {
            "example": "user-id",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateSurveyCampaignDto": {
        "properties": {
          "channelStrategy": {
            "description": "Channel sequencing, review thresholds, etc.",
            "type": "object"
          },
          "cooldownDays": {
            "description": "Days before the same contact can receive this campaign again",
            "example": 30,
            "type": "number"
          },
          "defaultDelayMinutes": {
            "description": "Delay in minutes before sending invitations",
            "example": 120,
            "type": "number"
          },
          "name": {
            "example": "Post-appointment follow-up",
            "type": "string"
          },
          "status": {
            "example": "paused",
            "type": "string"
          },
          "targetFilters": {
            "description": "Targeting filters (services, staff, tags, etc.)",
            "type": "object"
          },
          "templateId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateSurveyFrontendDto": {
        "properties": {
          "description": {
            "type": "string"
          },
          "questions": {
            "items": {
              "$ref": "#/components/schemas/FrontendSurveyQuestionDto"
            },
            "type": "array"
          },
          "settings": {
            "type": "object"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateSurveyTemplateDto": {
        "properties": {
          "channels": {
            "example": [
              "EMAIL",
              "SMS"
            ],
            "items": {
              "type": "string",
              "enum": [
                "EMAIL",
                "SMS",
                "WHATSAPP",
                "CHAT_WIDGET",
                "TICKET",
                "CALL_IVR"
              ]
            },
            "type": "array"
          },
          "description": {
            "example": "Sent 2 hours after appointment completion",
            "type": "string"
          },
          "name": {
            "example": "Post-Appointment NPS",
            "type": "string"
          },
          "questions": {
            "description": "Ordered list of questions to display",
            "items": {
              "$ref": "#/components/schemas/SurveyQuestionInputDto"
            },
            "type": "array"
          },
          "scoreType": {
            "enum": [
              "NPS",
              "CSAT",
              "CES",
              "CUSTOM"
            ],
            "example": "NPS",
            "type": "string"
          },
          "theme": {
            "description": "Custom theme (colors, fonts, etc.)",
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateSurveyTemplateStatusDto": {
        "properties": {
          "isActive": {
            "example": true,
            "type": "boolean"
          }
        },
        "required": [
          "isActive"
        ],
        "type": "object"
      },
      "UpdateSurveyTriggerDto": {
        "properties": {
          "delayMinutes": {
            "description": "Delay in minutes before sending invitations",
            "example": 120,
            "type": "number"
          },
          "entityFilters": {
            "description": "Filters for matching events (serviceIds, staffIds, etc.)",
            "type": "object"
          },
          "isActive": {
            "default": true,
            "type": "boolean"
          },
          "type": {
            "enum": [
              "APPOINTMENT_COMPLETED",
              "TICKET_RESOLVED",
              "CALL_COMPLETED",
              "CHAT_ENDED",
              "WORKFLOW_NODE",
              "MANUAL"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTagDto": {
        "properties": {
          "color": {
            "example": "#ef4444",
            "type": "string"
          },
          "description": {
            "example": "High-value customers requiring priority service",
            "type": "string"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. Use null to move this tag to global defaults.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "example": "VIP",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTaskDto": {
        "properties": {
          "companyId": {
            "description": "Related company ID",
            "example": "company_456",
            "type": "string"
          },
          "contactId": {
            "description": "Related contact ID",
            "example": "contact_123",
            "type": "string"
          },
          "customJson": {
            "description": "Custom JSON data",
            "example": "{\"customField\": \"value\"}",
            "type": "object"
          },
          "dealId": {
            "description": "Related deal ID",
            "example": "deal_789",
            "type": "string"
          },
          "description": {
            "description": "Task description",
            "example": "Call client to discuss project timeline",
            "type": "string"
          },
          "dueAt": {
            "description": "Task due date",
            "example": "2024-01-15T17:00:00Z",
            "type": "string"
          },
          "estimatedHours": {
            "description": "Estimated hours for this task",
            "example": 2.5,
            "type": "number"
          },
          "ownerId": {
            "description": "Task owner ID",
            "example": "user_123",
            "type": "string"
          },
          "phaseId": {
            "description": "Related project phase ID",
            "example": "phase_456",
            "type": "string"
          },
          "priority": {
            "description": "Task priority",
            "enum": [
              "LOW",
              "MEDIUM",
              "HIGH"
            ],
            "example": "HIGH",
            "type": "string"
          },
          "projectId": {
            "description": "Related project ID",
            "example": "project_123",
            "type": "string"
          },
          "stage": {
            "description": "Task stage (e.g., todo, in_progress, review, done)",
            "example": "todo",
            "type": "string"
          },
          "status": {
            "description": "Task status",
            "enum": [
              "OPEN",
              "DONE"
            ],
            "example": "DONE",
            "type": "string"
          },
          "title": {
            "description": "Task title",
            "example": "Follow up with client",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTeamChannelDto": {
        "properties": {
          "color": {
            "example": "#22c55e",
            "type": "string"
          },
          "description": {
            "example": "Updated description",
            "type": "string"
          },
          "icon": {
            "example": "📌",
            "type": "string"
          },
          "name": {
            "example": "general-2",
            "type": "string"
          },
          "unarchive": {
            "description": "Unarchive channel if currently archived",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UpdateTeamHubSettingsDto": {
        "properties": {
          "notify_channel_messages": {
            "default": true,
            "type": "boolean"
          },
          "notify_dms": {
            "default": true,
            "type": "boolean"
          },
          "notify_mentions": {
            "default": true,
            "type": "boolean"
          },
          "show_online_status": {
            "default": true,
            "type": "boolean"
          },
          "show_typing_indicators": {
            "default": true,
            "type": "boolean"
          },
          "sound_enabled": {
            "default": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UpdateTeamMemberDto": {
        "properties": {
          "avatarUrl": {
            "example": "https://cdn.example.com/avatar.jpg",
            "type": "string"
          },
          "email": {
            "example": "john.doe@example.com",
            "type": "string"
          },
          "firstName": {
            "example": "John",
            "type": "string"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "lastName": {
            "example": "Doe",
            "type": "string"
          },
          "phone": {
            "example": "+1-555-0123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTerminologyDto": {
        "properties": {
          "activities": {
            "example": "Activities",
            "type": "string"
          },
          "activity": {
            "example": "Activity",
            "type": "string"
          },
          "appointment": {
            "example": "Appointment",
            "type": "string"
          },
          "appointments": {
            "example": "Appointments",
            "type": "string"
          },
          "call": {
            "example": "Call",
            "type": "string"
          },
          "calls": {
            "example": "Calls",
            "type": "string"
          },
          "companies": {
            "example": "Companies",
            "type": "string"
          },
          "company": {
            "example": "Company",
            "type": "string"
          },
          "contact": {
            "example": "Client",
            "type": "string"
          },
          "contacts": {
            "example": "Clients",
            "type": "string"
          },
          "contract": {
            "example": "Contract",
            "type": "string"
          },
          "contracts": {
            "example": "Contracts",
            "type": "string"
          },
          "customer": {
            "example": "Customer",
            "type": "string"
          },
          "customers": {
            "example": "Customers",
            "type": "string"
          },
          "deal": {
            "example": "Deal",
            "type": "string"
          },
          "deals": {
            "example": "Deals",
            "type": "string"
          },
          "document": {
            "example": "Document",
            "type": "string"
          },
          "documents": {
            "example": "Documents",
            "type": "string"
          },
          "email": {
            "example": "Email",
            "type": "string"
          },
          "emails": {
            "example": "Emails",
            "type": "string"
          },
          "invoice": {
            "example": "Invoice",
            "type": "string"
          },
          "invoices": {
            "example": "Invoices",
            "type": "string"
          },
          "lead": {
            "example": "Lead",
            "type": "string"
          },
          "leads": {
            "example": "Leads",
            "type": "string"
          },
          "meeting": {
            "example": "Meeting",
            "type": "string"
          },
          "meetings": {
            "example": "Meetings",
            "type": "string"
          },
          "note": {
            "example": "Note",
            "type": "string"
          },
          "notes": {
            "example": "Notes",
            "type": "string"
          },
          "opportunities": {
            "example": "Opportunities",
            "type": "string"
          },
          "opportunity": {
            "example": "Opportunity",
            "type": "string"
          },
          "payment": {
            "example": "Payment",
            "type": "string"
          },
          "payments": {
            "example": "Payments",
            "type": "string"
          },
          "pipeline": {
            "example": "Pipeline",
            "type": "string"
          },
          "pipelines": {
            "example": "Pipelines",
            "type": "string"
          },
          "proposal": {
            "example": "Proposal",
            "type": "string"
          },
          "proposals": {
            "example": "Proposals",
            "type": "string"
          },
          "quote": {
            "example": "Quote",
            "type": "string"
          },
          "quotes": {
            "example": "Quotes",
            "type": "string"
          },
          "stage": {
            "example": "Stage",
            "type": "string"
          },
          "stages": {
            "example": "Stages",
            "type": "string"
          },
          "task": {
            "example": "Task",
            "type": "string"
          },
          "tasks": {
            "example": "Tasks",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTicketCategoryDto": {
        "properties": {
          "color": {
            "description": "Tailwind color class, e.g. \"bg-red-500\"",
            "type": "string"
          },
          "description": {
            "description": "Optional category description",
            "type": "string"
          },
          "name": {
            "description": "Category name",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTicketDto": {
        "properties": {
          "aiCategory": {
            "description": "AI-classified category",
            "type": "string"
          },
          "aiPriority": {
            "description": "AI-classified priority",
            "enum": [
              "URGENT",
              "HIGH",
              "MEDIUM",
              "LOW"
            ],
            "type": "string"
          },
          "aiSentiment": {
            "description": "AI-detected sentiment (e.g. positive/neutral/negative)",
            "type": "string"
          },
          "assignedTeam": {
            "description": "Team name to assign the ticket to",
            "type": "string"
          },
          "assignedToId": {
            "description": "User ID to assign the ticket to",
            "type": "string"
          },
          "category": {
            "description": "Ticket category",
            "type": "string"
          },
          "companyId": {
            "description": "Company ID if ticket is related to a company",
            "type": "string"
          },
          "contactId": {
            "description": "Contact ID if ticket is related to a contact",
            "type": "string"
          },
          "customJson": {
            "description": "Additional custom data as JSON string",
            "type": "string"
          },
          "description": {
            "description": "Detailed description of the issue",
            "type": "string"
          },
          "dueDate": {
            "description": "Due date for ticket resolution",
            "type": "string"
          },
          "messageThreadId": {
            "description": "Message thread ID if ticket originated from a conversation",
            "type": "string"
          },
          "priority": {
            "default": "MEDIUM",
            "enum": [
              "URGENT",
              "HIGH",
              "MEDIUM",
              "LOW"
            ],
            "type": "string"
          },
          "source": {
            "default": "MANUAL",
            "enum": [
              "EMAIL",
              "SMS",
              "WHATSAPP",
              "WEB_FORM",
              "PHONE",
              "API",
              "MANUAL",
              "CHAT"
            ],
            "type": "string"
          },
          "status": {
            "default": "OPEN",
            "enum": [
              "OPEN",
              "IN_PROGRESS",
              "WAITING_ON_CUSTOMER",
              "WAITING_ON_THIRD_PARTY",
              "RESOLVED",
              "CLOSED",
              "CANCELLED"
            ],
            "type": "string"
          },
          "subcategory": {
            "description": "Ticket subcategory",
            "type": "string"
          },
          "subject": {
            "description": "Ticket subject/title",
            "type": "string"
          },
          "tags": {
            "description": "Ticket tags",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "UpdateTicketPriorityDto": {
        "properties": {
          "color": {
            "description": "Tailwind color classes, e.g. \"bg-red-500 text-red-500\"",
            "type": "string"
          },
          "description": {
            "description": "Optional priority description",
            "type": "string"
          },
          "isDefault": {
            "description": "Whether this is the default priority for new tickets",
            "type": "boolean"
          },
          "level": {
            "description": "Sort order level (1 = highest priority)",
            "minimum": 1,
            "type": "number"
          },
          "name": {
            "description": "Priority name",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTicketSlaDto": {
        "properties": {
          "escalationEnabled": {
            "description": "Whether escalation is enabled for this SLA",
            "type": "boolean"
          },
          "firstResponseTime": {
            "description": "First response time value",
            "minimum": 1,
            "type": "number"
          },
          "isActive": {
            "description": "Whether this SLA is active",
            "type": "boolean"
          },
          "name": {
            "description": "SLA name",
            "type": "string"
          },
          "prioritySettingId": {
            "description": "Linked priority setting ID",
            "type": "string"
          },
          "resolutionTime": {
            "description": "Resolution time value",
            "minimum": 1,
            "type": "number"
          },
          "timeUnit": {
            "description": "Time unit for both response and resolution times",
            "enum": [
              "hours",
              "days"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTicketTemplateDto": {
        "properties": {
          "category": {
            "description": "Optional category (e.g., \"Billing\")",
            "type": "string"
          },
          "content": {
            "description": "Template content (supports {{variable.paths}})",
            "type": "string"
          },
          "isActive": {
            "default": true,
            "description": "Enable/disable without deleting",
            "type": "boolean"
          },
          "shortcut": {
            "description": "Optional shortcut (e.g., \"/reset\")",
            "type": "string"
          },
          "title": {
            "description": "Template title (e.g., \"Password Reset\")",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTimeEntryDto": {
        "properties": {
          "billableRateCents": {
            "description": "Billable rate in cents per hour",
            "example": 10000,
            "type": "number"
          },
          "contactId": {
            "example": "contact-id",
            "type": "string"
          },
          "customJson": {
            "type": "object"
          },
          "description": {
            "example": "Worked on feature implementation",
            "type": "string"
          },
          "durationMinutes": {
            "description": "Duration in minutes",
            "example": 120,
            "type": "number"
          },
          "endedAt": {
            "example": "2024-01-15T12:00:00Z",
            "type": "string"
          },
          "invoiceId": {
            "example": "invoice-id",
            "type": "string"
          },
          "isBillable": {
            "example": true,
            "type": "boolean"
          },
          "projectId": {
            "example": "project-id",
            "type": "string"
          },
          "startedAt": {
            "example": "2024-01-15T10:00:00Z",
            "type": "string"
          },
          "taskId": {
            "example": "task-id",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateTimeOffDto": {
        "properties": {
          "endDate": {
            "example": "2025-02-05",
            "type": "string"
          },
          "reason": {
            "example": "Family vacation",
            "type": "string"
          },
          "startDate": {
            "example": "2025-02-01",
            "type": "string"
          },
          "type": {
            "default": "OTHER",
            "enum": [
              "VACATION",
              "SICK",
              "PERSONAL",
              "OTHER"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateUnifiedAgentDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateUserPermissionsDto": {
        "properties": {
          "canManageClients": {
            "description": "Toggle client management capabilities for the current user",
            "example": true,
            "type": "boolean"
          }
        },
        "required": [
          "canManageClients"
        ],
        "type": "object"
      },
      "UpdateUserPreferencesDto": {
        "properties": {
          "dismissedTips": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "messageDrafts": {
            "type": "object"
          },
          "onboardingProgress": {
            "example": {
              "completedSteps": [],
              "skippedSteps": []
            },
            "type": "object"
          },
          "savedFilters": {
            "type": "object"
          },
          "uiPreferences": {
            "example": {
              "compactMode": false,
              "defaultCalendarView": "week",
              "sidebarCollapsed": false,
              "theme": "system"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpdateVoicemailDropDto": {
        "properties": {
          "audioUrl": {
            "description": "Direct audio URL (if not using fileId)",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "durationSeconds": {
            "description": "Duration in seconds (used for UI)",
            "type": "number"
          },
          "fileId": {
            "description": "ID of a previously uploaded file asset",
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "transcript": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateWebhookDto": {
        "properties": {
          "events": {
            "description": "List of events to subscribe to",
            "example": [
              "company.created",
              "contact.updated",
              "deal.won"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secret": {
            "description": "Custom webhook secret (auto-generated if not provided)",
            "example": "whsec_your_webhook_secret_here",
            "type": "string"
          },
          "url": {
            "example": "https://api.example.com/webhooks",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateWidgetConfigDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateWidgetReadDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateWidgetTypingDto": {
        "properties": {},
        "type": "object"
      },
      "UpdateWidgetWebhookDto": {
        "properties": {
          "description": {
            "description": "Admin-facing description.",
            "maxLength": 200,
            "type": "string"
          },
          "enabled": {
            "default": true,
            "description": "Whether delivery is enabled.",
            "type": "boolean"
          },
          "events": {
            "description": "Subscribed event keys.",
            "items": {
              "type": "string",
              "enum": [
                "widget.chat.started",
                "widget.chat.message",
                "widget.chat.ended",
                "widget.lead.captured",
                "widget.booking.requested",
                "widget.phone.call"
              ]
            },
            "type": "array"
          },
          "url": {
            "description": "HTTPS endpoint URL.",
            "maxLength": 2048,
            "type": "string"
          },
          "widgetConfigId": {
            "description": "Widget config scope. Null means all widgets in the org.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateWorkflowDto": {
        "properties": {
          "definition": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowDefinitionDto"
              }
            ],
            "deprecated": true,
            "description": "Builder-shaped graph wrapper. The server lifts `definition.nodes` / `definition.edges` onto the root before validation. Prefer sending `nodes` / `edges` at the root directly."
          },
          "description": {
            "example": "Automates the customer onboarding process",
            "type": "string"
          },
          "edges": {
            "description": "Workflow graph edges. Edges referencing unknown nodes are dropped server-side rather than 400ing the save.",
            "items": {
              "$ref": "#/components/schemas/WorkflowEdgeDto"
            },
            "type": "array"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "locationId": {
            "description": "Multi-location v1: optional locationId. If omitted, defaults to the active location (X-Location-Id) when present; otherwise creates a global default.",
            "nullable": true,
            "type": "string"
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowMetadataDto"
              }
            ],
            "description": "Workflow metadata including AI conversation history and builder source tags."
          },
          "name": {
            "example": "New Customer Onboarding",
            "type": "string"
          },
          "nodes": {
            "description": "Workflow graph nodes. Sparse/null entries emitted by the builder during edits are tolerated and stripped server-side.",
            "items": {
              "$ref": "#/components/schemas/WorkflowNodeDto"
            },
            "type": "array"
          },
          "trigger": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowTriggerDto"
              }
            ],
            "description": "Trigger object for quick-start templates (type + config)."
          },
          "triggerConfig": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowTriggerConfigDto"
              }
            ],
            "description": "Trigger configuration scoped to `triggerType`. Cron schedule for SCHEDULED, event filter for EVENT, webhook secret for WEBHOOK, ignored for MANUAL."
          },
          "triggerType": {
            "enum": [
              "MANUAL",
              "SCHEDULED",
              "EVENT",
              "WEBHOOK"
            ],
            "example": "MANUAL",
            "type": "string"
          }
        },
        "type": "object"
      },
      "UploadDocumentDto": {
        "properties": {
          "documentType": {
            "description": "Type of document being uploaded",
            "example": "INSURANCE_CERTIFICATE",
            "type": "string"
          },
          "dueDate": {
            "description": "Due date for the requirement",
            "example": "2024-02-15T00:00:00Z",
            "type": "string"
          },
          "notes": {
            "description": "Notes about the document",
            "example": "Insurance certificate for 2024",
            "type": "string"
          },
          "requirementId": {
            "description": "ID of the compliance requirement",
            "example": "req_123",
            "type": "string"
          },
          "uploadedBy": {
            "description": "ID of the user uploading the document",
            "example": "user_123",
            "type": "string"
          }
        },
        "required": [
          "requirementId",
          "documentType",
          "uploadedBy"
        ],
        "type": "object"
      },
      "UploadKnowledgeDocumentDto": {
        "properties": {
          "fileName": {
            "description": "Optional original file name",
            "example": "pricing.xlsx",
            "type": "string"
          },
          "fileUrl": {
            "description": "File URL (for file uploads like pdf/docx/xlsx) – e.g. Filestack/S3 URL.",
            "type": "string"
          },
          "mimeType": {
            "description": "Optional file MIME type (helps extraction when remote servers send octet-stream)",
            "example": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
            "type": "string"
          },
          "name": {
            "description": "Display name for the document.",
            "example": "Refund Policy",
            "type": "string"
          },
          "size": {
            "description": "Optional size in bytes",
            "example": 123456,
            "type": "number"
          },
          "text": {
            "description": "Plain text content (for type=txt).",
            "type": "string"
          },
          "type": {
            "description": "Document type. \"document\" is an alias accepted from the Documents tab and is resolved to a concrete extension (pdf/doc/docx/...) from fileName/mimeType server-side.",
            "enum": [
              "txt",
              "url",
              "pdf",
              "doc",
              "docx",
              "rtf",
              "md",
              "xls",
              "xlsx",
              "notion",
              "document"
            ],
            "example": "url",
            "type": "string"
          },
          "url": {
            "description": "URL (for type=url or notion).",
            "example": "https://example.com/refunds",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type"
        ],
        "type": "object"
      },
      "UploadWidgetAttachmentDto": {
        "properties": {},
        "type": "object"
      },
      "UpsertCustomFieldValuesDto": {
        "properties": {
          "values": {
            "example": {
              "preferred_contact_method": "Email"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "UpsertForwardingRulesDto": {
        "properties": {
          "rules": {
            "items": {
              "$ref": "#/components/schemas/DialerForwardingRuleInputDto"
            },
            "type": "array"
          }
        },
        "required": [
          "rules"
        ],
        "type": "object"
      },
      "UpsertVoiceAgentConfigDto": {
        "properties": {
          "businessKeywords": {
            "description": "Operator-curated business keywords. These are brand / product / competitor names and industry jargon the caller is likely to say — the kind of proper nouns that generic STT models mis-segment. Fed to both the STT keyword-boost layer (Deepgram lane) and the post-STT keyword-repair layer (all lanes). Each entry 3–60 chars, max 25 total.",
            "example": [
              "JustCall",
              "ServiceAgent",
              "HVAC",
              "Nest thermostat",
              "Bellevue"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "callPurpose": {
            "description": "Concrete reason for outbound calls made by this agent. Short declarative sentence/fragment (\"calling to invite Gaurav to demo ServiceAgent\", \"confirming the 3pm Tuesday appointment\"). Drives the peer-AI mode first-turn statement AND adds a per-turn reminder on outbound calls so the LLM pushes toward a concrete objective instead of drifting into discovery questions. Send empty string to clear. Ignored on inbound calls.",
            "example": "calling to invite you to demo ServiceAgent",
            "maxLength": 500,
            "type": "string"
          },
          "handlingProfile": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VoiceHandlingProfileDto"
              }
            ],
            "description": "Structured AIVA handling profile used to derive category-specific runtime behavior."
          },
          "httpActions": {
            "description": "Operator-authored HTTP actions. Each entry materializes into a per-call `http_<id>` tool the LLM can invoke mid-call. Use this to wire AIVA to your own CRM, ticketing, or inventory APIs without writing TypeScript. Include the `http` scope in `toolScopes` to enable the category.",
            "items": {
              "$ref": "#/components/schemas/VoiceAgentHttpActionDto"
            },
            "type": "array"
          },
          "language": {
            "default": "en-US",
            "description": "BCP-47 language tag",
            "type": "string"
          },
          "name": {
            "description": "Display name for this voice agent",
            "maxLength": 120,
            "type": "string"
          },
          "personaTemplateId": {
            "description": "ID of the persona template this agent was created from (see `GET /v1/agents/persona-templates`). Purely for analytics — which templates convert best, which ones operators start from most often. Never read at runtime. Persisted into `VoiceAgent.configJson.personaTemplateId`. Set on agent creation and left untouched on subsequent edits.",
            "example": "outbound-sales-sdr",
            "maxLength": 100,
            "type": "string"
          },
          "provider": {
            "default": "aiva",
            "description": "Voice runtime provider",
            "enum": [
              "retell",
              "aiva"
            ],
            "type": "string"
          },
          "systemPrompt": {
            "description": "System prompt for voice agent",
            "type": "string"
          },
          "toolScopes": {
            "description": "Allowed tool scopes for this agent",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "voiceId": {
            "description": "Voice ID (provider-specific)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ValidateProjectPasscodeDto": {
        "properties": {},
        "type": "object"
      },
      "ValidateWorkflowWithAiDto": {
        "properties": {
          "workflow": {
            "$ref": "#/components/schemas/WorkflowGraphPayloadDto"
          }
        },
        "required": [
          "workflow"
        ],
        "type": "object"
      },
      "VerifyMagicLinkDto": {
        "properties": {
          "token": {
            "description": "Magic link token from URL",
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "type": "object"
      },
      "VoiceAgentHttpActionAuthDto": {
        "properties": {
          "headerName": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "type": {
            "enum": [
              "none",
              "bearer",
              "hmac_sha256"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "VoiceAgentHttpActionDto": {
        "properties": {
          "auth": {
            "$ref": "#/components/schemas/VoiceAgentHttpActionAuthDto"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "description": "Short id, alphanumeric + underscore. Becomes `http_<id>` in the LLM tool list.",
            "type": "string"
          },
          "maxResponseBytes": {
            "maximum": 16384,
            "minimum": 256,
            "type": "number"
          },
          "method": {
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE"
            ],
            "type": "string"
          },
          "mutatesState": {
            "type": "boolean"
          },
          "parameters": {
            "description": "JSON schema object describing the LLM-provided args.",
            "type": "object"
          },
          "requiresConfirmation": {
            "type": "boolean"
          },
          "responseKeys": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "timeoutMs": {
            "maximum": 8000,
            "minimum": 250,
            "type": "number"
          },
          "url": {
            "description": "Fully-qualified https:// URL.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "VoiceConfigDryRunDto": {
        "properties": {
          "history": {
            "description": "Prior conversation turns, oldest first. Omit for the first turn. Max 20 turns.",
            "items": {
              "$ref": "#/components/schemas/VoiceConfigDryRunHistoryMessageDto"
            },
            "type": "array"
          },
          "message": {
            "description": "The message to send as the current user turn. For the first turn of a rehearsal, this is whatever the simulated caller said first.",
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "VoiceConfigDryRunHistoryMessageDto": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "enum": [
              "user",
              "assistant"
            ],
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "type": "object"
      },
      "VoiceHandlingProfileDto": {
        "properties": {
          "afterHoursMode": {
            "enum": [
              "capture",
              "route",
              "emergency_triage"
            ],
            "type": "string"
          },
          "category": {
            "description": "Canonical AIVA handling category. Alias values are accepted and normalized server-side.",
            "enum": [
              "general",
              "roofing",
              "hvac",
              "plumbing",
              "electrical",
              "solar",
              "garage",
              "legal",
              "insurance",
              "medical",
              "automotive",
              "realestate",
              "salon",
              "fitness",
              "restaurant",
              "dental",
              "spa",
              "home_services",
              "consulting",
              "cleaning",
              "landscaping",
              "painting",
              "seo_services",
              "marketing_agency",
              "advertising_agency"
            ],
            "type": "string"
          },
          "multiLocation": {
            "type": "boolean"
          },
          "schedulingMode": {
            "enum": [
              "none",
              "lead_capture_only",
              "booking_enabled"
            ],
            "type": "string"
          },
          "serviceAreaMode": {
            "enum": [
              "single_location",
              "multi_location",
              "territory_based"
            ],
            "type": "string"
          },
          "transferMode": {
            "enum": [
              "never",
              "on_request",
              "qualified_only",
              "always_for_emergency"
            ],
            "type": "string"
          },
          "useCase": {
            "enum": [
              "reception",
              "support",
              "sales",
              "dispatch",
              "booking",
              "intake"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "VoiceNumberSummaryDto": {
        "properties": {
          "friendlyName": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "isPrimary": {
            "type": "boolean"
          },
          "phoneNumber": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "phoneNumber"
        ],
        "type": "object"
      },
      "VoicePreviewRequestDto": {
        "properties": {
          "text": {
            "description": "Optional custom preview text.",
            "example": "Hi! Thanks for calling. How can I help today?",
            "maxLength": 1000,
            "type": "string"
          },
          "voiceId": {
            "description": "Voice identifier. Accepts either a UI alias (rachel|michael|sarah|david) or a provider voice ID (e.g. ElevenLabs voice_id like '21m00Tcm4TlvDq8ikWAM').",
            "example": "21m00Tcm4TlvDq8ikWAM",
            "type": "string"
          }
        },
        "required": [
          "voiceId"
        ],
        "type": "object"
      },
      "VoicePreviewResponseDto": {
        "properties": {
          "audioContent": {
            "description": "Base64-encoded audio bytes (mp3).",
            "type": "string"
          },
          "audioUrl": {
            "description": "Optional URL to an audio file (if backend stores previews).",
            "type": "string"
          },
          "contentType": {
            "description": "MIME content type.",
            "example": "audio/mpeg",
            "type": "string"
          },
          "durationMs": {
            "description": "Best-effort duration in milliseconds (0 if unknown).",
            "example": 2300,
            "type": "number"
          }
        },
        "required": [
          "contentType",
          "durationMs"
        ],
        "type": "object"
      },
      "WebhookEndpointCreateResponseDto": {
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "events": {
            "description": "Event names this endpoint subscribes to (e.g. [\"appointment.booked\"]).",
            "example": [
              "appointment.booked",
              "appointment.cancelled"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "lastUsedAt": {
            "description": "When this endpoint last received an event delivery attempt.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "secret": {
            "description": "Plaintext webhook signing secret. **Returned exactly once on create.** Subsequent reads expose only `secretLast4`. Store it securely; rotate by `POST /webhooks/endpoints/:id/test` flow if it leaks.",
            "type": "string"
          },
          "secretLast4": {
            "description": "Last 4 characters of the webhook signing secret. Use this for \"ends in xxxx\" UI indicators. The full secret is only returned on the original create response — copy it then or rotate.",
            "example": "a3f9",
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "example": "https://example.com/webhook",
            "type": "string"
          }
        },
        "required": [
          "id",
          "organizationId",
          "url",
          "events",
          "isActive",
          "secretLast4",
          "createdAt",
          "updatedAt",
          "secret"
        ],
        "type": "object"
      },
      "WebhookEndpointResponseDto": {
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "events": {
            "description": "Event names this endpoint subscribes to (e.g. [\"appointment.booked\"]).",
            "example": [
              "appointment.booked",
              "appointment.cancelled"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "lastUsedAt": {
            "description": "When this endpoint last received an event delivery attempt.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "secretLast4": {
            "description": "Last 4 characters of the webhook signing secret. Use this for \"ends in xxxx\" UI indicators. The full secret is only returned on the original create response — copy it then or rotate.",
            "example": "a3f9",
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "example": "https://example.com/webhook",
            "type": "string"
          }
        },
        "required": [
          "id",
          "organizationId",
          "url",
          "events",
          "isActive",
          "secretLast4",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "WidgetBusinessHoursDayDto": {
        "properties": {
          "enabled": {
            "example": true,
            "type": "boolean"
          },
          "slots": {
            "example": [
              {
                "close": "17:00",
                "open": "09:00"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/WidgetBusinessHoursSlotDto"
            },
            "type": "array"
          }
        },
        "required": [
          "enabled",
          "slots"
        ],
        "type": "object"
      },
      "WidgetBusinessHoursDto": {
        "properties": {
          "schedule": {
            "$ref": "#/components/schemas/WidgetBusinessHoursScheduleDto"
          },
          "timezone": {
            "example": "America/New_York",
            "type": "string"
          }
        },
        "required": [
          "timezone",
          "schedule"
        ],
        "type": "object"
      },
      "WidgetBusinessHoursScheduleDto": {
        "properties": {
          "friday": {
            "$ref": "#/components/schemas/WidgetBusinessHoursDayDto"
          },
          "monday": {
            "$ref": "#/components/schemas/WidgetBusinessHoursDayDto"
          },
          "saturday": {
            "$ref": "#/components/schemas/WidgetBusinessHoursDayDto"
          },
          "sunday": {
            "$ref": "#/components/schemas/WidgetBusinessHoursDayDto"
          },
          "thursday": {
            "$ref": "#/components/schemas/WidgetBusinessHoursDayDto"
          },
          "tuesday": {
            "$ref": "#/components/schemas/WidgetBusinessHoursDayDto"
          },
          "wednesday": {
            "$ref": "#/components/schemas/WidgetBusinessHoursDayDto"
          }
        },
        "type": "object"
      },
      "WidgetBusinessHoursSlotDto": {
        "properties": {
          "close": {
            "example": "17:00",
            "type": "string"
          },
          "open": {
            "example": "09:00",
            "type": "string"
          }
        },
        "required": [
          "open",
          "close"
        ],
        "type": "object"
      },
      "WidgetLocationsAnalyticsDto": {
        "properties": {
          "eventType": {
            "description": "Event type",
            "enum": [
              "locations_widget_viewed",
              "locations_widget_search_submitted",
              "locations_widget_location_selected",
              "locations_widget_cta_clicked",
              "locations_widget_booking_started",
              "locations_widget_booking_completed"
            ],
            "type": "string"
          },
          "properties": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WidgetLocationsAnalyticsPropertiesDto"
              }
            ],
            "description": "Event properties (privacy-safe)"
          }
        },
        "required": [
          "eventType",
          "properties"
        ],
        "type": "object"
      },
      "WidgetLocationsAnalyticsPropertiesDto": {
        "properties": {
          "ctaType": {
            "description": "CTA type (for CTA click events)",
            "enum": [
              "book",
              "call",
              "directions"
            ],
            "type": "string"
          },
          "geoBucket": {
            "description": "Geographic bucket (ZIP or rounded lat/lng, e.g., \"75201\" or \"32.77,-96.79\", privacy-safe)",
            "type": "string"
          },
          "handoffMethod": {
            "description": "Handoff method (for booking events)",
            "enum": [
              "widget",
              "portal",
              "external"
            ],
            "type": "string"
          },
          "locationId": {
            "description": "Location ID (for selection/CTA/booking events)",
            "type": "string"
          },
          "metadata": {
            "description": "Additional event-specific properties (JSON object)",
            "type": "object"
          },
          "queryHash": {
            "description": "SHA256 hash of normalized search query (privacy-safe, for search events)",
            "type": "string"
          },
          "visitorId": {
            "description": "Visitor ID (privacy-safe identifier, required for all events)",
            "type": "string"
          },
          "widgetSessionId": {
            "description": "Widget session ID (required for all events)",
            "type": "string"
          }
        },
        "required": [
          "widgetSessionId",
          "visitorId"
        ],
        "type": "object"
      },
      "WorkflowActionDto": {
        "properties": {
          "config": {
            "description": "Action configuration payload",
            "type": "object"
          },
          "type": {
            "enum": [
              "CREATE_TASK",
              "SEND_EMAIL",
              "START_SEQUENCE",
              "WEBHOOK",
              "UPDATE_FIELD",
              "SCHEDULE_FOLLOW_UP"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "config"
        ],
        "type": "object"
      },
      "WorkflowAiConversationMessageDto": {
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "enum": [
              "user",
              "assistant"
            ],
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "type": "object"
      },
      "WorkflowAiGenerateContextDto": {
        "properties": {
          "availableTemplates": {
            "description": "Template IDs available to the org/user context",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "existingWorkflows": {
            "description": "Optional list of existing workflows to reduce duplicates",
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "orgHasChannels": {
            "description": "Connected channels for the org (e.g. sms, email)",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "WorkflowDefinitionDto": {
        "properties": {
          "edges": {
            "items": {
              "$ref": "#/components/schemas/WorkflowEdgeDto"
            },
            "type": "array"
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/WorkflowNodeDto"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "WorkflowDryRunAsUserDto": {
        "properties": {
          "role": {
            "description": "Optional role override for permission-sensitive dry-run branches. This is simulation metadata only and never changes real permissions.",
            "example": "MANAGER",
            "type": "string"
          },
          "userId": {
            "description": "Optional user id to simulate as. Must belong to the current organization. When omitted, the current authenticated user is used.",
            "example": "user_123",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowDryRunDto": {
        "properties": {
          "allowInactive": {
            "description": "When true, disabled workflows can be dry-run. Defaults to true because dry-run is an editor/testing surface and has no side effects.",
            "example": true,
            "type": "boolean"
          },
          "asUser": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WorkflowDryRunAsUserDto"
              }
            ],
            "description": "Simulate workflow context as a specific user/role. Server validates userId is in the current org and injects user context into triggerData.asUser."
          },
          "triggerData": {
            "description": "Synthetic trigger payload used by trigger/condition nodes during the dry run.",
            "example": {
              "ticket": {
                "id": "ticket_1",
                "priority": "high"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "WorkflowEdgeDto": {
        "properties": {
          "id": {
            "description": "Edge identifier. Auto-generated as `edge_<n>` server-side when omitted.",
            "example": "edge_1",
            "type": "string"
          },
          "source": {
            "description": "Source node id. Edges are dropped at validate-time if they reference an unknown node.",
            "example": "trigger_1",
            "type": "string"
          },
          "sourceHandle": {
            "description": "Output handle on the source node. Used by branching nodes (router/condition) to direct flow to a specific output.",
            "example": "high_intent",
            "type": "string"
          },
          "target": {
            "description": "Target node id. Edges are dropped at validate-time if they reference an unknown node.",
            "example": "send_sms_1",
            "type": "string"
          },
          "targetHandle": {
            "description": "Input handle on the target node. Rarely used; defaults to the node's only input.",
            "example": "in",
            "type": "string"
          }
        },
        "required": [
          "source",
          "target"
        ],
        "type": "object"
      },
      "WorkflowGraphPayloadDto": {
        "properties": {
          "description": {
            "type": "string"
          },
          "edges": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "nodes": {
            "items": {
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "nodes",
          "edges"
        ],
        "type": "object"
      },
      "WorkflowMetadataDto": {
        "properties": {
          "aiConversationId": {
            "description": "AI builder conversation id that produced this workflow, when applicable.",
            "type": "string"
          },
          "extra": {
            "additionalProperties": true,
            "description": "Free-form passthrough fields. Anything the builder or future integrations need to round-trip without a contract change goes here.",
            "type": "object"
          },
          "source": {
            "description": "Source of the workflow (`builder`, `template:<id>`, `ai_suggested`, etc.). Used for analytics and to skip re-onboarding flows.",
            "example": "template:onboarding",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowNodeDto": {
        "properties": {
          "config": {
            "additionalProperties": true,
            "description": "Per-node configuration consumed by the runtime engine. Schema varies by `type` — `trigger` nodes carry `triggerType`, action nodes carry channel-specific settings, etc.",
            "example": {
              "eventType": "appointment.booked",
              "triggerType": "EVENT"
            },
            "type": "object"
          },
          "data": {
            "additionalProperties": true,
            "description": "Builder-only UI metadata (icon, palette group, draft state). Not consumed by the runtime engine.",
            "example": {
              "uiType": "trigger.event"
            },
            "type": "object"
          },
          "id": {
            "description": "Stable identifier referenced by edges. Auto-generated by the builder if absent.",
            "example": "trigger_1",
            "type": "string"
          },
          "label": {
            "description": "Human-readable label shown on the canvas. Some templates use `name` as an alias.",
            "example": "Appointment Booked",
            "type": "string"
          },
          "name": {
            "description": "Legacy alias of `label` used by older template configs. The server treats `name` and `label` as interchangeable.",
            "example": "Appointment Booked",
            "type": "string"
          },
          "position": {
            "$ref": "#/components/schemas/WorkflowNodePositionDto"
          },
          "type": {
            "description": "Node type slug (e.g. `trigger`, `delay`, `condition`, `action.send_sms`). The runtime engine routes on this.",
            "example": "trigger",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "type": "object"
      },
      "WorkflowNodePositionDto": {
        "properties": {
          "x": {
            "example": 240,
            "type": "number"
          },
          "y": {
            "example": 80,
            "type": "number"
          }
        },
        "required": [
          "x",
          "y"
        ],
        "type": "object"
      },
      "WorkflowSettingsDto": {
        "properties": {
          "defaultEmailFrom": {
            "example": "support@company.com",
            "type": "string"
          },
          "defaultSmsFrom": {
            "example": "+1234567890",
            "type": "string"
          },
          "defaultVoiceAgentId": {
            "example": "uuid",
            "type": "string"
          },
          "emailSignature": {
            "example": "Best regards,\n{{org.name}}",
            "type": "string"
          },
          "escalationEmail": {
            "example": "manager@company.com",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkflowTemplateInputDto": {
        "properties": {
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "edges": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "industry": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "nodes": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "triggers": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "variables": {
            "items": {
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "industry",
          "category",
          "nodes",
          "edges"
        ],
        "type": "object"
      },
      "WorkflowTriggerConfigDto": {
        "properties": {
          "eventType": {
            "description": "Event topic for `triggerType: EVENT` workflows. The event taxonomy lives in `src/events/event-types.ts`.",
            "example": "appointment.booked",
            "type": "string"
          },
          "schedule": {
            "description": "Cron schedule for `triggerType: SCHEDULED` workflows. Standard 5-field UNIX cron syntax.",
            "example": "0 9 * * 1",
            "type": "string"
          },
          "timezone": {
            "description": "IANA timezone the cron schedule is interpreted in. Defaults to the org timezone when omitted.",
            "example": "America/New_York",
            "type": "string"
          },
          "webhook": {
            "additionalProperties": true,
            "description": "Webhook secret / verification config for `triggerType: WEBHOOK` workflows. Schema varies by integration.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "WorkflowTriggerDto": {
        "properties": {
          "config": {
            "additionalProperties": true,
            "description": "Event-specific filter/configuration consumed by the trigger.",
            "type": "object"
          },
          "type": {
            "description": "Event topic this workflow should fire on (for templates without a graph trigger node).",
            "example": "appointment.scheduled",
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "WorkingHourDto": {
        "properties": {
          "dayOfWeek": {
            "example": 1,
            "maximum": 6,
            "minimum": 0,
            "type": "number"
          },
          "endTime": {
            "example": "17:00",
            "type": "string"
          },
          "isAvailable": {
            "default": true,
            "example": true,
            "type": "boolean"
          },
          "startTime": {
            "example": "09:00",
            "type": "string"
          }
        },
        "required": [
          "dayOfWeek",
          "startTime",
          "endTime",
          "isAvailable"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "IdempotencyKey": {
        "in": "header",
        "name": "Idempotency-Key",
        "type": "apiKey"
      },
      "OrgId": {
        "in": "header",
        "name": "x-org-id",
        "type": "apiKey"
      },
      "bearer": {
        "bearerFormat": "JWT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "contact": {},
    "description": "ServiceAgent v1 API. This file is the single source of truth for the FE contract — do not hand-edit. Regenerate via `npm run openapi:emit`.",
    "title": "ServiceAgent API",
    "version": "1.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "OAuth2DiscoveryController_getAuthorizationServerMetadata",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/authorize": {
      "get": {
        "operationId": "OAuth2AuthorizationController_authorize",
        "parameters": [
          {
            "description": "OAuth2 response type - must be \"code\" for authorization code flow",
            "in": "query",
            "name": "response_type",
            "required": true,
            "schema": {
              "example": "code",
              "type": "string"
            }
          },
          {
            "description": "OAuth2 client ID",
            "in": "query",
            "name": "client_id",
            "required": true,
            "schema": {
              "example": "cmhw6k04i001j3m0rp2icr3ax",
              "type": "string"
            }
          },
          {
            "description": "Redirect URI after authorization",
            "in": "query",
            "name": "redirect_uri",
            "required": true,
            "schema": {
              "example": "https://claude.ai/api/mcp/auth_callback",
              "type": "string"
            }
          },
          {
            "description": "PKCE code challenge (optional for OpenAI custom actions)",
            "in": "query",
            "name": "code_challenge",
            "required": false,
            "schema": {
              "example": "vx4GjymQGsEMSFC-3aElC4cxbOJQckLPApSU2rPE-dI",
              "type": "string"
            }
          },
          {
            "description": "PKCE code challenge method (optional for OpenAI custom actions)",
            "in": "query",
            "name": "code_challenge_method",
            "required": false,
            "schema": {
              "example": "S256",
              "type": "string"
            }
          },
          {
            "description": "State parameter for CSRF protection",
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "example": "0rodEZFQWn0OUQCIjfVgPh4_6u85JpphePeG8MJw5VQ",
              "type": "string"
            }
          },
          {
            "description": "Requested OAuth2 scopes",
            "in": "query",
            "name": "scope",
            "required": false,
            "schema": {
              "example": "claudeai",
              "type": "string"
            }
          },
          {
            "description": "Resource indicator (RFC 8707) for the MCP endpoint",
            "in": "query",
            "name": "resource",
            "required": false,
            "schema": {
              "example": "https://process.serviceagent.ai/v1/mcp",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Login page rendered"
          }
        },
        "summary": "OAuth2 authorization endpoint – serves login/consent UI",
        "tags": [
          "oauth2"
        ]
      },
      "post": {
        "operationId": "OAuth2AuthorizationController_handleLogin",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Handle login form submission and issue authorization code",
        "tags": [
          "oauth2"
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "EnhancedHealthController_checkHealth",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Health check result"
          }
        },
        "summary": "Comprehensive health check",
        "tags": [
          "health"
        ]
      }
    },
    "/health/live": {
      "get": {
        "operationId": "EnhancedHealthController_checkLiveness",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Service is alive"
          }
        },
        "summary": "Liveness probe (for Kubernetes)",
        "tags": [
          "health"
        ]
      }
    },
    "/health/ready": {
      "get": {
        "operationId": "EnhancedHealthController_checkReadiness",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Service is ready"
          },
          "503": {
            "description": "Service is not ready"
          }
        },
        "summary": "Readiness probe (for Kubernetes)",
        "tags": [
          "health"
        ]
      }
    },
    "/saw.js": {
      "get": {
        "operationId": "WidgetAssetsController_serveLegacyWidget",
        "parameters": [
          {
            "in": "query",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/status": {
      "get": {
        "operationId": "StatusPageController_statusPage",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/status.json": {
      "get": {
        "operationId": "StatusPageController_statusJson",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/activities": {
      "get": {
        "description": "Lists activities scoped to the current organization. Optional filters support pagination and limiting to related records.",
        "operationId": "ActivitiesController_findAll",
        "parameters": [
          {
            "description": "Filter by activity type (e.g., CALL, MEETING, NOTE).",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict results to a specific contact.",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict results to a specific company.",
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict results to a specific deal.",
            "in": "query",
            "name": "dealId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict results to tasks owned by a specific teammate.",
            "in": "query",
            "name": "ownerId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum records to return. Defaults to service-level pagination.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Records to skip before collecting results.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activities retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all activities",
        "tags": [
          "crm-activities"
        ]
      },
      "post": {
        "description": "Creates a CRM activity for the current organization. Activities can be linked to contacts, companies, deals, and owners.",
        "operationId": "ActivitiesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateActivityDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Activity created successfully"
          },
          "400": {
            "description": "Invalid input data"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new activity",
        "tags": [
          "crm-activities"
        ]
      }
    },
    "/v1/activities/{id}": {
      "delete": {
        "description": "Permanently removes an activity. Use with caution as this operation is irreversible.",
        "operationId": "ActivitiesController_remove",
        "parameters": [
          {
            "description": "Activity identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity deleted successfully"
          },
          "404": {
            "description": "Activity not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete activity",
        "tags": [
          "crm-activities"
        ]
      },
      "get": {
        "description": "Retrieves a single activity including its relationships. Returns 404 when the activity does not belong to the organization.",
        "operationId": "ActivitiesController_findOne",
        "parameters": [
          {
            "description": "Activity identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity retrieved successfully"
          },
          "404": {
            "description": "Activity not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get activity by ID",
        "tags": [
          "crm-activities"
        ]
      },
      "patch": {
        "description": "Updates mutable fields for an existing activity. Use this to change status, details, or related entities.",
        "operationId": "ActivitiesController_update",
        "parameters": [
          {
            "description": "Activity identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateActivityDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Activity updated successfully"
          },
          "404": {
            "description": "Activity not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update activity",
        "tags": [
          "crm-activities"
        ]
      }
    },
    "/v1/admin/billing/organizations": {
      "get": {
        "operationId": "BillingController_getAllOrganizations",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organizations retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all organizations with billing info",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/billing/organizations/{orgId}": {
      "get": {
        "operationId": "BillingController_getOrganizationBilling",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing info retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get detailed billing info for organization",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/billing/organizations/{orgId}/adjust-credits": {
      "post": {
        "operationId": "BillingController_adjustCredits",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditAdjustmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Credits adjusted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Adjust credits for organization (admin only)",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/billing/revenue": {
      "get": {
        "operationId": "BillingController_getRevenueAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "weekly",
                "monthly",
                "quarterly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revenue analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get revenue analytics",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/billing/transactions": {
      "get": {
        "operationId": "BillingController_getRecentTransactions",
        "parameters": [
          {
            "in": "query",
            "name": "orgId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transactions retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get recent transactions across all organizations",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/billing/usage": {
      "get": {
        "operationId": "BillingController_getUsageAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "weekly",
                "monthly",
                "quarterly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usage analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get usage analytics across all organizations",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/install-funnel/export.csv": {
      "get": {
        "operationId": "AdminInstallFunnelController_exportCsv",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated platform list",
            "in": "query",
            "name": "platforms",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export install funnel metrics by platform as CSV",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/kan-3-backfill/run/{orgId}": {
      "post": {
        "description": "Mirrors pre-existing knowledge_base rows for this org into ai_brain_*. Default-skips rows that already have at least one ai_brain_chunks entry. Idempotent.",
        "operationId": "AdminKan3BackfillController_runForOrg",
        "parameters": [
          {
            "description": "Target organization id",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Cap rows processed (default: no cap)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Re-mirror rows that already have chunks",
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Preview without writing",
            "in": "query",
            "name": "dryRun",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Backfill run complete with counts."
          },
          "404": {
            "description": "Organization not found."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Run KAN-3 backfill for a single organization",
        "tags": [
          "admin-kan-3-backfill"
        ]
      }
    },
    "/v1/admin/kan-3-backfill/scope": {
      "get": {
        "description": "Returns per-org counts of active knowledge_base rows and how many are already mirrored into ai_brain_*. Safe — read-only.",
        "operationId": "AdminKan3BackfillController_getScope",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Per-org scope summary returned."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview KAN-3 backfill scope",
        "tags": [
          "admin-kan-3-backfill"
        ]
      }
    },
    "/v1/admin/pricing/plans": {
      "post": {
        "operationId": "PricingPlansController_createPlan",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePricingPlanDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create pricing plan",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/pricing/plans/{id}": {
      "delete": {
        "operationId": "PricingPlansController_deletePlan",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete pricing plan (soft delete)",
        "tags": [
          "admin"
        ]
      },
      "patch": {
        "operationId": "PricingPlansController_updatePlan",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePricingPlanDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update pricing plan",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/twilio/shards": {
      "get": {
        "operationId": "TwilioShardsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List configured Twilio shards",
        "tags": [
          "admin"
        ]
      },
      "post": {
        "operationId": "TwilioShardsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTwilioShardDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a Twilio shard (stores auth token encrypted)",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/twilio/shards/assign": {
      "post": {
        "operationId": "TwilioShardsController_assign",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignOrgToTwilioShardDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Assign an organization to a Twilio shard",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/twilio/shards/backfill": {
      "post": {
        "operationId": "TwilioShardsController_backfill",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BackfillTwilioShardsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Backfill shard assignments for organizations that are unassigned",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/admin/twilio/shards/{shardId}/active": {
      "patch": {
        "operationId": "TwilioShardsController_setActive",
        "parameters": [
          {
            "in": "path",
            "name": "shardId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Activate/deactivate a Twilio shard",
        "tags": [
          "admin"
        ]
      }
    },
    "/v1/agency/analytics/aggregate": {
      "get": {
        "operationId": "AgencyDashboardController_getAggregateAnalytics",
        "parameters": [
          {
            "description": "Time range (e.g., 30d, 7d)",
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Aggregate analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get cross-client analytics",
        "tags": [
          "Agency Dashboard"
        ]
      }
    },
    "/v1/agency/clients/performance": {
      "get": {
        "operationId": "AgencyDashboardController_getClientPerformance",
        "parameters": [
          {
            "description": "Time range (e.g., 30d, 7d)",
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort by field (revenue, leads, etc.)",
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum clients to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Client performance data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get client performance data",
        "tags": [
          "Agency Dashboard"
        ]
      }
    },
    "/v1/agency/dashboard": {
      "get": {
        "operationId": "AgencyDashboardController_getAgencyDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Agency dashboard data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get agency overview dashboard",
        "tags": [
          "Agency Dashboard"
        ]
      }
    },
    "/v1/agency/settings": {
      "get": {
        "operationId": "AgencyDashboardController_getAgencySettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Agency settings retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get agency settings",
        "tags": [
          "Agency Dashboard"
        ]
      },
      "put": {
        "operationId": "AgencyDashboardController_updateAgencySettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Agency settings updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update agency settings",
        "tags": [
          "Agency Dashboard"
        ]
      }
    },
    "/v1/agents": {
      "get": {
        "operationId": "UnifiedAgentsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List unified agents",
        "tags": [
          "agents"
        ]
      },
      "post": {
        "operationId": "UnifiedAgentsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUnifiedAgentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a unified agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/persona-templates": {
      "get": {
        "operationId": "PersonaTemplatesController_list",
        "parameters": [
          {
            "description": "inbound | outbound | both",
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by category",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Array of persona templates with prompts, greetings, and placeholders"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List persona templates available for voice agent creation",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/persona-templates/{id}": {
      "get": {
        "operationId": "PersonaTemplatesController_get",
        "parameters": [
          {
            "description": "Template id, e.g. \"outbound-sales-sdr\"",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested template"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch one persona template by id",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/post-call-rules/catalog": {
      "get": {
        "description": "Returns conditions + actions + integration status. Conditions are the 'IF' half of a rule (e.g. booking_confirmed). Actions are the 'THEN' half (e.g. send_sms). Each action indicates which integration it requires; the `integrations` block tells the UI which integrations the org already has connected so it can render inline setup prompts for the missing ones.",
        "operationId": "VoiceAgentConfigController_getPostCallRulesCatalog",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List the post-call rules catalog for the rules editor",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/post-call-rules/templates": {
      "get": {
        "description": "Hand-curated 'recipes' the operator UI renders as a Recipes gallery — pick one, optionally tweak, then PUT into /post-call-rules. Each template includes condition + action params with sensible defaults, plus presentation metadata (label, icon, rationale, recommendedVerticals) for the gallery card.",
        "operationId": "VoiceAgentConfigController_getPostCallRuleTemplates",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List pre-curated post-call rule templates",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/post-call-rules/templates/{templateId}/apply-to-org": {
      "post": {
        "description": "Server-side instantiation for the Recipes tab. Applies a template by id to selected unified agents (or all agents when applyToAll=true). mode=append preserves existing rules; mode=replace overwrites target rule sets.",
        "operationId": "VoiceAgentConfigController_applyPostCallRuleTemplateToOrg",
        "parameters": [
          {
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyPostCallRuleTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Apply a post-call rule template to one or more agents",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/tool-catalog": {
      "get": {
        "description": "Returns every built-in voice tool with technical name, operator-facing display metadata, section grouping, and integration dependencies. Frontend renders the tool-selection UI entirely from this response — never hardcoded.",
        "operationId": "VoiceAgentConfigController_listToolCatalog",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List the tool catalog for operator tool-scope UI",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/unified/{id}": {
      "delete": {
        "description": "Compatibility route for clients still calling DELETE /v1/agents/unified/:id. Prefer DELETE /v1/agents/:id.",
        "operationId": "UnifiedAgentsController_removeUnifiedAlias",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Legacy alias: delete a unified agent (soft delete)",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/voice-configs": {
      "get": {
        "description": "This route exists to prevent /agents/voice-configs from being captured by /agents/:id. Prefer GET /v1/agents/:id/voice-config.",
        "operationId": "UnifiedAgentsController_legacyVoiceConfigs",
        "parameters": [
          {
            "in": "query",
            "name": "agentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "unifiedAgentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Legacy alias for voice config lookup (compat: GET /v1/agents/voice-configs?agentId=...)",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}": {
      "delete": {
        "operationId": "UnifiedAgentsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a unified agent (soft delete)",
        "tags": [
          "agents"
        ]
      },
      "get": {
        "operationId": "UnifiedAgentsController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a unified agent",
        "tags": [
          "agents"
        ]
      },
      "put": {
        "operationId": "UnifiedAgentsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUnifiedAgentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a unified agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/analytics": {
      "get": {
        "description": "Returns call performance metrics for the agent. (Best-effort based on stored call records.)",
        "operationId": "UnifiedAgentsController_analytics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get agent analytics",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/channels/chat/disable": {
      "post": {
        "operationId": "UnifiedAgentsController_disableChat",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Disable chat channel for an agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/channels/chat/enable": {
      "post": {
        "operationId": "UnifiedAgentsController_enableChat",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnableChatChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Enable chat channel for an agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/channels/voice/disable": {
      "post": {
        "operationId": "UnifiedAgentsController_disableVoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Disable voice channel for an agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/channels/voice/enable": {
      "post": {
        "operationId": "UnifiedAgentsController_enableVoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnableVoiceChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Enable voice channel for an agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/channels/{channel}": {
      "put": {
        "operationId": "UnifiedAgentsController_updateChannel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "channel",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateChannelConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a channel configuration",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/post-call-rule-executions": {
      "get": {
        "description": "Returns `{ callId, executions: [{ ruleId, matched, skipReason?, actions: [{ actionId, status, output?, error? }] }] }` for one call. Main driver: the 'why didn't my rule fire?' debugging affordance in the operator UI.",
        "operationId": "VoiceAgentConfigController_getPostCallRuleExecutions",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The call id to inspect.",
            "in": "query",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a call's post-call rule execution log",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/post-call-rules": {
      "get": {
        "description": "Returns the stored rules as canonical objects. Rules authored against an older catalog version are dropped silently on read — the UI should re-show the editor so operators can re-author affected rules.",
        "operationId": "VoiceAgentConfigController_listPostCallRules",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List post-call rules for a voice agent",
        "tags": [
          "agents"
        ]
      },
      "put": {
        "description": "Replaces the entire rule set — this is a PUT, not a PATCH. Intentional: rule lists are small (max 25), and atomic replacement avoids merge ambiguity when operators reorder / delete rules in the UI. Each rule's condition + action + params are validated against the catalog; invalid references return a 400 with a specific error (e.g. `rule 2 action 1: unknown action \"foo\"`).",
        "operationId": "VoiceAgentConfigController_replacePostCallRules",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplacePostCallRulesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replace post-call rules for a voice agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/publish": {
      "post": {
        "description": "Marks the agent as published and performs best-effort validation/synchronization for enabled channels.",
        "operationId": "UnifiedAgentsController_publish",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish an agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/sample-run": {
      "post": {
        "description": "Simulates a first-run voice-agent demo without phone provisioning, payments, or any external telephony side effects.",
        "operationId": "UnifiedAgentsController_runSampleCall",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Sample call simulation completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Run a deterministic voice agent sample call",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/sample-runs/{runId}": {
      "get": {
        "operationId": "UnifiedAgentsController_getSampleCall",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sample call result retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch a deterministic voice agent sample-call result",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/sync-knowledge": {
      "post": {
        "operationId": "UnifiedAgentsController_syncKnowledge",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync knowledge base to enabled channels",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/test-call": {
      "post": {
        "description": "Starts an outbound call using the agent’s voice configuration. Intended for pre-launch testing.",
        "operationId": "AgentTestCallsController_initiate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiateTestCallDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestCallStatusResponseDto"
                }
              }
            },
            "description": ""
          },
          "400": {
            "description": "Bad request - agent not configured or invalid phone number"
          },
          "402": {
            "description": "Insufficient credits"
          },
          "404": {
            "description": "Agent not found"
          },
          "429": {
            "description": "Rate limited - too many concurrent calls"
          },
          "503": {
            "description": "Voice provider unavailable"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate a test call to the user’s phone",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/test-call/{callId}": {
      "get": {
        "description": "Returns the latest status for a previously started test call. Uses the call record stored in DB.",
        "operationId": "AgentTestCallsController_status",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestCallStatusResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get test call status",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/test-call/{callId}/end": {
      "post": {
        "description": "Attempts to end an ongoing call via the voice provider. Always marks the call as ended in DB.",
        "operationId": "AgentTestCallsController_end",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call ended"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "End an ongoing test call (best effort)",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/voice-config": {
      "get": {
        "operationId": "VoiceAgentConfigController_getVoiceConfig",
        "parameters": [
          {
            "description": "Unified agent ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Voice config returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get voice agent config for a unified agent",
        "tags": [
          "agents"
        ]
      },
      "put": {
        "operationId": "VoiceAgentConfigController_upsertVoiceConfig",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertVoiceAgentConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create or update voice agent config for a unified agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/voice-config/dry-run": {
      "post": {
        "description": "Runs the LLM one turn with the current draft config — compiled system prompt, allowed tools, FAQs, handling profile — and returns what AIVA would say plus any tools it would call. No audio, no phone call, no tool execution. Operators use this to iterate on prompts + tool descriptions in seconds instead of placing a real test call for every change.",
        "operationId": "VoiceAgentConfigController_dryRunVoiceConfig",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceConfigDryRunDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The simulated assistant reply and tool invocations."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test Drive: rehearse a single turn against the agent config",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/voice-config/prompt-preview": {
      "post": {
        "description": "Returns the compiled voice prompt, section metadata, cache boundary information, and planned runtime-context sections so frontend can render a prompt breakdown without starting a live call.",
        "operationId": "VoiceAgentConfigController_previewVoicePrompt",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewVoicePromptDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Inspect the compiled AIVA voice prompt for a unified agent",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/voice-config/publish": {
      "post": {
        "description": "Validates publish-readiness before promoting draft to published. Use ?force=true (OWNER/ADMIN only) to publish despite outstanding blockers; this path is logged.",
        "operationId": "VoiceAgentConfigController_publishVoiceConfig",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "When true, publish even if readiness blockers are reported. Logged for audit.",
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish voice agent config",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/voice-config/publish-preview": {
      "get": {
        "description": "Returns a single payload with the current readiness report and a human-readable summary of what will be published (voice, greeting, FAQs, knowledge bases, transfer settings, tools). Safe to render directly in the editor publish modal.",
        "operationId": "VoiceAgentConfigController_getVoiceConfigPublishPreview",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Customer-facing publish preview summary",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/voice-config/published-snapshot": {
      "get": {
        "description": "Returns the prompt, sections, and scalar projection captured at the most recent successful publish. Used by the \"Draft vs. Live\" diff panel. 404 when the agent has never been published.",
        "operationId": "VoiceAgentConfigController_getPublishedSnapshot",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get the last published prompt snapshot for this agent",
        "tags": [
          "agents"
        ]
      },
      "post": {
        "description": "Called by the editor immediately after a successful publish to record the baseline used by the \"Draft vs. Live\" diff panel. Idempotent via the Idempotency-Key header.",
        "operationId": "VoiceAgentConfigController_upsertPublishedSnapshot",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishedSnapshotDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upsert the published prompt snapshot baseline",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/agents/{id}/voice-config/readiness": {
      "get": {
        "description": "Returns structured readiness issues (blockers, warnings, info) so the editor can show \"what must be fixed\" before publishing and \"what to double-check\".",
        "operationId": "VoiceAgentConfigController_getVoiceConfigReadiness",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get publish-readiness report for a unified agent voice config",
        "tags": [
          "agents"
        ]
      }
    },
    "/v1/ai-claude/chat": {
      "options": {
        "operationId": "ClaudeController_handleChatOptions",
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "ai-claude"
        ]
      },
      "post": {
        "description": "Set enableTools: true in request body to enable tool calling through MCP gateway. Requires x-tenant-id header when tools are enabled.",
        "operationId": "ClaudeController_chat",
        "parameters": [
          {
            "in": "header",
            "name": "x-user-email",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-user-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-conversation-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-create-conversation",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-context-entity-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-context-entity-type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-entity-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-entity-type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "example": {
                  "enableTools": true,
                  "maxTokens": 1024,
                  "messages": [
                    {
                      "content": "Create a contact named John Doe with email john@example.com",
                      "role": "user"
                    }
                  ],
                  "temperature": 0.3
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Chat with Claude (with optional MCP tool calling)",
        "tags": [
          "ai-claude"
        ]
      }
    },
    "/v1/ai/agents": {
      "get": {
        "operationId": "AgentsController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Agents retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all AI agents for the organization",
        "tags": [
          "AI Agents"
        ]
      },
      "post": {
        "operationId": "AgentsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentResponseDto"
                }
              }
            },
            "description": "Agent created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new AI agent",
        "tags": [
          "AI Agents"
        ]
      }
    },
    "/v1/ai/agents/templates/{industry}": {
      "get": {
        "operationId": "AgentsController_getTemplates",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Templates retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific agent templates",
        "tags": [
          "AI Agents"
        ]
      }
    },
    "/v1/ai/agents/{id}": {
      "delete": {
        "operationId": "AgentsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          },
          "404": {
            "description": "Agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an AI agent",
        "tags": [
          "AI Agents"
        ]
      },
      "get": {
        "operationId": "AgentsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentResponseDto"
                }
              }
            },
            "description": "Agent retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a specific AI agent by ID",
        "tags": [
          "AI Agents"
        ]
      },
      "patch": {
        "operationId": "AgentsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentResponseDto"
                }
              }
            },
            "description": "Agent updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an AI agent",
        "tags": [
          "AI Agents"
        ]
      }
    },
    "/v1/ai/agents/{id}/calls": {
      "get": {
        "operationId": "AIAgentExtensionsController_getAgentCallHistory",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call history retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "AI agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI agent call history",
        "tags": [
          "AI Agent Extensions"
        ]
      }
    },
    "/v1/ai/agents/{id}/performance": {
      "get": {
        "operationId": "AIAgentExtensionsController_getAgentPerformance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Performance metrics retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "AI agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI agent performance metrics",
        "tags": [
          "AI Agent Extensions"
        ]
      }
    },
    "/v1/ai/agents/{id}/test": {
      "post": {
        "operationId": "AgentsController_testAgent",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent test completed successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test an AI agent with sample input",
        "tags": [
          "AI Agents"
        ]
      }
    },
    "/v1/ai/analytics/communication": {
      "get": {
        "description": "Returns cross-channel communication metrics such as conversation volume, response times, and satisfaction scores.",
        "operationId": "AiAnalyticsController_getCommunicationAnalytics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Communication analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get communication analytics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/customer-intelligence": {
      "get": {
        "description": "Provides AI-derived customer intelligence metrics including churn risk and top-performing segments.",
        "operationId": "AiAnalyticsController_getCustomerIntelligence",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Customer intelligence retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer intelligence analytics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/dashboard": {
      "get": {
        "operationId": "AnalyticsController_getAnalyticsDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Analytics dashboard retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get comprehensive analytics dashboard",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/export/dashboard": {
      "get": {
        "operationId": "AnalyticsController_exportDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Dashboard data exported successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export dashboard data",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/export/metrics": {
      "get": {
        "operationId": "AnalyticsController_exportMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Metrics data exported successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export metrics data",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/insights": {
      "get": {
        "operationId": "AnalyticsController_getAnalyticsInsights",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Analytics insights retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get analytics insights",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/metrics": {
      "get": {
        "operationId": "AnalyticsController_getAnalyticsMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Analytics metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get detailed analytics metrics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/metrics/ai": {
      "get": {
        "operationId": "AnalyticsController_getAiMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "AI metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI metrics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/metrics/communication": {
      "get": {
        "operationId": "AnalyticsController_getCommunicationMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Communication metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get communication metrics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/metrics/customers": {
      "get": {
        "operationId": "AnalyticsController_getCustomerMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Customer metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer metrics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/metrics/operational": {
      "get": {
        "operationId": "AnalyticsController_getOperationalMetrics__ai_analytics_metrics_operational",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Operational metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get operational metrics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/metrics/revenue": {
      "get": {
        "operationId": "AnalyticsController_getRevenueMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Revenue metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get revenue metrics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/performance": {
      "get": {
        "operationId": "AnalyticsController_getPerformanceAnalytics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Performance analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get performance analytics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/trends": {
      "get": {
        "operationId": "AnalyticsController_getAnalyticsTrends",
        "parameters": [
          {
            "description": "Time period for trends",
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "7d",
                "30d",
                "90d",
                "1y"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics trends retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get analytics trends",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/usage": {
      "get": {
        "description": "Returns usage metrics such as total AI messages and response times for the requested date range.",
        "operationId": "AiAnalyticsController_getUsageAnalytics",
        "parameters": [
          {
            "description": "ISO8601 start date for the analytics window.",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date for the analytics window.",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usage analytics retrieved successfully"
          },
          "400": {
            "description": "Invalid date range"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI usage analytics",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/widgets/insights": {
      "get": {
        "operationId": "AnalyticsController_getInsightsWidget",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Insights widget data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get insights widget data",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/widgets/overview": {
      "get": {
        "operationId": "AnalyticsController_getOverviewWidget",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Overview widget data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get overview widget data",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/widgets/performance": {
      "get": {
        "operationId": "AnalyticsController_getPerformanceWidget",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Performance widget data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get performance widget data",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/widgets/predictions": {
      "get": {
        "operationId": "AnalyticsController_getPredictionsWidget",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Predictions widget data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get predictions widget data",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/analytics/widgets/trends": {
      "get": {
        "operationId": "AnalyticsController_getTrendsWidget",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Trends widget data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get trends widget data",
        "tags": [
          "ai-analytics"
        ]
      }
    },
    "/v1/ai/automation/execute-steps": {
      "post": {
        "description": "Executes scheduled follow-up steps that are due for delivery.",
        "operationId": "AutomationController_executeFollowUpSteps",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Follow-up steps executed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute follow-up steps",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/automation/follow-up/analytics": {
      "get": {
        "description": "Returns analytics such as completion rates and response times for automated follow-ups.",
        "operationId": "AutomationController_getFollowUpAnalytics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Follow-up analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get follow-up analytics overview",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/automation/follow-up/executions": {
      "get": {
        "description": "Lists active and completed follow-up executions for monitoring.",
        "operationId": "AutomationController_getFollowUpExecutions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Follow-up executions retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all follow-up executions",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/automation/follow-up/executions/{executionId}": {
      "get": {
        "description": "Retrieves details for a single follow-up execution including status and history.",
        "operationId": "AutomationController_getFollowUpExecution",
        "parameters": [
          {
            "description": "Follow-up execution ID",
            "in": "path",
            "name": "executionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Follow-up execution retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get specific follow-up execution",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/automation/follow-up/rules": {
      "get": {
        "description": "Returns the list of follow-up rules configured for the organization.",
        "operationId": "AutomationController_getFollowUpRules",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Follow-up rules retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all follow-up rules",
        "tags": [
          "ai-automation"
        ]
      },
      "post": {
        "description": "Creates automated follow-up rules that determine when the assistant should reach out to customers.",
        "operationId": "AiAutomationController_createFollowUpRules",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Rules created successfully"
          },
          "400": {
            "description": "Invalid rule payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create follow-up rules",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/automation/follow-up/sequences": {
      "get": {
        "description": "Returns the collection of follow-up sequences and steps for the organization.",
        "operationId": "AutomationController_getFollowUpSequences",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Follow-up sequences retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all follow-up sequences",
        "tags": [
          "ai-automation"
        ]
      },
      "post": {
        "description": "Creates multi-step follow-up sequences that can be orchestrated by the assistant over time.",
        "operationId": "AiAutomationController_createFollowUpSequences",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sequences created successfully"
          },
          "400": {
            "description": "Invalid sequence payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create follow-up sequences",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/automation/follow-up/start": {
      "post": {
        "description": "Enqueues the first step of a follow-up sequence for the specified customer.",
        "operationId": "AutomationController_startFollowUpSequence",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartFollowUpSequenceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Follow-up sequence started successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start a follow-up sequence for a customer",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/automation/follow-up/suggestions": {
      "post": {
        "description": "Generates AI-powered follow-up suggestions based on customer context and history.",
        "operationId": "AutomationController_generateFollowUpSuggestions",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateFollowUpSuggestionsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Follow-up suggestions generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate intelligent follow-up suggestions",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/automation/process-triggers": {
      "post": {
        "description": "Processes pending follow-up triggers to enqueue necessary actions.",
        "operationId": "AutomationController_processFollowUpTriggers",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Follow-up triggers processed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Process follow-up triggers",
        "tags": [
          "ai-automation"
        ]
      }
    },
    "/v1/ai/brain/context": {
      "get": {
        "operationId": "AIBrainController_getContext",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "about": {
                      "type": "string"
                    },
                    "businessName": {
                      "type": "string"
                    },
                    "contact": {
                      "type": "object"
                    },
                    "faqs": {
                      "type": "array"
                    },
                    "lastSyncedAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "services": {
                      "type": "array"
                    },
                    "workingHours": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "AI Brain context retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI Brain context for chat/voice",
        "tags": [
          "ai-brain"
        ]
      }
    },
    "/v1/ai/brain/knowledge/search": {
      "post": {
        "operationId": "AIBrainController_searchKnowledge",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "results": {
                      "items": {
                        "properties": {
                          "category": {
                            "type": "string"
                          },
                          "citations": {
                            "type": "array"
                          },
                          "content": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "privacyLevel": {
                            "type": "string"
                          },
                          "relevance": {
                            "type": "number"
                          },
                          "searchMethod": {
                            "enum": [
                              "summary",
                              "chunk"
                            ],
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "searchMethod": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Knowledge search completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search knowledge base with hybrid summary + chunk results",
        "tags": [
          "ai-brain"
        ]
      }
    },
    "/v1/ai/brain/profile": {
      "get": {
        "operationId": "AIBrainController_getProfile",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "about": {
                      "type": "string"
                    },
                    "contacts": {
                      "type": "object"
                    },
                    "coverageScore": {
                      "type": "number"
                    },
                    "faqs": {
                      "type": "array"
                    },
                    "lastSyncAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "pricebook": {
                      "type": "array"
                    },
                    "services": {
                      "type": "array"
                    },
                    "websiteUrl": {
                      "type": "string"
                    },
                    "workingHours": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Business profile retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get business profile with coverage metrics",
        "tags": [
          "ai-brain"
        ]
      },
      "put": {
        "operationId": "AIBrainController_updateProfile",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBusinessProfileDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "coverageScore": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "syncStartedAt": {
                      "format": "date-time",
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Profile updated and sync initiated"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update business profile and trigger AI sync",
        "tags": [
          "ai-brain"
        ]
      }
    },
    "/v1/ai/brain/profile/gaps": {
      "get": {
        "operationId": "AIBrainController_getProfileGaps",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "coverageScore": {
                      "type": "number"
                    },
                    "suggestions": {
                      "items": {
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "severity": {
                            "enum": [
                              "high",
                              "medium",
                              "low"
                            ],
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Profile gaps analysis completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Analyze profile and return improvement suggestions",
        "tags": [
          "ai-brain"
        ]
      }
    },
    "/v1/ai/brain/profile/sync": {
      "post": {
        "operationId": "AIBrainController_syncProfile",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "estimatedCompletionSec": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "syncStartedAt": {
                      "format": "date-time",
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "AI sync initiated"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Force re-sync of AI Brain without changing profile",
        "tags": [
          "ai-brain"
        ]
      }
    },
    "/v1/ai/brain/sync-services": {
      "post": {
        "operationId": "AIBrainController_syncServices",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "added": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "brainUpdatedAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "removed": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "synced": {
                      "type": "number"
                    },
                    "updated": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Service offerings synced to AI Brain"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync service offerings into AI Brain profile",
        "tags": [
          "ai-brain"
        ]
      }
    },
    "/v1/ai/chat": {
      "post": {
        "description": "Processes a message using the organization's default assistant configuration without requiring explicit conversation management.",
        "operationId": "AiChatController_chatShortcut",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Message processed successfully"
          },
          "400": {
            "description": "Invalid message payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Process a message with AI assistant (shortcut)",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/conversations": {
      "get": {
        "description": "Returns paginated assistant conversations for the organization with optional free-text search.",
        "operationId": "AiChatController_listConversations",
        "parameters": [
          {
            "description": "Page number (1-based). Defaults to 1 when omitted.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Maximum conversations per page. Defaults to the service-level pagination size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Optional text to match against conversation titles or transcript snippets.",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversations retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List AI conversations",
        "tags": [
          "ai-chat"
        ]
      },
      "post": {
        "description": "Persists conversation state such as title, participants, and message summaries for later retrieval.",
        "operationId": "AiChatController_saveConversation",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Conversation saved successfully"
          },
          "400": {
            "description": "Invalid conversation payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create or update conversation",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/conversations/{id}": {
      "delete": {
        "description": "Soft deletes or archives a conversation depending on the configured retention policy.",
        "operationId": "AiChatController_deleteConversation",
        "parameters": [
          {
            "description": "Conversation ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation deleted successfully"
          },
          "404": {
            "description": "Conversation not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete conversation",
        "tags": [
          "ai-chat"
        ]
      },
      "get": {
        "description": "Retrieves a single conversation transcript and metadata when it belongs to the requesting organization.",
        "operationId": "AiChatController_getConversation",
        "parameters": [
          {
            "description": "Conversation ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation retrieved successfully"
          },
          "404": {
            "description": "Conversation not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get conversation by ID",
        "tags": [
          "ai-chat"
        ]
      },
      "patch": {
        "description": "Updates a conversation (e.g. title and/or messages) by ID. This is a convenience wrapper over the create-or-update endpoint.",
        "operationId": "AiChatController_patchConversation",
        "parameters": [
          {
            "description": "Conversation ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation updated successfully"
          },
          "400": {
            "description": "Invalid conversation payload"
          },
          "404": {
            "description": "Conversation not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Patch/update conversation by ID",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/feedback": {
      "post": {
        "description": "Captures human-in-the-loop feedback about AI responses to improve future recommendations and analytics.",
        "operationId": "AiChatController_submitFeedback",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Feedback submitted successfully"
          },
          "400": {
            "description": "Invalid feedback payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Submit feedback on AI message or conversation",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/message": {
      "post": {
        "description": "Processes a user message with optional context, returning the structured AI response envelope and any tool call results.",
        "operationId": "AiChatController_processMessage",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Message processed successfully"
          },
          "400": {
            "description": "Invalid message payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Process a message with AI assistant",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/message/stream": {
      "post": {
        "description": "Initiates a server-sent-events (SSE) stream that emits incremental assistant responses as they are generated.",
        "operationId": "AiChatController_processMessageStream",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcessMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Streaming response started"
          },
          "400": {
            "description": "Invalid message payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Process message with streaming response",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/tool": {
      "post": {
        "description": "Executes a tool invocation initiated by the AI assistant and returns the tool's result payload.",
        "operationId": "AiChatController_handleToolCall",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HandleToolCallDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Tool executed successfully"
          },
          "400": {
            "description": "Invalid tool call payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute a tool call",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/upload": {
      "post": {
        "description": "Accepts Filestack handles to attach documents to a conversation and run automated content analysis.",
        "operationId": "AiChatController_uploadFiles",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Files uploaded and analyzed successfully"
          },
          "400": {
            "description": "Invalid file handle payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload files for AI analysis",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/upload/base64": {
      "post": {
        "description": "Uploads a base64-encoded file payload for AI analysis, useful for mobile and low-level clients.",
        "operationId": "AiChatController_uploadFileBase64",
        "parameters": [],
        "responses": {
          "200": {
            "description": "File uploaded and analyzed successfully"
          },
          "400": {
            "description": "Invalid base64 payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload file via base64 encoding",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/upload/direct": {
      "post": {
        "description": "Uploads a file directly to the backend for AI processing without requiring the client to obtain Filestack handles first.",
        "operationId": "AiChatController_uploadFileDirect",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "conversationId": {
                    "description": "Optional conversation to link file to",
                    "type": "string"
                  },
                  "file": {
                    "description": "File to upload",
                    "format": "binary",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "File uploaded and analyzed successfully"
          },
          "400": {
            "description": "Invalid or missing multipart file data"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Direct file upload to backend (multipart/form-data)",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/voice/transcribe": {
      "post": {
        "description": "Transcribes short audio clips via the configured STT provider (OpenAI or Groq), returning the transcript text and optional metadata.",
        "operationId": "AiChatController_transcribeVoice",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Audio transcribed successfully"
          },
          "400": {
            "description": "Invalid or unsupported audio payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Transcribe audio using configured Speech-to-Text provider (OpenAI or Groq)",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/chat/webhook/tool-result": {
      "post": {
        "description": "Webhook invoked by external AI runtimes to supply deferred tool execution outputs back to the platform.",
        "operationId": "AiChatController_handleToolResult",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolResultWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Tool result accepted"
          },
          "400": {
            "description": "Malformed tool result payload"
          },
          "401": {
            "description": "Invalid webhook signature"
          }
        },
        "summary": "Receive tool execution results from external AI",
        "tags": [
          "ai-chat"
        ]
      }
    },
    "/v1/ai/config": {
      "get": {
        "description": "Returns a consolidated snapshot of assistant settings, agent counts, knowledge base stats, and feature toggles.",
        "operationId": "AiConfigController_getConfig",
        "parameters": [],
        "responses": {
          "200": {
            "description": "AI configuration retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI configuration overview",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/agents": {
      "get": {
        "description": "Lists AI agents for the organization with optional pagination and active-state filtering.",
        "operationId": "AiConfigController_findAllAgents",
        "parameters": [
          {
            "description": "Filter by activation state (true/false).",
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {}
          },
          {
            "description": "Maximum agents per page.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Page number (1-based). Defaults to 1.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AI agents retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all AI agents",
        "tags": [
          "ai-config"
        ]
      },
      "post": {
        "description": "Creates a configurable AI agent profile including persona, routing, and activation metadata.",
        "operationId": "AiConfigController_createAgent",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAiAgentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "AI agent created successfully"
          },
          "400": {
            "description": "Invalid agent configuration payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new AI agent",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/agents/{id}": {
      "delete": {
        "description": "Deactivates or archives an AI agent. Historical analytics remain available unless purged separately.",
        "operationId": "AiConfigController_removeAgent",
        "parameters": [
          {
            "description": "AI agent identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AI agent deactivated successfully"
          },
          "404": {
            "description": "AI agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an AI agent",
        "tags": [
          "ai-config"
        ]
      },
      "get": {
        "description": "Retrieves a single AI agent including prompts, tool access, and lifecycle metadata.",
        "operationId": "AiConfigController_findOneAgent",
        "parameters": [
          {
            "description": "AI agent identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AI agent retrieved successfully"
          },
          "404": {
            "description": "AI agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an AI agent by ID",
        "tags": [
          "ai-config"
        ]
      },
      "patch": {
        "description": "Updates attributes of an existing agent such as system prompts, guardrails, and enabled tools.",
        "operationId": "AiConfigController_updateAgent",
        "parameters": [
          {
            "description": "AI agent identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAiAgentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "AI agent updated successfully"
          },
          "400": {
            "description": "Invalid agent update payload"
          },
          "404": {
            "description": "AI agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an AI agent",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/context": {
      "get": {
        "description": "Provides high-level metrics and recent activity that can be surfaced in the assistant UI for context.",
        "operationId": "AiConfigController_getBusinessContext",
        "parameters": [
          {
            "description": "Optional time range (e.g., 7d, 30d) for the snapshot.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current business snapshot for AI Assistant",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/context/update": {
      "post": {
        "description": "Accepts user navigation events so the assistant can tailor follow-up suggestions and responses.",
        "operationId": "AiConfigController_updateBusinessContext",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update assistant context based on user navigation",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/kb": {
      "get": {
        "description": "Lists knowledge base articles with pagination, search, and category filtering for assistant ingestion.",
        "operationId": "AiConfigController_findAllKbArticles",
        "parameters": [
          {
            "description": "Filter by article category or tag.",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {}
          },
          {
            "description": "Free-text query to match titles and content.",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          },
          {
            "description": "Maximum articles per page.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Page number (1-based). Defaults to 1.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "KB articles retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all knowledge base articles",
        "tags": [
          "ai-config"
        ]
      },
      "post": {
        "description": "Adds a new knowledge base article that becomes available for retrieval augmented generation (RAG) and agent lookups.",
        "operationId": "AiConfigController_createKbArticle",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKbArticleDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "KB article created successfully"
          },
          "400": {
            "description": "Invalid knowledge base payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a knowledge base article",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/kb/search/{query}": {
      "get": {
        "description": "Performs semantic and keyword search across knowledge base articles to power ask-the-docs use cases.",
        "operationId": "AiConfigController_searchKb",
        "parameters": [
          {
            "description": "Search string to evaluate",
            "in": "path",
            "name": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search knowledge base",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/kb/{id}": {
      "delete": {
        "description": "Deactivates a knowledge base article and removes it from AI retrieval results.",
        "operationId": "AiConfigController_removeKbArticle",
        "parameters": [
          {
            "description": "Knowledge base article identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "KB article deactivated successfully"
          },
          "404": {
            "description": "KB article not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a knowledge base article",
        "tags": [
          "ai-config"
        ]
      },
      "get": {
        "description": "Retrieves the full article content, metadata, and embedding status.",
        "operationId": "AiConfigController_findOneKbArticle",
        "parameters": [
          {
            "description": "Knowledge base article identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "KB article retrieved successfully"
          },
          "404": {
            "description": "KB article not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a knowledge base article by ID",
        "tags": [
          "ai-config"
        ]
      },
      "patch": {
        "description": "Updates article content, metadata, or publishing state. Re-triggers embedding when content changes.",
        "operationId": "AiConfigController_updateKbArticle",
        "parameters": [
          {
            "description": "Knowledge base article identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKbArticleDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "KB article updated successfully"
          },
          "400": {
            "description": "Invalid update payload"
          },
          "404": {
            "description": "KB article not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a knowledge base article",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/settings": {
      "get": {
        "description": "Retrieves organization-level AI assistant settings including prompts, tool access, and business hours.",
        "operationId": "AiConfigController_getSettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Settings retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI settings",
        "tags": [
          "ai-config"
        ]
      },
      "patch": {
        "description": "Updates global assistant configuration including routing, auto-handoff behavior, and default prompts.",
        "operationId": "AiConfigController_updateSettings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAiSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settings updated successfully"
          },
          "400": {
            "description": "Invalid settings payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update AI settings",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/suggestions": {
      "get": {
        "description": "Returns assistant recommendations for follow-up actions, messaging, or automations based on current data signals.",
        "operationId": "AiConfigController_getSuggestions",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get proactive AI suggestions",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/config/templates": {
      "get": {
        "description": "Returns the catalog of prebuilt agent templates available for quick-start configuration.",
        "operationId": "AiConfigController_getAgentTemplates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Templates retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI agent templates",
        "tags": [
          "ai-config"
        ]
      }
    },
    "/v1/ai/conversation-mining/mine": {
      "post": {
        "description": "Queues a job to mine a specific conversation for knowledge base enrichment and insight generation.",
        "operationId": "ConversationMiningController_mineConversations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Conversation mining job queued successfully"
          },
          "400": {
            "description": "Invalid mining request payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mine conversations for knowledge extraction",
        "tags": [
          "conversation-mining"
        ]
      }
    },
    "/v1/ai/conversation-mining/mine/contact/{contactId}": {
      "post": {
        "description": "Analyzes conversations associated with a single contact to extract themes and actionable insights.",
        "operationId": "ConversationMiningController_mineContactConversations",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact conversation mining completed"
          },
          "400": {
            "description": "Invalid contact mining payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mine conversations for a specific contact",
        "tags": [
          "conversation-mining"
        ]
      }
    },
    "/v1/ai/conversation-mining/mine/recent": {
      "post": {
        "description": "Initiates mining for a recent set of conversations bounded by days and result limits.",
        "operationId": "ConversationMiningController_mineRecentConversations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Recent conversation mining completed"
          },
          "400": {
            "description": "Invalid recent mining payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mine recent conversations",
        "tags": [
          "conversation-mining"
        ]
      }
    },
    "/v1/ai/conversation-mining/statistics": {
      "get": {
        "description": "Returns aggregate statistics about conversation mining jobs such as completion counts and processing time.",
        "operationId": "ConversationMiningController_getMiningStatistics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Mining statistics retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get conversation mining statistics",
        "tags": [
          "conversation-mining"
        ]
      }
    },
    "/v1/ai/embeddings/contact/{contactId}": {
      "post": {
        "description": "Computes or refreshes embeddings for a single contact profile to support similarity search.",
        "operationId": "EmbeddingController_embedContactProfile",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Embedding generated successfully"
          },
          "404": {
            "description": "Contact not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate embedding for a contact profile",
        "tags": [
          "ai-embeddings"
        ]
      }
    },
    "/v1/ai/embeddings/contacts/batch": {
      "post": {
        "description": "Queues a batch job to regenerate embeddings for every contact profile in the organization.",
        "operationId": "EmbeddingController_embedAllContactProfiles",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Batch embedding completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate embeddings for all contact profiles",
        "tags": [
          "ai-embeddings"
        ]
      }
    },
    "/v1/ai/embeddings/knowledge-base/batch": {
      "post": {
        "description": "Queues a batch job to regenerate embeddings for all knowledge base content.",
        "operationId": "EmbeddingController_embedAllKnowledgeBaseArticles",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Batch embedding completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate embeddings for all knowledge base articles",
        "tags": [
          "ai-embeddings"
        ]
      }
    },
    "/v1/ai/embeddings/knowledge-base/{articleId}": {
      "post": {
        "description": "Generates or refreshes the vector embedding for a specific knowledge base article.",
        "operationId": "EmbeddingController_embedKnowledgeBaseArticle",
        "parameters": [
          {
            "description": "Knowledge base article identifier",
            "in": "path",
            "name": "articleId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Embedding generated successfully"
          },
          "404": {
            "description": "Article not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate embedding for a knowledge base article",
        "tags": [
          "ai-embeddings"
        ]
      }
    },
    "/v1/ai/embeddings/search/contacts/{query}": {
      "get": {
        "description": "Performs semantic search across contact embeddings to find similar profiles.",
        "operationId": "EmbeddingController_searchContacts",
        "parameters": [
          {
            "description": "Natural language query",
            "in": "path",
            "name": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search contacts using vector similarity",
        "tags": [
          "ai-embeddings"
        ]
      }
    },
    "/v1/ai/embeddings/search/knowledge-base/{query}": {
      "get": {
        "description": "Performs a semantic search against knowledge base embeddings using the provided query string.",
        "operationId": "EmbeddingController_searchKnowledgeBase",
        "parameters": [
          {
            "description": "Natural language query",
            "in": "path",
            "name": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search knowledge base using vector similarity",
        "tags": [
          "ai-embeddings"
        ]
      }
    },
    "/v1/ai/inbox/analytics/{threadId}": {
      "get": {
        "description": "Returns engagement analytics such as message counts and response times for the specified thread.",
        "operationId": "AiInboxController_getMessageAnalytics",
        "parameters": [
          {
            "description": "Message thread ID",
            "in": "path",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "analytics": {
                      "properties": {
                        "avgResponseTimeMinutes": {
                          "type": "number"
                        },
                        "avgResponseTimeMs": {
                          "type": "number"
                        },
                        "firstMessageAt": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "inboundMessages": {
                          "type": "number"
                        },
                        "lastMessageAt": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "outboundMessages": {
                          "type": "number"
                        },
                        "totalMessages": {
                          "type": "number"
                        }
                      },
                      "type": "object"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Message analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get message analytics for a thread",
        "tags": [
          "ai-inbox"
        ]
      }
    },
    "/v1/ai/inbox/auto-response/generate": {
      "post": {
        "description": "Generates or declines to generate a fully automated response based on classification signals.",
        "operationId": "AiInboxController_generateAutoResponse",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClassifyMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "generated": {
                      "type": "boolean"
                    },
                    "response": {
                      "nullable": true,
                      "type": "string"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Auto-response generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate automatic response for a message",
        "tags": [
          "ai-inbox"
        ]
      }
    },
    "/v1/ai/inbox/classify": {
      "post": {
        "description": "Classifies a message into categories, urgency, and sentiment to drive automation and routing.",
        "operationId": "AiInboxController_classifyMessage",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClassifyMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "classification": {
                      "properties": {
                        "category": {
                          "enum": [
                            "booking",
                            "pricing",
                            "support",
                            "complaint",
                            "payment",
                            "general"
                          ],
                          "type": "string"
                        },
                        "confidence": {
                          "type": "number"
                        },
                        "intent": {
                          "type": "string"
                        },
                        "requiresHuman": {
                          "type": "boolean"
                        },
                        "sentiment": {
                          "enum": [
                            "positive",
                            "neutral",
                            "negative"
                          ],
                          "type": "string"
                        },
                        "suggestedActions": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "urgency": {
                          "enum": [
                            "low",
                            "medium",
                            "high",
                            "urgent"
                          ],
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Message classified successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Classify a message using AI",
        "tags": [
          "ai-inbox"
        ]
      }
    },
    "/v1/ai/inbox/insights/{threadId}": {
      "get": {
        "description": "Analyzes an entire thread to produce summaries, action items, and sentiment trends.",
        "operationId": "AiInboxController_generateConversationInsights",
        "parameters": [
          {
            "description": "Message thread ID",
            "in": "path",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "insights": {
                      "properties": {
                        "actionItems": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "customerSatisfaction": {
                          "type": "number"
                        },
                        "keyPoints": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "nextBestAction": {
                          "type": "string"
                        },
                        "sentimentTrend": {
                          "enum": [
                            "improving",
                            "stable",
                            "declining"
                          ],
                          "type": "string"
                        },
                        "summary": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Conversation insights generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate conversation insights for a thread",
        "tags": [
          "ai-inbox"
        ]
      }
    },
    "/v1/ai/inbox/process-incoming": {
      "post": {
        "description": "Runs the full AI inbox pipeline including classification, auto-response, and smart reply generation for an inbound message.",
        "operationId": "AiInboxController_processIncomingMessage",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClassifyMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "autoResponse": {
                      "nullable": true,
                      "type": "string"
                    },
                    "classification": {
                      "type": "object"
                    },
                    "insights": {
                      "type": "object"
                    },
                    "smartReplies": {
                      "type": "array"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Incoming message processed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Process incoming message with AI features",
        "tags": [
          "ai-inbox"
        ]
      }
    },
    "/v1/ai/inbox/smart-replies": {
      "post": {
        "description": "Generates smart replies by preferring AI when credits and configuration permit, falling back to templated suggestions otherwise.",
        "operationId": "AiInboxController_generateSmartRepliesSimple",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Smart replies generated successfully"
          },
          "400": {
            "description": "Invalid smart reply payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate smart reply drafts for a message (AI-powered or smart templates)",
        "tags": [
          "ai-inbox"
        ]
      }
    },
    "/v1/ai/inbox/smart-reply/generate": {
      "post": {
        "description": "Generates contextual reply drafts for a given thread and message using AI inbox heuristics.",
        "operationId": "AiInboxController_generateSmartReplyDrafts",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSmartReplyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "drafts": {
                      "items": {
                        "properties": {
                          "confidence": {
                            "type": "number"
                          },
                          "content": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "intent": {
                            "type": "string"
                          },
                          "knowledgeSources": {
                            "items": {
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "relevance": {
                                  "type": "number"
                                },
                                "title": {
                                  "type": "string"
                                }
                              },
                              "type": "object"
                            },
                            "type": "array"
                          },
                          "suggestedActions": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Smart reply drafts generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate smart reply drafts for a message",
        "tags": [
          "ai-inbox"
        ]
      }
    },
    "/v1/ai/intelligence/contact/{contactId}": {
      "get": {
        "operationId": "IntelligenceController_getContactIntelligence",
        "parameters": [
          {
            "description": "Contact ID",
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact intelligence profile retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get contact intelligence profile",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/conversation/mine": {
      "post": {
        "operationId": "IntelligenceController_mineConversationThread",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MineConversationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Conversation mining completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mine insights from conversation thread",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/conversation/mine-customer/{customerId}": {
      "get": {
        "operationId": "IntelligenceController_mineCustomerInteractions",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer interaction mining completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mine insights from customer interactions",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/conversation/mine-multiple": {
      "post": {
        "operationId": "IntelligenceController_mineMultipleConversations",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MineMultipleConversationsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Multiple conversation mining completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mine insights from multiple conversations",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/customer/churn-risk/{customerId}": {
      "get": {
        "operationId": "IntelligenceController_predictChurnRisk",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Churn risk prediction retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Predict customer churn risk",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/customer/contact-timing/{customerId}": {
      "get": {
        "operationId": "IntelligenceController_predictOptimalContactTiming",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Optimal contact timing retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Predict optimal contact timing",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/customer/lifetime-value/{customerId}": {
      "get": {
        "operationId": "IntelligenceController_predictCustomerLifetimeValue",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer lifetime value prediction retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Predict customer lifetime value",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/customer/predictions": {
      "post": {
        "operationId": "IntelligenceController_generateCustomerPredictions",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateCustomerPredictionsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "predictions": {
                      "type": "object"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Customer predictions generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate customer predictions",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/customer/profile/{customerId}": {
      "get": {
        "operationId": "IntelligenceController_getCustomerIntelligenceProfile",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer intelligence profile retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer intelligence profile",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/revenue/cross-sell/{customerId}": {
      "get": {
        "operationId": "IntelligenceController_detectCrossSellOpportunities",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cross-sell opportunities detected successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Detect cross-sell opportunities",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/revenue/intelligence": {
      "get": {
        "operationId": "IntelligenceController_getRevenueIntelligence",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Revenue intelligence retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get revenue intelligence overview",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/revenue/opportunities": {
      "post": {
        "operationId": "IntelligenceController_detectCustomerOpportunities",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DetectRevenueOpportunitiesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Revenue opportunities detected successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Detect revenue opportunities for customer",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/revenue/upsell/{customerId}": {
      "get": {
        "operationId": "IntelligenceController_detectUpsellOpportunities",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Upsell opportunities detected successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Detect upsell opportunities",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/scheduling/auto-book": {
      "post": {
        "operationId": "IntelligenceController_autoBookAppointment",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoBookAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Appointment auto-booking completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Auto-book appointment",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/scheduling/intelligence": {
      "get": {
        "operationId": "IntelligenceController_getSchedulingIntelligence",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Scheduling intelligence retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get scheduling intelligence insights",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/scheduling/optimize": {
      "post": {
        "operationId": "IntelligenceController_optimizeAppointments",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Appointment optimization completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Optimize existing appointments",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/scheduling/parse-request": {
      "post": {
        "operationId": "IntelligenceController_parseSchedulingRequest",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ParseSchedulingRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Scheduling request parsed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Parse scheduling request from message",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/intelligence/scheduling/recommendations": {
      "post": {
        "operationId": "IntelligenceController_generateSchedulingRecommendations",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSchedulingRecommendationsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Scheduling recommendations generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate scheduling recommendations",
        "tags": [
          "ai-intelligence"
        ]
      }
    },
    "/v1/ai/knowledge/create-knowledge-base": {
      "post": {
        "description": "Queues creation of a knowledge base entry, performing segmentation and privacy filtering in the background.",
        "operationId": "PrivacyAwareKnowledgeController_createKnowledgeBase",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Knowledge base creation job queued successfully"
          },
          "400": {
            "description": "Invalid knowledge base payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create knowledge base with privacy-aware segments",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/process-content": {
      "post": {
        "description": "Queues a privacy-aware processing job that extracts structured knowledge segments from raw content.",
        "operationId": "PrivacyAwareKnowledgeController_processContent",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Content processing job queued successfully"
          },
          "400": {
            "description": "Invalid content payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Process content and extract knowledge segments",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/search": {
      "post": {
        "description": "Searches knowledge segments while respecting organization, user role, and contact-level privacy constraints.",
        "operationId": "PrivacyAwareKnowledgeController_searchKnowledge",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Search results retrieved successfully"
          },
          "400": {
            "description": "Invalid search payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search knowledge with privacy awareness",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/search/business": {
      "get": {
        "description": "Searches organization-level knowledge segments while excluding contact-specific data.",
        "operationId": "PrivacyAwareKnowledgeController_searchBusinessKnowledge",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Business knowledge search results"
          },
          "400": {
            "description": "Invalid search payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search business knowledge only",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/search/contact/{contactId}": {
      "get": {
        "description": "Searches knowledge segments tied to a specific contact, enforcing privacy boundaries.",
        "operationId": "PrivacyAwareKnowledgeController_searchContactInformation",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact information search results"
          },
          "400": {
            "description": "Invalid search payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search contact-specific information",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/segments/batch-embedding": {
      "post": {
        "description": "Triggers a bulk embedding regeneration across knowledge segments respecting privacy filters.",
        "operationId": "PrivacyAwareKnowledgeController_batchUpdateSegmentEmbeddings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Batch embedding update completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Batch update embeddings for knowledge segments",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/segments/business": {
      "get": {
        "description": "Returns organization-wide knowledge segments that can be surfaced to assistants or knowledge tools.",
        "operationId": "PrivacyAwareKnowledgeController_getBusinessKnowledgeSegments",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Business knowledge segments retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all business knowledge segments",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/segments/contact/{contactId}": {
      "get": {
        "description": "Returns the privacy-filtered knowledge segments generated for a specific contact.",
        "operationId": "PrivacyAwareKnowledgeController_getContactKnowledgeSegments",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact knowledge segments retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all knowledge segments for a contact",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/segments/{segmentId}/embedding": {
      "put": {
        "description": "Regenerates the vector embedding for a single knowledge segment when content changes.",
        "operationId": "PrivacyAwareKnowledgeController_updateSegmentEmbedding",
        "parameters": [
          {
            "description": "Knowledge segment identifier",
            "in": "path",
            "name": "segmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Embedding updated successfully"
          },
          "404": {
            "description": "Segment not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update embedding for a knowledge segment",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/knowledge/statistics": {
      "get": {
        "description": "Reports metrics about knowledge segmentation, redactions, and access controls.",
        "operationId": "PrivacyAwareKnowledgeController_getPrivacyStatistics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Privacy statistics retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get privacy statistics for organization",
        "tags": [
          "privacy-aware-knowledge"
        ]
      }
    },
    "/v1/ai/optimization/business-assistant": {
      "post": {
        "operationId": "GEPAOptimizationController_optimizeBusinessAssistant",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Optimization completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Optimize AI Business Assistant prompt for organization",
        "tags": [
          "gepa-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/analytics": {
      "get": {
        "operationId": "OptimizationController_getExperienceAnalytics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Experience analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get experience analytics overview",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/analyze": {
      "post": {
        "operationId": "OptimizationController_analyzeCustomerExperience",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzeCustomerExperienceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Customer experience analyzed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Analyze customer experience for a specific customer",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/customer/{customerId}": {
      "get": {
        "operationId": "OptimizationController_getCustomerExperienceAnalysis",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer experience analysis retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer experience analysis",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/dashboard": {
      "get": {
        "operationId": "OptimizationController_getExperienceDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Experience dashboard data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get experience dashboard data",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/improvement-opportunities": {
      "get": {
        "operationId": "OptimizationController_identifyImprovementOpportunities",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Improvement opportunities identified successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Identify experience improvement opportunities",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/journey-map": {
      "post": {
        "operationId": "OptimizationController_generateCustomerJourneyMap",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateCustomerJourneyMapDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Customer journey map generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate customer journey map",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/metrics-trends": {
      "get": {
        "operationId": "OptimizationController_trackExperienceMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Experience metrics trends retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Track experience metrics over time",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/optimize": {
      "post": {
        "operationId": "OptimizationController_generateExperienceOptimization",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateExperienceOptimizationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Experience optimization generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate experience optimization recommendations",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/experience/optimize-customer/{customerId}": {
      "post": {
        "operationId": "OptimizationController_optimizeCustomerExperience",
        "parameters": [
          {
            "description": "Customer ID",
            "in": "path",
            "name": "customerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer experience optimization completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Optimize experience for a specific customer",
        "tags": [
          "ai-optimization"
        ]
      }
    },
    "/v1/ai/optimization/industry/{industry}": {
      "post": {
        "operationId": "GEPAOptimizationController_optimizeIndustry",
        "parameters": [
          {
            "description": "Industry type (roofing, hvac, plumbing, etc.)",
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Industry optimization completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Optimize industry-specific prompts",
        "tags": [
          "gepa-optimization"
        ]
      }
    },
    "/v1/ai/performance/dashboard/alerts": {
      "get": {
        "operationId": "PerformanceController_getPerformanceAlertsDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Performance alerts dashboard retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get performance alerts dashboard",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/dashboard/optimizations": {
      "get": {
        "operationId": "PerformanceController_getPerformanceOptimizationsDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Performance optimizations dashboard retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get performance optimizations dashboard",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/dashboard/overview": {
      "get": {
        "operationId": "PerformanceController_getPerformanceDashboardOverview",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Performance dashboard overview retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get performance dashboard overview",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/health": {
      "get": {
        "operationId": "PerformanceController_getSystemHealth",
        "parameters": [],
        "responses": {
          "200": {
            "description": "System health status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get system health status",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/metrics": {
      "get": {
        "operationId": "PerformanceController_getPerformanceMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Performance metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current performance metrics",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/metrics/ai": {
      "get": {
        "operationId": "PerformanceController_getAiMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "AI metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI performance metrics",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/metrics/business": {
      "get": {
        "operationId": "PerformanceController_getBusinessMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Business metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get business performance metrics",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/metrics/database": {
      "get": {
        "operationId": "PerformanceController_getDatabaseMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Database metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get database performance metrics",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/metrics/system": {
      "get": {
        "operationId": "PerformanceController_getSystemMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "System metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get system performance metrics",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/monitor": {
      "post": {
        "operationId": "PerformanceController_monitorPerformance",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Performance monitoring completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Monitor performance and generate alerts",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/optimizations": {
      "get": {
        "operationId": "PerformanceController_getOptimizations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Performance optimizations retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get performance optimization recommendations",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/report": {
      "get": {
        "operationId": "PerformanceController_generatePerformanceReport",
        "parameters": [
          {
            "description": "Time period for report",
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "7d",
                "30d",
                "90d",
                "1y"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Performance report generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate comprehensive performance report",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/performance/trends": {
      "get": {
        "operationId": "PerformanceController_getPerformanceTrends",
        "parameters": [
          {
            "description": "Time period for trends",
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "7d",
                "30d",
                "90d",
                "1y"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Performance trends retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get performance trends",
        "tags": [
          "ai-performance"
        ]
      }
    },
    "/v1/ai/queues/clean": {
      "post": {
        "description": "Removes completed jobs from all queues to keep storage usage minimal.",
        "operationId": "QueueManagementController_cleanCompletedJobs",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed jobs cleaned successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Clean completed jobs",
        "tags": [
          "queue-management"
        ]
      }
    },
    "/v1/ai/queues/content-processing": {
      "post": {
        "description": "Queues a content ingestion job for privacy-aware processing and knowledge extraction.",
        "operationId": "QueueManagementController_queueContentProcessing",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Content processing job queued successfully"
          },
          "400": {
            "description": "Invalid content payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Queue content processing job",
        "tags": [
          "queue-management"
        ]
      }
    },
    "/v1/ai/queues/conversation-mining": {
      "post": {
        "description": "Queues a mining job for a specific conversation to extract structured insights.",
        "operationId": "QueueManagementController_queueConversationMining",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Conversation mining job queued successfully"
          },
          "400": {
            "description": "Invalid conversation payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Queue conversation mining job",
        "tags": [
          "queue-management"
        ]
      }
    },
    "/v1/ai/queues/embedding-generation": {
      "post": {
        "description": "Queues an embedding generation task for knowledge or contact entities.",
        "operationId": "QueueManagementController_queueEmbeddingGeneration",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Embedding generation job queued successfully"
          },
          "400": {
            "description": "Invalid embedding payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Queue embedding generation job",
        "tags": [
          "queue-management"
        ]
      }
    },
    "/v1/ai/queues/job/{queueName}/{jobId}": {
      "get": {
        "description": "Retrieves the status and metadata of a specific job within a queue.",
        "operationId": "QueueManagementController_getJobStatus",
        "parameters": [
          {
            "description": "Queue name (e.g., content-processing)",
            "in": "path",
            "name": "queueName",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Background job identifier",
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job status retrieved successfully"
          },
          "404": {
            "description": "Job not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get job status",
        "tags": [
          "queue-management"
        ]
      }
    },
    "/v1/ai/queues/pause/{queueName}": {
      "put": {
        "description": "Temporarily halts processing of the specified queue.",
        "operationId": "QueueManagementController_pauseQueue",
        "parameters": [
          {
            "description": "Queue name to pause",
            "in": "path",
            "name": "queueName",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queue paused successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pause queue",
        "tags": [
          "queue-management"
        ]
      }
    },
    "/v1/ai/queues/resume/{queueName}": {
      "put": {
        "description": "Resumes processing of a queue that was previously paused.",
        "operationId": "QueueManagementController_resumeQueue",
        "parameters": [
          {
            "description": "Queue name to resume",
            "in": "path",
            "name": "queueName",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queue resumed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Resume queue",
        "tags": [
          "queue-management"
        ]
      }
    },
    "/v1/ai/queues/statistics": {
      "get": {
        "description": "Returns runtime statistics for processing queues including job counts and latency.",
        "operationId": "QueueManagementController_getQueueStatistics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Queue statistics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get queue statistics",
        "tags": [
          "queue-management"
        ]
      }
    },
    "/v1/aiva/chat": {
      "post": {
        "description": "Processes a text message against the selected voice agent configuration.",
        "operationId": "AivaPublicController_chat",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AivaChatDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Chat response returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a text chat message to an AIVA agent",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/analytics": {
      "get": {
        "operationId": "AivaMetricsController_getAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get comprehensive AIVA analytics for organization",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/calls/{callSid}": {
      "get": {
        "operationId": "AivaMetricsController_getCallMetrics",
        "parameters": [
          {
            "in": "path",
            "name": "callSid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call metrics retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get metrics for a specific AIVA call",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/costs": {
      "get": {
        "operationId": "AivaMetricsController_getCostAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cost analytics retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AIVA cost analytics for organization",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/costs/estimate": {
      "get": {
        "operationId": "AivaMetricsController_estimateCost",
        "parameters": [
          {
            "in": "query",
            "name": "durationSec",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cost estimate returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Estimate cost for a potential AIVA call",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/noise-suppressor-pool": {
      "get": {
        "description": "Same shape + intent as /vad-pool — non-zero coldFallbacks means AIVA_NOISE_SUPPRESSOR_POOL_SIZE is below the concurrent-call ceiling and first-turn audio is reaching STT unscrubbed on some calls.",
        "operationId": "AivaMetricsController_getNoiseSuppressorPoolStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Noise-suppressor pool stats returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Noise-suppressor pool stats (ops-only)",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/operations": {
      "get": {
        "operationId": "AivaMetricsController_getOperationsMetrics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operational metrics retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get operational health metrics and alerts for AIVA",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/organization": {
      "get": {
        "operationId": "AivaMetricsController_getOrgMetrics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization metrics retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get aggregated AIVA metrics for organization",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/pricing": {
      "get": {
        "operationId": "AivaMetricsController_getPricingRates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Pricing rates returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current AIVA pricing rates",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/metrics/vad-pool": {
      "get": {
        "description": "Returns pool capacity, checkout rate, and warm-vs-cold hit rate. A non-zero coldFallbacks counter at steady state means AIVA_VAD_POOL_SIZE is below the concurrent-call ceiling and first-turn VAD is running cold on some calls.",
        "operationId": "AivaMetricsController_getVadPoolStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "VAD pool stats returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "VAD worker pool stats (ops-only)",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/operator/calls/{callId}": {
      "get": {
        "operationId": "OperatorController_getCallView",
        "parameters": [
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operator call view retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get operator workflow and outcome data for a voice call",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/operator/outcomes": {
      "get": {
        "operationId": "OperatorController_listOutcomes",
        "parameters": [
          {
            "description": "Filter by workflow type key",
            "in": "query",
            "name": "workflowType",
            "required": false,
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "description": "Filter by disposition label",
            "in": "query",
            "name": "disposition",
            "required": false,
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "description": "Filter by internal call id (UUID)",
            "in": "query",
            "name": "callId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by operator workflow execution id (UUID)",
            "in": "query",
            "name": "workflowExecutionId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum rows to return (1–100)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Opaque pagination cursor: pass the `nextCursor` value from the previous response to fetch the next page",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Include outcomes with createdAt on or after this instant (ISO 8601)",
            "in": "query",
            "name": "createdAfter",
            "required": false,
            "schema": {
              "example": "2026-01-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "description": "Include outcomes with createdAt on or before this instant (ISO 8601)",
            "in": "query",
            "name": "createdBefore",
            "required": false,
            "schema": {
              "example": "2026-12-31T23:59:59.999Z",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Post-call outcomes retrieved"
          },
          "400": {
            "description": "Invalid query or pagination cursor"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List post-call outcomes linked to operator workflows for the active organization",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/operator/rollout-summary": {
      "get": {
        "description": "Returns cheap aggregate counts for the authenticated organization and whether this deployment has operator runtime enabled (AIVA_OPERATOR_RUNTIME_ENABLED).",
        "operationId": "OperatorController_rolloutSummary",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Rollout summary retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Operator rollout summary (org aggregates + process feature flag)",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/operator/workflows": {
      "get": {
        "operationId": "OperatorController_listExecutions",
        "parameters": [
          {
            "description": "Filter by execution status (e.g. active, completed)",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "description": "Filter by workflow type key",
            "in": "query",
            "name": "workflowType",
            "required": false,
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "description": "Filter by internal call id (UUID)",
            "in": "query",
            "name": "callId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum rows to return (1–100)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Opaque pagination cursor: pass the `nextCursor` value from the previous response to fetch the next page",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Include executions with startedAt on or after this instant (ISO 8601)",
            "in": "query",
            "name": "startedAfter",
            "required": false,
            "schema": {
              "example": "2026-01-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "description": "Include executions with startedAt on or before this instant (ISO 8601)",
            "in": "query",
            "name": "startedBefore",
            "required": false,
            "schema": {
              "example": "2026-12-31T23:59:59.999Z",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operator workflow executions retrieved"
          },
          "400": {
            "description": "Invalid query or pagination cursor"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List operator workflow executions for the active organization",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/operator/workflows/{executionId}": {
      "get": {
        "operationId": "OperatorController_getExecution",
        "parameters": [
          {
            "in": "path",
            "name": "executionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operator workflow execution retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get one operator workflow execution with events and post-call outcome",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/outbound": {
      "post": {
        "description": "Creates a Twilio outbound call that streams audio into the AIVA realtime stack. Returns the Twilio Call SID as callId.",
        "operationId": "AivaOutboundController_initiate",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AivaOutboundCallRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AivaOutboundCallResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate an outbound AIVA phone call (PSTN)",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/sessions": {
      "post": {
        "description": "Creates a sessionId + signed token for connecting to the public AIVA realtime WebSocket. Audio format is currently μ-law 8k (base64) for lowest latency and easiest carrier compatibility.",
        "operationId": "AivaPublicController_createSession",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAivaSessionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Session created"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a realtime AIVA session (public WS)",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/transfers": {
      "post": {
        "operationId": "AivaTransferController_transferCall",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Call transfer initiated"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Transfer an active AIVA call",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/transfers/cancel": {
      "post": {
        "operationId": "AivaTransferController_cancelWarmTransfer",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelWarmTransferDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Warm transfer canceled"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel an in-progress warm transfer for an active AIVA call",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/transfers/complete": {
      "post": {
        "operationId": "AivaTransferController_completeWarmTransfer",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteWarmTransferDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Warm transfer completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Complete a warm transfer for an active AIVA call",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/voiceagent/agent": {
      "delete": {
        "operationId": "AivaVoiceAgentController_deactivateAgent",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Deactivate the AIVA voice agent",
        "tags": [
          "aiva-voiceagent"
        ]
      },
      "get": {
        "operationId": "AivaVoiceAgentController_getAgent",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get active AIVA voice agent configuration",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/analytics": {
      "get": {
        "operationId": "AivaVoiceAgentController_analytics",
        "parameters": [
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "groupBy",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AIVA analytics",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/calls": {
      "get": {
        "operationId": "AivaVoiceAgentController_listCalls",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "minDuration",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "maxDuration",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AIVA call history",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/calls/{callId}": {
      "get": {
        "operationId": "AivaVoiceAgentController_getCall",
        "parameters": [
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AIVA call details",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/faqs": {
      "get": {
        "operationId": "AivaVoiceAgentController_getFaqs",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get FAQs for the AIVA voice agent",
        "tags": [
          "aiva-voiceagent"
        ]
      },
      "put": {
        "operationId": "AivaVoiceAgentController_updateFaqs",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update FAQs for the AIVA voice agent",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/knowledge-bases": {
      "get": {
        "operationId": "AivaVoiceAgentController_getKnowledgeBases",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get knowledge bases attached to the AIVA voice agent",
        "tags": [
          "aiva-voiceagent"
        ]
      },
      "put": {
        "operationId": "AivaVoiceAgentController_updateKnowledgeBases",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Attach or detach knowledge bases to/from the AIVA voice agent",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/onboard": {
      "post": {
        "operationId": "AivaVoiceAgentController_onboard",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Provision AIVA voice agent for organization",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/onboarding-status": {
      "get": {
        "operationId": "AivaVoiceAgentController_onboardingStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AIVA onboarding completion status",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/settings": {
      "put": {
        "operationId": "AivaVoiceAgentController_updateSettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update AIVA voice agent runtime settings",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/sync-knowledge-base": {
      "post": {
        "operationId": "AivaVoiceAgentController_syncKnowledgeBase",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync org knowledge base for AIVA runtime (re-embeds all articles)",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/test-call": {
      "post": {
        "operationId": "AivaVoiceAgentController_testCall",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate outbound AIVA test call",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/voiceagent/voices": {
      "get": {
        "operationId": "AivaVoiceAgentController_listVoices",
        "parameters": [
          {
            "in": "query",
            "name": "gender",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available TTS voices for agent customization",
        "tags": [
          "aiva-voiceagent"
        ]
      }
    },
    "/v1/aiva/webrtc/ice": {
      "get": {
        "description": "Returns short-lived ICE server credentials from Twilio. Frontend should call this right before creating RTCPeerConnection().",
        "operationId": "AivaWebRtcController_ice",
        "parameters": [],
        "responses": {
          "200": {
            "description": "ICE servers returned"
          }
        },
        "summary": "Get ICE servers (Twilio TURN) for WebRTC clients",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/aiva/webrtc/offer": {
      "post": {
        "description": "Exchanges SDP offer/answer to establish a WebRTC PeerConnection (ICE + DTLS-SRTP). Audio is transported over a DataChannel as base64 PCM16 frames.",
        "operationId": "AivaWebRtcController_offer",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AivaWebRtcOfferDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Answer SDP returned"
          }
        },
        "summary": "WebRTC offer/answer (public, token-authenticated)",
        "tags": [
          "aiva"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/ai/usage": {
      "get": {
        "operationId": "AdvancedDashboardController_getAIUsage",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AI usage retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI usage statistics",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/charts": {
      "get": {
        "operationId": "AdvancedDashboardController_getCharts",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly",
                "quarterly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Chart data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get chart data",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/customer/satisfaction": {
      "get": {
        "operationId": "AdvancedDashboardController_getCustomerSatisfaction",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2024-12-31",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer satisfaction retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer satisfaction metrics",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/financial/summary": {
      "get": {
        "operationId": "AdvancedDashboardController_getFinancialSummary",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Financial summary retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get financial summary data",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/growth/indicators": {
      "get": {
        "operationId": "AdvancedDashboardController_getGrowthIndicators",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Growth indicators retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get growth metrics",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/kpis": {
      "get": {
        "operationId": "AdvancedDashboardController_getKPIs",
        "parameters": [],
        "responses": {
          "200": {
            "description": "KPIs retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get key performance indicators",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/metrics": {
      "get": {
        "operationId": "AdvancedDashboardController_getMetrics",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get dashboard metrics",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/operational/metrics": {
      "get": {
        "operationId": "AdvancedDashboardController_getOperationalMetrics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2024-12-31",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operational metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get operational KPIs",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/predictive/insights": {
      "get": {
        "operationId": "AdvancedDashboardController_getPredictiveInsights",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Predictive insights retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI-powered predictions",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/team/performance": {
      "get": {
        "operationId": "AdvancedDashboardController_getTeamPerformance",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team performance retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get team performance analytics",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/advanced-dashboard/workflow/efficiency": {
      "get": {
        "operationId": "AdvancedDashboardController_getWorkflowEfficiency",
        "parameters": [
          {
            "in": "query",
            "name": "workflowId",
            "required": false,
            "schema": {
              "example": "workflow_123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow efficiency retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow performance metrics",
        "tags": [
          "analytics-dashboard"
        ]
      }
    },
    "/v1/analytics/ai/usage": {
      "get": {
        "operationId": "AnalyticsController_getAiUsageAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AI usage analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get AI usage analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/communications/stats": {
      "get": {
        "operationId": "AnalyticsController_getCommunicationStats",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Communication stats retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get communication statistics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/credits/analytics": {
      "get": {
        "operationId": "AnalyticsController_getCreditAnalytics",
        "parameters": [
          {
            "description": "Number of days to analyze (default: 30)",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Credit analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get credit usage analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/credits/efficiency": {
      "get": {
        "operationId": "AnalyticsController_getCreditEfficiency",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credit efficiency report retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get credit efficiency report",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/credits/forecast": {
      "get": {
        "operationId": "AnalyticsController_getCreditForecast",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credit forecast retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get credit usage forecast",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/customer/satisfaction": {
      "get": {
        "operationId": "AnalyticsController_getCustomerSatisfaction",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer satisfaction metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer satisfaction metrics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/customers/acquisition": {
      "get": {
        "operationId": "AnalyticsController_getCustomerAcquisitionTrends",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "monthly",
                "quarterly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer acquisition trends retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer acquisition trends",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/dashboard/charts": {
      "get": {
        "operationId": "AnalyticsController_getDashboardCharts",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly",
                "quarterly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dashboard chart data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get dashboard chart data",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/dashboard/export": {
      "get": {
        "operationId": "AnalyticsController_exportDashboardReport__analytics_dashboard_export",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly",
                "quarterly"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "csv",
                "xlsx"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export dashboard overview analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/dashboard/kpis": {
      "get": {
        "operationId": "AnalyticsController_getDashboardKPIs",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Dashboard KPIs retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get dashboard KPIs",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/dashboard/metrics": {
      "get": {
        "operationId": "AnalyticsController_getDashboardMetrics",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dashboard metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get dashboard metrics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/financial/summary": {
      "get": {
        "operationId": "AnalyticsController_getFinancialSummary",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "monthly",
                "quarterly",
                "yearly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Financial summary report retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get financial summary report",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/growth/indicators": {
      "get": {
        "operationId": "AnalyticsController_getGrowthIndicators",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "monthly",
                "quarterly",
                "yearly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Growth indicators retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get growth indicators",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/industry/{industry}/benchmarks": {
      "get": {
        "operationId": "IndustryKpisController_getIndustryBenchmarks",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Benchmarks retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry benchmarks",
        "tags": [
          "Industry KPIs"
        ]
      }
    },
    "/v1/analytics/industry/{industry}/kpis": {
      "get": {
        "operationId": "IndustryKpisController_getIndustryKpis",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndustryKpiResponseDto"
                }
              }
            },
            "description": "KPIs retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific KPIs",
        "tags": [
          "Industry KPIs"
        ]
      }
    },
    "/v1/analytics/industry/{industry}/metrics": {
      "get": {
        "operationId": "IndustryKpisController_getIndustryMetrics",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeframe",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Metrics retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific real-time metrics",
        "tags": [
          "Industry KPIs"
        ]
      }
    },
    "/v1/analytics/industry/{industry}/trends": {
      "get": {
        "operationId": "IndustryKpisController_getIndustryTrends",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trends retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific trends",
        "tags": [
          "Industry KPIs"
        ]
      }
    },
    "/v1/analytics/kpis": {
      "get": {
        "operationId": "AdvancedAnalyticsController_getIndustryKPIs",
        "parameters": [],
        "responses": {
          "200": {
            "description": "KPIs retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific KPIs",
        "tags": [
          "Advanced Analytics"
        ]
      }
    },
    "/v1/analytics/kpis/{kpiId}": {
      "get": {
        "operationId": "AdvancedAnalyticsController_getKPIData",
        "parameters": [
          {
            "in": "path",
            "name": "kpiId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "KPI data retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "KPI not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get specific KPI data",
        "tags": [
          "Advanced Analytics"
        ]
      }
    },
    "/v1/analytics/kpis/{kpiId}/calculate": {
      "post": {
        "operationId": "AdvancedAnalyticsController_calculateKPI",
        "parameters": [
          {
            "in": "path",
            "name": "kpiId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "KPI calculated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "KPI not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Calculate KPI value",
        "tags": [
          "Advanced Analytics"
        ]
      }
    },
    "/v1/analytics/locations": {
      "get": {
        "operationId": "AnalyticsController_getLocationAnalytics",
        "parameters": [
          {
            "description": "Optional location identifier",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Reporting period",
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "today",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Location analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get location analytics dashboard data",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/operational/metrics": {
      "get": {
        "operationId": "AnalyticsController_getOperationalMetrics__analytics_operational_metrics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operational metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get operational metrics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/predictive/insights": {
      "get": {
        "operationId": "AnalyticsController_getPredictiveInsights",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Predictive insights retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get predictive insights",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/reports": {
      "get": {
        "operationId": "AnalyticsController_getCrmReports",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly",
                "quarterly",
                "yearly"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CRM reports data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get CRM reports data",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/reports/custom": {
      "post": {
        "operationId": "AnalyticsController_generateCustomReport",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Custom report generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate custom report",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/reports/export": {
      "get": {
        "operationId": "AnalyticsController_exportDashboardReport__analytics_reports_export",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly",
                "quarterly"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "csv",
                "xlsx"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export dashboard overview analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/revenue/trends": {
      "get": {
        "operationId": "AnalyticsController_getRevenueTrends",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "monthly",
                "quarterly",
                "yearly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revenue trends retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get revenue trends",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/sales/pipeline": {
      "get": {
        "operationId": "AnalyticsController_getSalesPipeline",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sales pipeline retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get sales pipeline analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/services/performance": {
      "get": {
        "operationId": "AnalyticsController_getTopPerformingServices",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Service performance retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get top performing services",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/team/performance": {
      "get": {
        "operationId": "AnalyticsController_getTeamPerformance",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "monthly",
                "quarterly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team performance analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get team performance analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/analytics/tickets/agents": {
      "get": {
        "operationId": "TicketAnalyticsController_agents",
        "parameters": [
          {
            "description": "ISO8601 start date (inclusive)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date (inclusive)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of rows to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 50,
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent performance retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get agent performance metrics",
        "tags": [
          "tickets-analytics"
        ]
      }
    },
    "/v1/analytics/tickets/categories": {
      "get": {
        "operationId": "TicketAnalyticsController_categories",
        "parameters": [
          {
            "description": "ISO8601 start date (inclusive)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date (inclusive)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of rows to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 50,
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Category breakdown retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get ticket breakdown by category",
        "tags": [
          "tickets-analytics"
        ]
      }
    },
    "/v1/analytics/tickets/sla": {
      "get": {
        "operationId": "TicketAnalyticsController_sla",
        "parameters": [
          {
            "description": "ISO8601 start date (inclusive)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date (inclusive)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SLA metrics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get ticket SLA metrics",
        "tags": [
          "tickets-analytics"
        ]
      }
    },
    "/v1/analytics/tickets/trends": {
      "get": {
        "operationId": "TicketAnalyticsController_trends",
        "parameters": [
          {
            "description": "ISO8601 start date (inclusive)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date (inclusive)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Trend period bucket size",
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "default": "day",
              "enum": [
                "day",
                "week",
                "month",
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          },
          {
            "description": "Number of buckets to return",
            "in": "query",
            "name": "count",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 365,
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket trends retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get ticket trends over time",
        "tags": [
          "tickets-analytics"
        ]
      }
    },
    "/v1/analytics/workflow/efficiency": {
      "get": {
        "operationId": "AnalyticsController_getWorkflowEfficiency",
        "parameters": [
          {
            "in": "query",
            "name": "workflowId",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow efficiency analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow efficiency analytics",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/api-keys/{id}/rotate": {
      "post": {
        "operationId": "ApiKeysController_rotateApiKey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key rotated; plaintext secret returned once"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Rotate API key secret",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/v1/api/widget/{widgetKey}/analytics": {
      "post": {
        "operationId": "WidgetLocationsPublicController_trackEvent__api_widget_widgetKey_analytics",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetLocationsAnalyticsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Event tracked successfully"
          },
          "400": {
            "description": "Invalid event payload"
          },
          "404": {
            "description": "Widget not found or disabled"
          }
        },
        "summary": "Track widget analytics events (privacy-safe)",
        "tags": [
          "widget-locations"
        ]
      }
    },
    "/v1/api/widget/{widgetKey}/config": {
      "get": {
        "operationId": "WidgetPublicController_getConfig",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "referer",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "user-agent",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/api/widget/{widgetKey}/knowledge/search": {
      "post": {
        "operationId": "WidgetPublicController_searchKnowledge",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/api/widget/{widgetKey}/locations/analytics": {
      "post": {
        "operationId": "WidgetLocationsPublicController_trackEvent__api_widget_widgetKey_locations_analytics",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetLocationsAnalyticsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Event tracked successfully"
          },
          "400": {
            "description": "Invalid event payload"
          },
          "404": {
            "description": "Widget not found or disabled"
          }
        },
        "summary": "Track widget analytics events (privacy-safe)",
        "tags": [
          "widget-locations"
        ]
      }
    },
    "/v1/api/widget/{widgetKey}/locations/search": {
      "get": {
        "operationId": "WidgetLocationsPublicController_search",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Address, city, or ZIP to search (client may also pass lat/lng for distance)",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Latitude for distance ranking (best-effort)",
            "in": "query",
            "name": "lat",
            "required": false,
            "schema": {
              "example": 32.7767,
              "type": "number"
            }
          },
          {
            "description": "Longitude for distance ranking (best-effort)",
            "in": "query",
            "name": "lng",
            "required": false,
            "schema": {
              "example": -96.797,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 25,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Public locations search for embeddable widget (ranked candidates)",
        "tags": [
          "widget-locations"
        ]
      }
    },
    "/v1/api/widget/{widgetKey}/session": {
      "post": {
        "operationId": "WidgetPublicController_createSession",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "referer",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "user-agent",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetSessionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/api/widget/{widgetKey}/session/{sessionId}": {
      "get": {
        "operationId": "WidgetPublicController_getSession",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/api/widget/{widgetKey}/session/{sessionId}/attachments": {
      "post": {
        "operationId": "WidgetPublicController_uploadAttachment",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadWidgetAttachmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/api/widget/{widgetKey}/session/{sessionId}/messages": {
      "get": {
        "operationId": "WidgetPublicController_getMessages",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "WidgetPublicController_sendMessage",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendWidgetMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/api/widget/{widgetKey}/session/{sessionId}/presence/read": {
      "post": {
        "operationId": "WidgetPublicController_updateRead",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWidgetReadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/api/widget/{widgetKey}/session/{sessionId}/presence/typing": {
      "post": {
        "operationId": "WidgetPublicController_updateTyping",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWidgetTypingDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/appointments": {
      "get": {
        "operationId": "AppointmentsController_findAll__appointments",
        "parameters": [
          {
            "description": "Page number for pagination",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "example": 1,
              "type": "number"
            }
          },
          {
            "description": "Number of items per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "example": 10,
              "type": "number"
            }
          },
          {
            "description": "Search term to filter appointments",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "example": "john doe",
              "type": "string"
            }
          },
          {
            "description": "Filter by appointment status",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "scheduled",
                "confirmed",
                "completed",
                "cancelled",
                "no_show"
              ],
              "example": "scheduled",
              "type": "string"
            }
          },
          {
            "description": "Filter by staff member ID",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "example": "staff_123",
              "type": "string"
            }
          },
          {
            "description": "Filter by contact ID",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "example": "contact_123",
              "type": "string"
            }
          },
          {
            "description": "Filter by location ID",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "description": "Filter appointments starting on or after this date (YYYY-MM-DD format)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-11-11",
              "type": "string"
            }
          },
          {
            "description": "Filter appointments starting on or before this date (YYYY-MM-DD format)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-11-18",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointments retrieved successfully"
          },
          "400": {
            "description": "Invalid date format or query parameters"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all appointments",
        "tags": [
          "calendar-appointments"
        ]
      },
      "post": {
        "operationId": "AppointmentsController_create__appointments",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Appointment created successfully"
          },
          "400": {
            "description": "Scheduling conflict detected"
          },
          "404": {
            "description": "Service offering or staff not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new appointment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/analytics/by-service": {
      "get": {
        "operationId": "AppointmentsAnalyticsController_getByService",
        "parameters": [
          {
            "description": "ISO8601 start date for analytics window (defaults to last 30 days).",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-12-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date for analytics window (defaults to now).",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-12-25T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "description": "Optional location filter (and timezone source for peak-hours).",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "description": "Optional staff filter.",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "example": "staff_123",
              "type": "string"
            }
          },
          {
            "description": "Optional status filter (defaults vary by endpoint).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "completed",
              "type": "string"
            }
          },
          {
            "description": "Number of rows to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 50,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Sort key for ranked analytics.",
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "default": "bookings",
              "enum": [
                "bookings",
                "completed",
                "revenue"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Service analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Top services by bookings / completed / revenue",
        "tags": [
          "calendar-appointments-analytics"
        ]
      }
    },
    "/v1/appointments/analytics/by-staff": {
      "get": {
        "operationId": "AppointmentsAnalyticsController_getByStaff",
        "parameters": [
          {
            "description": "ISO8601 start date for analytics window (defaults to last 30 days).",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-12-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date for analytics window (defaults to now).",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-12-25T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "description": "Optional location filter (and timezone source for peak-hours).",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "description": "Optional staff filter.",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "example": "staff_123",
              "type": "string"
            }
          },
          {
            "description": "Optional status filter (defaults vary by endpoint).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "completed",
              "type": "string"
            }
          },
          {
            "description": "Number of rows to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 50,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Sort key for ranked analytics.",
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "default": "bookings",
              "enum": [
                "bookings",
                "completed",
                "revenue"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Staff analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Top staff by bookings / completed / revenue",
        "tags": [
          "calendar-appointments-analytics"
        ]
      }
    },
    "/v1/appointments/analytics/export": {
      "get": {
        "operationId": "AppointmentsAnalyticsController_exportCsv",
        "parameters": [
          {
            "description": "ISO8601 start date for analytics window (defaults to last 30 days).",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-12-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date for analytics window (defaults to now).",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-12-25T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "description": "Optional location filter (and timezone source for peak-hours).",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "description": "Optional staff filter.",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "example": "staff_123",
              "type": "string"
            }
          },
          {
            "description": "Optional status filter (defaults vary by endpoint).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "completed",
              "type": "string"
            }
          },
          {
            "description": "Number of rows to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 50,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Sort key for ranked analytics.",
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "default": "bookings",
              "enum": [
                "bookings",
                "completed",
                "revenue"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file stream"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export appointment analytics as CSV",
        "tags": [
          "calendar-appointments-analytics"
        ]
      }
    },
    "/v1/appointments/analytics/peak-hours": {
      "get": {
        "operationId": "AppointmentsAnalyticsController_getPeakHours",
        "parameters": [
          {
            "description": "ISO8601 start date for analytics window (defaults to last 30 days).",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-12-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date for analytics window (defaults to now).",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-12-25T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "description": "Optional location filter (and timezone source for peak-hours).",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "description": "Optional staff filter.",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "example": "staff_123",
              "type": "string"
            }
          },
          {
            "description": "Optional status filter (defaults vary by endpoint).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "completed",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Peak hours analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Peak booking hours (hour-of-day histogram)",
        "tags": [
          "calendar-appointments-analytics"
        ]
      }
    },
    "/v1/appointments/analytics/summary": {
      "get": {
        "operationId": "AppointmentsAnalyticsController_getSummary",
        "parameters": [
          {
            "description": "ISO8601 start date for analytics window (defaults to last 30 days).",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-12-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "description": "ISO8601 end date for analytics window (defaults to now).",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-12-25T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "description": "Optional location filter (and timezone source for peak-hours).",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "description": "Optional staff filter.",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "example": "staff_123",
              "type": "string"
            }
          },
          {
            "description": "Optional status filter (defaults vary by endpoint).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "completed",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment analytics summary retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Appointment analytics summary",
        "tags": [
          "calendar-appointments-analytics"
        ]
      }
    },
    "/v1/appointments/best-staff": {
      "post": {
        "operationId": "AppointmentsController_findBestStaff__appointments_best_staff",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Best staff assignments found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find best staff assignment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/calendar-overview": {
      "get": {
        "operationId": "AppointmentsController_getCalendarOverview__appointments_calendar_overview",
        "parameters": [
          {
            "description": "Start date (YYYY-MM-DD)",
            "in": "query",
            "name": "start",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End date (YYYY-MM-DD)",
            "in": "query",
            "name": "end",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar overview retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get calendar overview for date range",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/calendar/staff/{staffId}": {
      "get": {
        "operationId": "AppointmentsController_getStaffCalendar__appointments_calendar_staff_staffId",
        "parameters": [
          {
            "in": "path",
            "name": "staffId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Start date (ISO 8601)",
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End date (ISO 8601)",
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Staff calendar retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get appointments for specific staff member in date range",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/conflicts/check": {
      "get": {
        "operationId": "AppointmentsController_checkConflicts__appointments_conflicts_check",
        "parameters": [
          {
            "in": "query",
            "name": "startTime",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endTime",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resourceIds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "includeBuffers",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conflict check completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check for scheduling conflicts",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/overview": {
      "get": {
        "operationId": "AppointmentsController_getCalendarOverview__appointments_overview",
        "parameters": [
          {
            "description": "Start date (YYYY-MM-DD)",
            "in": "query",
            "name": "start",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End date (YYYY-MM-DD)",
            "in": "query",
            "name": "end",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar overview retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get calendar overview for date range",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/slots/available": {
      "get": {
        "operationId": "AppointmentsController_findAvailableSlots__appointments_slots_available",
        "parameters": [
          {
            "in": "query",
            "name": "serviceOfferingId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "staffId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "bufferBeforeMinutes",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "bufferAfterMinutes",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available slots retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find available time slots",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/{id}": {
      "delete": {
        "operationId": "AppointmentsController_remove__appointments_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment cancelled successfully"
          },
          "404": {
            "description": "Appointment not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel an appointment",
        "tags": [
          "calendar-appointments"
        ]
      },
      "get": {
        "operationId": "AppointmentsController_findOne__appointments_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment retrieved successfully"
          },
          "404": {
            "description": "Appointment not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an appointment by ID",
        "tags": [
          "calendar-appointments"
        ]
      },
      "patch": {
        "operationId": "AppointmentsController_update__appointments_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Appointment updated successfully"
          },
          "400": {
            "description": "Scheduling conflict detected"
          },
          "404": {
            "description": "Appointment not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an appointment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/{id}/cancel": {
      "post": {
        "operationId": "AppointmentsController_cancel__appointments_id_cancel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment cancelled successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel an appointment (alias)",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/{id}/ics": {
      "get": {
        "operationId": "AppointmentsController_downloadIcs__appointments_id_ics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ICS generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download ICS file for appointment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/{id}/instance": {
      "delete": {
        "operationId": "AppointmentsController_removeInstance__appointments_id_instance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a single recurring appointment instance",
        "tags": [
          "calendar-appointments"
        ]
      },
      "patch": {
        "operationId": "AppointmentsController_updateInstance__appointments_id_instance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a single recurring appointment instance",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/{id}/reschedule": {
      "post": {
        "operationId": "AppointmentsController_reschedule__appointments_id_reschedule",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Appointment rescheduled successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reschedule an appointment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/{id}/series": {
      "get": {
        "operationId": "AppointmentsController_getSeries__appointments_id_series",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get recurring appointment series",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/appointments/{id}/transfer": {
      "post": {
        "operationId": "AppointmentsController_transfer__appointments_id_transfer",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Appointment transferred successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Transfer an appointment to another location",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/assets": {
      "get": {
        "operationId": "AssetsController_listAssets",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "ACTIVE",
                "IN_SERVICE",
                "MAINTENANCE",
                "RETIRED",
                "LOST"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by asset type id",
            "in": "query",
            "name": "assetTypeId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by location id",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by contact id",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free text search (name, serial number, tags)",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (1-indexed)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "description": "Page size",
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "default": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List assets with filters/pagination",
        "tags": [
          "Assets"
        ]
      },
      "post": {
        "operationId": "AssetsController_createAsset",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAssetDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an asset record",
        "tags": [
          "Assets"
        ]
      }
    },
    "/v1/assets/types": {
      "get": {
        "operationId": "AssetsController_listAssetTypes",
        "parameters": [
          {
            "description": "Search by name or key (case-insensitive contains).",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List asset types",
        "tags": [
          "Assets"
        ]
      },
      "post": {
        "operationId": "AssetsController_createAssetType",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAssetTypeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new asset type",
        "tags": [
          "Assets"
        ]
      }
    },
    "/v1/assets/{id}": {
      "get": {
        "operationId": "AssetsController_getAsset",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get asset details",
        "tags": [
          "Assets"
        ]
      }
    },
    "/v1/assets/{id}/movements": {
      "post": {
        "operationId": "AssetsController_recordMovement",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordAssetMovementDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record an asset movement / inventory adjustment",
        "tags": [
          "Assets"
        ]
      }
    },
    "/v1/assistant/context": {
      "post": {
        "operationId": "AssistantController_updateContext",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContextDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Context updated successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update assistant context",
        "tags": [
          "Assistant"
        ]
      }
    },
    "/v1/assistant/context/{timeframe}": {
      "get": {
        "operationId": "AssistantController_getContext",
        "parameters": [
          {
            "in": "path",
            "name": "timeframe",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContextResponseDto"
                }
              }
            },
            "description": "Context retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get assistant context for a specific timeframe",
        "tags": [
          "Assistant"
        ]
      }
    },
    "/v1/assistant/dashboard": {
      "get": {
        "operationId": "AssistantController_getDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Dashboard data retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get assistant dashboard data",
        "tags": [
          "Assistant"
        ]
      }
    },
    "/v1/assistant/insights": {
      "get": {
        "operationId": "AssistantController_getInsights",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Insights retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get assistant insights",
        "tags": [
          "Assistant"
        ]
      }
    },
    "/v1/assistant/suggestions": {
      "get": {
        "operationId": "AssistantController_getSuggestions",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suggestions retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get assistant suggestions",
        "tags": [
          "Assistant"
        ]
      }
    },
    "/v1/audit/logs": {
      "get": {
        "operationId": "AuditController_getAuditLogs",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entityType",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit logs retrieved successfully"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get audit logs",
        "tags": [
          "audit"
        ]
      }
    },
    "/v1/audit/stats": {
      "get": {
        "operationId": "AuditController_getAuditStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Audit stats retrieved successfully"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get audit log statistics",
        "tags": [
          "audit"
        ]
      }
    },
    "/v1/auth/api-keys": {
      "get": {
        "operationId": "AuthController_listApiKeys",
        "parameters": [],
        "responses": {
          "200": {
            "description": "API keys retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List API keys",
        "tags": [
          "auth"
        ]
      },
      "post": {
        "operationId": "AuthController_createApiKey",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "API key created"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create API key",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/api-keys/{id}": {
      "delete": {
        "operationId": "AuthController_revokeApiKey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key revoked"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Revoke API key",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/api-keys/{id}/rotate": {
      "post": {
        "operationId": "AuthController_rotateApiKey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key rotated; plaintext secret returned once"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Rotate API key secret",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/invitations/accept": {
      "post": {
        "operationId": "AuthController_acceptInvitation",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptInvitationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Invitation accepted successfully"
          },
          "400": {
            "description": "Invalid or expired token"
          }
        },
        "summary": "Accept team invitation and set password",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/invitations/set-password": {
      "post": {
        "operationId": "AuthController_setPassword",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPasswordDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password set successfully"
          },
          "400": {
            "description": "Invalid or expired token"
          }
        },
        "summary": "Set password for invited user (when password was provided during invite)",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/login": {
      "post": {
        "operationId": "AuthController_login",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Login successful"
          },
          "401": {
            "description": "Invalid credentials"
          }
        },
        "summary": "Login with email and password",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/logout": {
      "post": {
        "operationId": "AuthController_logout",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Logout successful"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Logout user",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/me": {
      "get": {
        "operationId": "AuthController_getProfile",
        "parameters": [],
        "responses": {
          "200": {
            "description": "User profile retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current user profile",
        "tags": [
          "auth"
        ]
      },
      "patch": {
        "operationId": "AuthController_updateProfile",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Profile updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update current user profile",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/password/reset": {
      "post": {
        "operationId": "AuthController_resetPassword",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password reset successfully"
          }
        },
        "summary": "Reset password using token",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/password/reset-request": {
      "post": {
        "operationId": "AuthController_requestPasswordReset",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password reset email queued"
          }
        },
        "summary": "Request a password reset email",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/refresh": {
      "post": {
        "operationId": "AuthController_refresh",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshTokenDto"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Token refreshed successfully"
          },
          "401": {
            "description": "Invalid token"
          }
        },
        "summary": "Refresh access token using a long-lived refresh token",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/register": {
      "post": {
        "operationId": "AuthController_register",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "User registered successfully"
          },
          "409": {
            "description": "User already exists"
          }
        },
        "summary": "Register a new user and organization",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/users/invite": {
      "post": {
        "operationId": "AuthController_inviteUser",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteUserDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "User invited/created"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Invite/create a user within your organization",
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/batch": {
      "post": {
        "description": "Execute multiple independent API operations in a single request. Operations are executed in parallel for better performance.",
        "operationId": "BatchOperationsController_executeBatch",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResponseDto"
                }
              }
            },
            "description": "Batch operations completed"
          },
          "400": {
            "description": "Invalid batch request"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute multiple operations in parallel",
        "tags": [
          "batch"
        ]
      }
    },
    "/v1/brand-kit": {
      "get": {
        "operationId": "BrandKitController_getBrandKit",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get brand kit",
        "tags": [
          "brand-kit"
        ]
      },
      "patch": {
        "operationId": "BrandKitController_patchBrandKit",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBrandKitDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Patch brand kit",
        "tags": [
          "brand-kit"
        ]
      },
      "put": {
        "operationId": "BrandKitController_updateBrandKit",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBrandKitDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update brand kit",
        "tags": [
          "brand-kit"
        ]
      }
    },
    "/v1/brand-kit/assets": {
      "post": {
        "operationId": "BrandKitController_uploadAsset",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BrandKitAssetUploadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Asset uploaded"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload brand kit asset",
        "tags": [
          "brand-kit"
        ]
      }
    },
    "/v1/brand-kit/effective": {
      "get": {
        "operationId": "BrandKitController_getEffective",
        "parameters": [
          {
            "in": "query",
            "name": "context",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get brand kit merged with context override",
        "tags": [
          "brand-kit"
        ]
      }
    },
    "/v1/brand-kit/overrides/{context}": {
      "delete": {
        "operationId": "BrandKitController_deleteOverride",
        "parameters": [
          {
            "in": "path",
            "name": "context",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete brand kit override for context",
        "tags": [
          "brand-kit"
        ]
      },
      "put": {
        "operationId": "BrandKitController_updateOverride",
        "parameters": [
          {
            "in": "path",
            "name": "context",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBrandKitOverrideDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update brand kit override for context",
        "tags": [
          "brand-kit"
        ]
      }
    },
    "/v1/bulk/companies/delete": {
      "post": {
        "operationId": "BulkOperationsController_bulkDeleteCompanies",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteCompaniesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Companies deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Bulk delete companies",
        "tags": [
          "bulk-operations"
        ]
      }
    },
    "/v1/bulk/contacts/delete": {
      "post": {
        "operationId": "BulkOperationsController_bulkDeleteContacts",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteContactsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contacts deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Bulk delete contacts",
        "tags": [
          "bulk-operations"
        ]
      }
    },
    "/v1/bulk/deals/delete": {
      "post": {
        "operationId": "BulkOperationsController_bulkDeleteDeals",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteDealsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Deals deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Bulk delete deals",
        "tags": [
          "bulk-operations"
        ]
      }
    },
    "/v1/business-hours": {
      "get": {
        "operationId": "BusinessHoursController_getBusinessHours",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get business hours (org defaults + location overrides)",
        "tags": [
          "business-hours"
        ]
      },
      "put": {
        "operationId": "BusinessHoursController_updateDefaults",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBusinessHoursDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update org-level business hours",
        "tags": [
          "business-hours"
        ]
      }
    },
    "/v1/business-hours/closures": {
      "post": {
        "operationId": "BusinessHoursController_createClosure",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClosureDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a closure date",
        "tags": [
          "business-hours"
        ]
      }
    },
    "/v1/business-hours/effective": {
      "get": {
        "operationId": "BusinessHoursController_getEffective",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "YYYY-MM-DD",
            "in": "query",
            "name": "date",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get effective business hours for date/location",
        "tags": [
          "business-hours"
        ]
      }
    },
    "/v1/business-hours/locations/{locationId}": {
      "delete": {
        "operationId": "BusinessHoursController_deleteLocation",
        "parameters": [
          {
            "in": "path",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete business hours override for location",
        "tags": [
          "business-hours"
        ]
      },
      "put": {
        "operationId": "BusinessHoursController_updateLocation",
        "parameters": [
          {
            "in": "path",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBusinessHoursDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update business hours override for location",
        "tags": [
          "business-hours"
        ]
      }
    },
    "/v1/business-hours/migrate": {
      "post": {
        "operationId": "BusinessHoursController_migrate",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Migration status"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Migrate legacy business hours into centralized table",
        "tags": [
          "business-hours"
        ]
      }
    },
    "/v1/cache-test/clear": {
      "delete": {
        "description": "Clears cached CRM entities for the organization. Intended for diagnostics only.",
        "operationId": "CacheTestController_clearCache",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Cache cleared successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Clear cache",
        "tags": [
          "cache-test"
        ]
      }
    },
    "/v1/cache-test/invalidate-contact/{orgId}/{contactId}": {
      "delete": {
        "operationId": "CacheTestController_invalidateContactCache",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/cache-test/invalidate-thread/{orgId}/{threadId}": {
      "delete": {
        "operationId": "CacheTestController_invalidateThreadCache",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/cache-test/ping": {
      "get": {
        "description": "Performs a simple ping against the cache layer to confirm availability.",
        "operationId": "CacheTestController_ping",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Cache ping successful"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test cache ping",
        "tags": [
          "cache-test"
        ]
      }
    },
    "/v1/cache-test/stats": {
      "get": {
        "description": "Returns cache hit rate, size, and other runtime diagnostics for troubleshooting.",
        "operationId": "CacheTestController_getCacheStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Cache stats retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get cache statistics",
        "tags": [
          "cache-test"
        ]
      }
    },
    "/v1/cache-test/test-activities/{orgId}": {
      "post": {
        "operationId": "CacheTestController_testActivitiesCache",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/cache-test/test-contact/{orgId}/{contactId}": {
      "post": {
        "description": "Simulates a cache lookup for a contact to validate read/write behaviour.",
        "operationId": "CacheTestController_testContactCache",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Contact ID",
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact cache test successful"
          },
          "403": {
            "description": "Organization mismatch"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test contact caching",
        "tags": [
          "cache-test"
        ]
      }
    },
    "/v1/cache-test/test-contacts/{orgId}": {
      "post": {
        "operationId": "CacheTestController_testContactsCache",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/cache-test/test-messages/{orgId}/{threadId}": {
      "post": {
        "description": "Simulates caching for a message thread to validate storage and retrieval flows.",
        "operationId": "CacheTestController_testMessageCache",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Message thread ID",
            "in": "path",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message cache test successful"
          },
          "403": {
            "description": "Organization mismatch"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test message caching",
        "tags": [
          "cache-test"
        ]
      }
    },
    "/v1/cadences": {
      "get": {
        "operationId": "CadenceController_listCadences",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List cadences",
        "tags": [
          "Cadence"
        ]
      },
      "post": {
        "operationId": "CadenceController_createCadence",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCadenceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a cadence template",
        "tags": [
          "Cadence"
        ]
      }
    },
    "/v1/cadences/quick-launch": {
      "post": {
        "operationId": "CadenceController_quickLaunchCadence",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CadenceQuickLaunchPublishDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate and create a cadence via Quick Launch",
        "tags": [
          "Cadence"
        ]
      }
    },
    "/v1/cadences/quick-launch/preview": {
      "post": {
        "operationId": "CadenceController_previewQuickLaunchCadence",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CadenceQuickLaunchDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a cadence via Quick Launch",
        "tags": [
          "Cadence"
        ]
      }
    },
    "/v1/cadences/{id}": {
      "get": {
        "operationId": "CadenceController_getCadence",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get cadence details",
        "tags": [
          "Cadence"
        ]
      }
    },
    "/v1/cadences/{id}/analytics": {
      "get": {
        "operationId": "CadenceController_getAnalytics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cadence analytics",
        "tags": [
          "Cadence"
        ]
      }
    },
    "/v1/cadences/{id}/enroll": {
      "post": {
        "operationId": "CadenceController_enroll",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnrollCadenceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Enroll contacts into cadence",
        "tags": [
          "Cadence"
        ]
      }
    },
    "/v1/cadences/{id}/status": {
      "patch": {
        "operationId": "CadenceController_updateStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCadenceStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update cadence status",
        "tags": [
          "Cadence"
        ]
      }
    },
    "/v1/calendar-configs": {
      "get": {
        "operationId": "CalendarConfigsController_list",
        "parameters": [
          {
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List calendar configurations for organization",
        "tags": [
          "calendar-configs"
        ]
      },
      "post": {
        "operationId": "CalendarConfigsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCalendarConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create calendar configuration",
        "tags": [
          "calendar-configs"
        ]
      }
    },
    "/v1/calendar-configs/{id}": {
      "delete": {
        "operationId": "CalendarConfigsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete (soft) calendar configuration",
        "tags": [
          "calendar-configs"
        ]
      },
      "get": {
        "operationId": "CalendarConfigsController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get calendar configuration by ID",
        "tags": [
          "calendar-configs"
        ]
      },
      "put": {
        "operationId": "CalendarConfigsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCalendarConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update calendar configuration",
        "tags": [
          "calendar-configs"
        ]
      }
    },
    "/v1/calendar/appointments": {
      "get": {
        "operationId": "AppointmentsController_findAll__calendar_appointments",
        "parameters": [
          {
            "description": "Page number for pagination",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "example": 1,
              "type": "number"
            }
          },
          {
            "description": "Number of items per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "example": 10,
              "type": "number"
            }
          },
          {
            "description": "Search term to filter appointments",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "example": "john doe",
              "type": "string"
            }
          },
          {
            "description": "Filter by appointment status",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "scheduled",
                "confirmed",
                "completed",
                "cancelled",
                "no_show"
              ],
              "example": "scheduled",
              "type": "string"
            }
          },
          {
            "description": "Filter by staff member ID",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "example": "staff_123",
              "type": "string"
            }
          },
          {
            "description": "Filter by contact ID",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "example": "contact_123",
              "type": "string"
            }
          },
          {
            "description": "Filter by location ID",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "description": "Filter appointments starting on or after this date (YYYY-MM-DD format)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-11-11",
              "type": "string"
            }
          },
          {
            "description": "Filter appointments starting on or before this date (YYYY-MM-DD format)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-11-18",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointments retrieved successfully"
          },
          "400": {
            "description": "Invalid date format or query parameters"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all appointments",
        "tags": [
          "calendar-appointments"
        ]
      },
      "post": {
        "operationId": "AppointmentsController_create__calendar_appointments",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Appointment created successfully"
          },
          "400": {
            "description": "Scheduling conflict detected"
          },
          "404": {
            "description": "Service offering or staff not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new appointment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/best-staff": {
      "post": {
        "operationId": "AppointmentsController_findBestStaff__calendar_appointments_best_staff",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Best staff assignments found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find best staff assignment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/calendar-overview": {
      "get": {
        "operationId": "AppointmentsController_getCalendarOverview__calendar_appointments_calendar_overview",
        "parameters": [
          {
            "description": "Start date (YYYY-MM-DD)",
            "in": "query",
            "name": "start",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End date (YYYY-MM-DD)",
            "in": "query",
            "name": "end",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar overview retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get calendar overview for date range",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/calendar/staff/{staffId}": {
      "get": {
        "operationId": "AppointmentsController_getStaffCalendar__calendar_appointments_calendar_staff_staffId",
        "parameters": [
          {
            "in": "path",
            "name": "staffId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Start date (ISO 8601)",
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End date (ISO 8601)",
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Staff calendar retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get appointments for specific staff member in date range",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/conflicts/check": {
      "get": {
        "operationId": "AppointmentsController_checkConflicts__calendar_appointments_conflicts_check",
        "parameters": [
          {
            "in": "query",
            "name": "startTime",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endTime",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resourceIds",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "includeBuffers",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conflict check completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check for scheduling conflicts",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/overview": {
      "get": {
        "operationId": "AppointmentsController_getCalendarOverview__calendar_appointments_overview",
        "parameters": [
          {
            "description": "Start date (YYYY-MM-DD)",
            "in": "query",
            "name": "start",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End date (YYYY-MM-DD)",
            "in": "query",
            "name": "end",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar overview retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get calendar overview for date range",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/slots/available": {
      "get": {
        "operationId": "AppointmentsController_findAvailableSlots__calendar_appointments_slots_available",
        "parameters": [
          {
            "in": "query",
            "name": "serviceOfferingId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "staffId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "bufferBeforeMinutes",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "bufferAfterMinutes",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available slots retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find available time slots",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/{id}": {
      "delete": {
        "operationId": "AppointmentsController_remove__calendar_appointments_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment cancelled successfully"
          },
          "404": {
            "description": "Appointment not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel an appointment",
        "tags": [
          "calendar-appointments"
        ]
      },
      "get": {
        "operationId": "AppointmentsController_findOne__calendar_appointments_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment retrieved successfully"
          },
          "404": {
            "description": "Appointment not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an appointment by ID",
        "tags": [
          "calendar-appointments"
        ]
      },
      "patch": {
        "operationId": "AppointmentsController_update__calendar_appointments_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Appointment updated successfully"
          },
          "400": {
            "description": "Scheduling conflict detected"
          },
          "404": {
            "description": "Appointment not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an appointment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/{id}/cancel": {
      "post": {
        "operationId": "AppointmentsController_cancel__calendar_appointments_id_cancel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment cancelled successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel an appointment (alias)",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/{id}/ics": {
      "get": {
        "operationId": "AppointmentsController_downloadIcs__calendar_appointments_id_ics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ICS generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download ICS file for appointment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/{id}/instance": {
      "delete": {
        "operationId": "AppointmentsController_removeInstance__calendar_appointments_id_instance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a single recurring appointment instance",
        "tags": [
          "calendar-appointments"
        ]
      },
      "patch": {
        "operationId": "AppointmentsController_updateInstance__calendar_appointments_id_instance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a single recurring appointment instance",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/{id}/reschedule": {
      "post": {
        "operationId": "AppointmentsController_reschedule__calendar_appointments_id_reschedule",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Appointment rescheduled successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reschedule an appointment",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/{id}/series": {
      "get": {
        "operationId": "AppointmentsController_getSeries__calendar_appointments_id_series",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get recurring appointment series",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/appointments/{id}/transfer": {
      "post": {
        "operationId": "AppointmentsController_transfer__calendar_appointments_id_transfer",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Appointment transferred successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Transfer an appointment to another location",
        "tags": [
          "calendar-appointments"
        ]
      }
    },
    "/v1/calendar/resources": {
      "get": {
        "operationId": "ResourcesAliasController_list",
        "parameters": [
          {
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List resources (calendar alias)",
        "tags": [
          "calendar-resources"
        ]
      },
      "post": {
        "operationId": "ResourcesAliasController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateResourceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a resource (calendar alias)",
        "tags": [
          "calendar-resources"
        ]
      }
    },
    "/v1/calendar/resources/{id}": {
      "delete": {
        "operationId": "ResourcesAliasController_archive",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Archive (deactivate) a resource (calendar alias)",
        "tags": [
          "calendar-resources"
        ]
      },
      "get": {
        "operationId": "ResourcesAliasController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a resource by id (calendar alias)",
        "tags": [
          "calendar-resources"
        ]
      },
      "patch": {
        "operationId": "ResourcesAliasController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateResourceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a resource (calendar alias)",
        "tags": [
          "calendar-resources"
        ]
      }
    },
    "/v1/calendar/services": {
      "get": {
        "operationId": "CalendarAliasController_getServices",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Calendar services retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List calendar services (frontend alias)",
        "tags": [
          "calendar"
        ]
      }
    },
    "/v1/calendar/staff": {
      "get": {
        "operationId": "CalendarAliasController_getStaff",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Calendar staff retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List calendar staff (frontend alias)",
        "tags": [
          "calendar"
        ]
      }
    },
    "/v1/calendar/sync/health": {
      "get": {
        "operationId": "CalendarSyncHealthController_health",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Calendar sync health for current organization",
        "tags": [
          "calendar-sync"
        ]
      }
    },
    "/v1/calendar/webhooks/google": {
      "post": {
        "operationId": "CalendarWebhooksController_handleGoogleWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Google Calendar webhook (push notifications)",
        "tags": [
          "calendar-webhooks"
        ]
      }
    },
    "/v1/call-notes": {
      "get": {
        "operationId": "CallNotesController_list",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "aiva",
                "retell",
                "dialer"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "handler",
            "required": false,
            "schema": {
              "enum": [
                "ai",
                "human"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "processing",
                "ready",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List call notes with filtering and pagination",
        "tags": [
          "call-notes"
        ]
      }
    },
    "/v1/call-notes/analyze-call/{callId}": {
      "post": {
        "operationId": "CallNotesController_analyzeCall",
        "parameters": [
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger call intelligence analysis for a specific call",
        "tags": [
          "call-notes"
        ]
      }
    },
    "/v1/call-notes/by-call/{callId}": {
      "get": {
        "operationId": "CallNotesController_getByCallId",
        "parameters": [
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get note for a specific call (unified call ID)",
        "tags": [
          "call-notes"
        ]
      }
    },
    "/v1/call-notes/{id}": {
      "get": {
        "operationId": "CallNotesController_getById",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a call note by ID",
        "tags": [
          "call-notes"
        ]
      },
      "patch": {
        "operationId": "CallNotesController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCallNoteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a call note (edit summary, action items, etc.)",
        "tags": [
          "call-notes"
        ]
      }
    },
    "/v1/call-notes/{id}/actions/{index}/execute": {
      "post": {
        "operationId": "CallNotesController_executeCta",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "index",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteCtaDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute an action CTA (create task, deal, etc.)",
        "tags": [
          "call-notes"
        ]
      }
    },
    "/v1/call-notes/{id}/link-contact": {
      "post": {
        "operationId": "CallNotesController_linkContact",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkContactDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Manually link a contact to this call note",
        "tags": [
          "call-notes"
        ]
      }
    },
    "/v1/call-notes/{id}/regenerate": {
      "post": {
        "operationId": "CallNotesController_regenerate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Re-run analysis pipeline for this call note",
        "tags": [
          "call-notes"
        ]
      }
    },
    "/v1/calls": {
      "get": {
        "description": "Returns paginated call records with optional status and direction filters.",
        "operationId": "CallsController_findAll",
        "parameters": [
          {
            "description": "Filter by call direction (inbound/outbound).",
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {}
          },
          {
            "description": "Filter by call status.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          },
          {
            "description": "Maximum calls per page.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Page number (1-based).",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calls retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all calls",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/batch-analyze-sentiment": {
      "post": {
        "description": "Triggers sentiment analysis for multiple calls.",
        "operationId": "CallsController_batchAnalyzeSentiment",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchAnalyzeCallSentimentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Batch analysis queued"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Batch analyze sentiment",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/outbound": {
      "post": {
        "description": "Starts an outbound call from an AI agent to a destination number.",
        "operationId": "CallsController_initiateOutbound",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiateOutboundCallDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Call initiated successfully."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate an outbound call",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/unified": {
      "get": {
        "operationId": "UnifiedCallsController_listCalls",
        "parameters": [
          {
            "in": "query",
            "name": "sortOrder",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "enum": [
                "startedAt",
                "duration",
                "sentiment"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "agentId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "handler",
            "required": false,
            "schema": {
              "enum": [
                "ai",
                "human"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "enum": [
                "inbound",
                "outbound"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "retell",
                "aiva",
                "dialer"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List unified calls across voice providers, AIVA, and Dialer",
        "tags": [
          "unified-calls"
        ]
      }
    },
    "/v1/calls/unified/active": {
      "get": {
        "operationId": "UnifiedCallsController_getActiveCalls",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List active unified calls for realtime dashboard",
        "tags": [
          "unified-calls"
        ]
      }
    },
    "/v1/calls/unified/analytics": {
      "get": {
        "operationId": "UnifiedCallsController_getAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "groupBy",
            "required": false,
            "schema": {
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "retell",
                "aiva",
                "dialer"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "enum": [
                "24h",
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get unified call analytics across all sources",
        "tags": [
          "unified-calls"
        ]
      }
    },
    "/v1/calls/unified/analytics/export": {
      "get": {
        "operationId": "UnifiedCallsController_exportAnalyticsCsv",
        "parameters": [
          {
            "in": "query",
            "name": "groupBy",
            "required": false,
            "schema": {
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "retell",
                "aiva",
                "dialer"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "enum": [
                "24h",
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export unified call analytics as CSV",
        "tags": [
          "unified-calls"
        ]
      }
    },
    "/v1/calls/unified/{callId}": {
      "get": {
        "operationId": "UnifiedCallsController_getCallDetail",
        "parameters": [
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get unified call detail by call ID",
        "tags": [
          "unified-calls"
        ]
      }
    },
    "/v1/calls/webhook/incoming": {
      "post": {
        "description": "Processes an inbound call webhook, resolves organization context, and records the call.",
        "operationId": "CallsController_handleIncomingCall",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Call processed successfully"
          }
        },
        "summary": "Handle incoming call from Retell AI",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/webhook/register-call": {
      "post": {
        "description": "Registers a call manually when a webhook cannot be received.",
        "operationId": "CallsController_registerCall",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Call registered successfully"
          }
        },
        "summary": "Register a call (alternative to incoming webhook)",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/webhook/retell": {
      "post": {
        "description": "Entry point for Retell AI webhooks. Routes to appropriate handler based on event type.",
        "operationId": "CallsController_handleRetellWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle Retell AI webhook with customer context",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/webhook/status": {
      "post": {
        "description": "Applies status changes from Retell AI to the corresponding call record.",
        "operationId": "CallsController_handleCallStatusUpdate",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Call status updated successfully"
          }
        },
        "summary": "Handle call status update from Retell AI",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/webhook/transcription": {
      "post": {
        "description": "Stores transcription updates from Retell AI for an existing call.",
        "operationId": "CallsController_handleTranscriptionUpdate",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Transcription processed successfully"
          }
        },
        "summary": "Handle transcription update from Retell AI",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/webhook/transfer": {
      "post": {
        "description": "Processes transfer webhook events and routes calls to human agents when needed.",
        "operationId": "CallsController_handleCallTransfer",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Call transfer processed successfully"
          }
        },
        "summary": "Handle call transfer from Retell AI",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/{callId}/analyze-sentiment": {
      "post": {
        "description": "Triggers sentiment analysis for a specific call.",
        "operationId": "CallsController_analyzeSentiment",
        "parameters": [
          {
            "description": "Call identifier",
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzeCallSentimentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Sentiment analysis queued successfully"
          },
          "404": {
            "description": "Call not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Analyze call sentiment",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/{id}({0}.+)": {
      "get": {
        "description": "Retrieves details for a single call when it belongs to the requesting organization.",
        "operationId": "CallsController_findOne",
        "parameters": [
          {
            "description": "Call identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call retrieved successfully"
          },
          "404": {
            "description": "Call not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a call by ID",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/{id}({0}.+)/recording": {
      "get": {
        "description": "Returns the recording URL (when available) for a completed call.",
        "operationId": "CallsController_getRecording",
        "parameters": [
          {
            "description": "Call identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recording URL returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call recording URL",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/calls/{id}({0}.+)/transcript": {
      "get": {
        "description": "Returns a best-effort transcript segmented for UI display.",
        "operationId": "CallsController_getTranscript",
        "parameters": [
          {
            "description": "Call identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transcript returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call transcript",
        "tags": [
          "ai-calls"
        ]
      }
    },
    "/v1/channels": {
      "get": {
        "operationId": "ChannelsController_list",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Filter channels by locationId (optional; defaults to active location or scope)",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "enum": [
                "SMS",
                "EMAIL",
                "WHATSAPP",
                "TELEGRAM",
                "WIDGET",
                "CALL"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by active/inactive channel state",
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Search externalId/provider (contains)",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List send-from channels (numbers/inboxes) for inbox",
        "tags": [
          "inbox-channels"
        ]
      },
      "post": {
        "operationId": "ChannelsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new channel (admin) for a location",
        "tags": [
          "inbox-channels"
        ]
      }
    },
    "/v1/channels/email/resend/provision": {
      "post": {
        "operationId": "ChannelsController_provisionResend",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionResendInboxDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Provision a managed Resend inbox/channel",
        "tags": [
          "inbox-channels"
        ]
      }
    },
    "/v1/channels/email/smtp/connect": {
      "post": {
        "operationId": "ChannelsController_connectSmtp",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectSmtpChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Connect SMTP email inbox/channel",
        "tags": [
          "inbox-channels"
        ]
      }
    },
    "/v1/channels/{id}": {
      "delete": {
        "operationId": "ChannelsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a channel",
        "tags": [
          "inbox-channels"
        ]
      },
      "get": {
        "operationId": "ChannelsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a channel by ID",
        "tags": [
          "inbox-channels"
        ]
      },
      "patch": {
        "operationId": "ChannelsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a channel",
        "tags": [
          "inbox-channels"
        ]
      }
    },
    "/v1/channels/{id}/email-config": {
      "get": {
        "operationId": "ChannelsController_getEmailConfig",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get email provider config for a channel (secrets masked)",
        "tags": [
          "inbox-channels"
        ]
      }
    },
    "/v1/channels/{id}/verify": {
      "post": {
        "operationId": "ChannelsController_verifyEmailChannel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Verify email channel connectivity/provider configuration",
        "tags": [
          "inbox-channels"
        ]
      }
    },
    "/v1/client-portal/contacts": {
      "get": {
        "operationId": "ClientPortalSettingsController_listContacts",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List contacts with portal access (frontend contract)",
        "tags": [
          "Client Portal (Frontend Contract)"
        ]
      }
    },
    "/v1/client-portal/contacts/{contactId}/invite": {
      "post": {
        "operationId": "ClientPortalSettingsController_invite",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Invite contact to portal (frontend contract)",
        "tags": [
          "Client Portal (Frontend Contract)"
        ]
      }
    },
    "/v1/client-portal/settings": {
      "get": {
        "operationId": "ClientPortalSettingsController_getSettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get client portal settings (frontend contract)",
        "tags": [
          "Client Portal (Frontend Contract)"
        ]
      },
      "put": {
        "operationId": "ClientPortalSettingsController_updateSettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update client portal settings (frontend contract)",
        "tags": [
          "Client Portal (Frontend Contract)"
        ]
      }
    },
    "/v1/client-portal/{projectId}/approvals": {
      "get": {
        "operationId": "ClientPortalApprovalsController_listApprovals",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/approvals/{approvalId}": {
      "get": {
        "operationId": "ClientPortalApprovalsController_getApproval",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "approvalId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/approvals/{approvalId}/decision": {
      "post": {
        "operationId": "ClientPortalApprovalsController_submitDecision",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "approvalId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/booking/appointments": {
      "get": {
        "operationId": "ClientPortalBookingController_getAppointments",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "ClientPortalBookingController_bookAppointment",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/booking/appointments/{appointmentId}": {
      "delete": {
        "operationId": "ClientPortalBookingController_cancelAppointment",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "appointmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "ClientPortalBookingController_rescheduleAppointment",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "appointmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/booking/services": {
      "get": {
        "operationId": "ClientPortalBookingController_getServices",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/booking/slots": {
      "get": {
        "operationId": "ClientPortalBookingController_getSlots",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "staffId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/files/upload": {
      "post": {
        "operationId": "ClientPortalFilesController_uploadFile",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/invoices": {
      "get": {
        "operationId": "ClientPortalInvoicesController_listInvoices",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/invoices/{invoiceId}": {
      "get": {
        "operationId": "ClientPortalInvoicesController_getInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/invoices/{invoiceId}/payment-intent": {
      "post": {
        "operationId": "ClientPortalPaymentsController_createPaymentIntent",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/invoices/{invoiceId}/payments": {
      "post": {
        "operationId": "ClientPortalPaymentsController_recordPayment",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/milestones": {
      "get": {
        "operationId": "ClientPortalTimelineController_getMilestones",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/payments": {
      "get": {
        "operationId": "ClientPortalPaymentsController_listPayments",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/preferences/notifications": {
      "get": {
        "operationId": "ClientPortalPreferencesController_getNotificationPreferences",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "ClientPortalPreferencesController_updateNotificationPreferences",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/referral": {
      "get": {
        "operationId": "ClientPortalReferralController_getReferralInfo",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/referral/invite": {
      "post": {
        "operationId": "ClientPortalReferralController_sendReferralInvite",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/review": {
      "get": {
        "operationId": "ClientPortalReviewController_getReviewRequest",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "ClientPortalReviewController_submitInternalReview",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/service-history": {
      "get": {
        "operationId": "ClientPortalServiceHistoryController_getServiceHistory",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/signature-config": {
      "get": {
        "operationId": "ClientPortalSignatureConfigController_getSignatureConfig",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/tickets": {
      "get": {
        "operationId": "ClientPortalTicketsController_listTickets",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "ClientPortalTicketsController_createTicket",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/tickets/{ticketId}": {
      "get": {
        "operationId": "ClientPortalTicketsController_getTicket",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ticketId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/tickets/{ticketId}/close": {
      "post": {
        "operationId": "ClientPortalTicketsController_closeTicket",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ticketId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/tickets/{ticketId}/messages": {
      "post": {
        "operationId": "ClientPortalTicketsController_replyToTicket",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ticketId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/timeline": {
      "get": {
        "operationId": "ClientPortalTimelineController_getTimeline",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/tracking/active": {
      "get": {
        "operationId": "ClientPortalTrackingController_getActiveTracking",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/tracking/{appointmentId}/history": {
      "get": {
        "operationId": "ClientPortalTrackingController_getTrackingHistory",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "appointmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/tracking/{appointmentId}/message": {
      "post": {
        "operationId": "ClientPortalTrackingController_sendMessageToTechnician",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "appointmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/warranties": {
      "get": {
        "operationId": "ClientPortalWarrantiesController_getWarranties",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/client-portal/{projectId}/warranties/{warrantyId}/claims": {
      "post": {
        "operationId": "ClientPortalWarrantiesController_submitWarrantyClaim",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "warrantyId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/companies": {
      "get": {
        "description": "Returns a paginated list of companies for the organization. Supports text search and page-based pagination.",
        "operationId": "CompaniesController_findAll",
        "parameters": [
          {
            "description": "Case-insensitive search across company name and domain.",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          },
          {
            "description": "Maximum companies per page. Defaults to service-level pagination size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Page number (1-based). Defaults to 1.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Companies retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all companies",
        "tags": [
          "crm-companies"
        ]
      },
      "post": {
        "description": "Creates a company profile for the organization including key attributes such as industry, size, and primary contacts.",
        "operationId": "CompaniesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCompanyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Company created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new company",
        "tags": [
          "crm-companies"
        ]
      }
    },
    "/v1/companies/bulk-update": {
      "post": {
        "operationId": "CompaniesController_bulkUpdate",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateCompaniesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Bulk update completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Bulk update companies",
        "tags": [
          "crm-companies"
        ]
      }
    },
    "/v1/companies/merge": {
      "post": {
        "description": "Consolidates a secondary company into a primary company, moving linked contacts and deals. Only privileged roles may perform this action.",
        "operationId": "CompaniesController_merge",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeCompaniesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Companies merged successfully"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Merge companies",
        "tags": [
          "crm-companies"
        ]
      }
    },
    "/v1/companies/{id}": {
      "delete": {
        "description": "Permanently removes a company and its associations. Restricted to owner/admin roles due to data loss risk.",
        "operationId": "CompaniesController_remove",
        "parameters": [
          {
            "description": "Company identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company deleted successfully"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          },
          "404": {
            "description": "Company not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a company",
        "tags": [
          "crm-companies"
        ]
      },
      "get": {
        "description": "Retrieves a company record along with related contacts and metadata. Returns 404 if the company is not part of the organization.",
        "operationId": "CompaniesController_findOne",
        "parameters": [
          {
            "description": "Company identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company retrieved successfully"
          },
          "404": {
            "description": "Company not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a company by ID",
        "tags": [
          "crm-companies"
        ]
      },
      "patch": {
        "description": "Partially updates company details such as address, ownership, or associated tags.",
        "operationId": "CompaniesController_update",
        "parameters": [
          {
            "description": "Company identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCompanyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Company updated successfully"
          },
          "404": {
            "description": "Company not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a company",
        "tags": [
          "crm-companies"
        ]
      }
    },
    "/v1/compliance/audit-logs": {
      "get": {
        "operationId": "ComplianceController_getAuditLogs",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit logs retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get user activity audit trail",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/compliance/audit-trail": {
      "get": {
        "operationId": "ComplianceController_getAuditTrail",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit trail retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get compliance audit trail",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/compliance/data-deletion": {
      "post": {
        "operationId": "ComplianceController_initiateDataDeletion",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Data deletion request created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too many requests"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create data deletion request",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/compliance/data-export": {
      "post": {
        "operationId": "ComplianceController_initiateDataExport",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Data export request created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too many requests"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate GDPR/CCPA data export request",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/compliance/documents": {
      "get": {
        "operationId": "ComplianceController_getDocuments",
        "parameters": [
          {
            "in": "query",
            "name": "requirementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Documents retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get compliance documents",
        "tags": [
          "Compliance"
        ]
      },
      "post": {
        "operationId": "ComplianceController_uploadDocument",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UploadDocumentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Document uploaded successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload compliance document",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/compliance/requirements/{id}/status": {
      "patch": {
        "operationId": "ComplianceController_updateRequirementStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRequirementStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Status updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Requirement not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update compliance requirement status",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/compliance/requirements/{industry}": {
      "get": {
        "operationId": "ComplianceController_getRequirements",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Requirements retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get compliance requirements for industry",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/compliance/status": {
      "get": {
        "operationId": "ComplianceController_getComplianceStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Compliance status retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get compliance overview and status",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/compliance/status/{orgId}": {
      "get": {
        "operationId": "ComplianceController_getStatus",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get compliance status for organization",
        "tags": [
          "Compliance"
        ]
      }
    },
    "/v1/contacts": {
      "get": {
        "description": "Retrieves paginated contacts for the organization with optional filtering by lifecycle status and text search.",
        "operationId": "ContactsController_findAll",
        "parameters": [
          {
            "description": "Comma-separated tags to match.",
            "in": "query",
            "name": "tags",
            "required": false,
            "schema": {}
          },
          {
            "description": "JSON encoded advanced filter definition.",
            "in": "query",
            "name": "filter",
            "required": false,
            "schema": {}
          },
          {
            "description": "Apply saved filter by identifier.",
            "in": "query",
            "name": "filterId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Comma-separated lifecycle stage identifiers.",
            "in": "query",
            "name": "lifecycleStageIds",
            "required": false,
            "schema": {}
          },
          {
            "description": "Filter by owner identifier.",
            "in": "query",
            "name": "ownerId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Filter by contact status (e.g., ACTIVE, INACTIVE).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          },
          {
            "description": "Case-insensitive search across name, email, and company fields.",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          },
          {
            "description": "Set true to force cursor response shape even for the first page (cursorId omitted).",
            "in": "query",
            "name": "cursorMode",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Optional cursor-based pagination. When provided (or when cursorMode=true), returns { items, nextCursorId } instead of an array.",
            "in": "query",
            "name": "cursorId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Maximum contacts per page. Defaults to service pagination size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Page number (1-based). Defaults to 1.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contacts retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all contacts",
        "tags": [
          "crm-contacts"
        ]
      },
      "post": {
        "description": "Creates a contact profile for the organization, including demographic details, owner assignment, and linked companies.",
        "operationId": "ContactsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContactDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Contact created successfully"
          },
          "409": {
            "description": "Contact already exists"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new contact",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/bulk-update": {
      "post": {
        "operationId": "ContactsController_bulkUpdate",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateContactsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Bulk update completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Bulk update contacts",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/dedupe": {
      "post": {
        "description": "Merges duplicate contacts into a single primary record. Restricted to owner/admin due to destructive changes.",
        "operationId": "ContactsController_dedupe",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DedupeContactsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contacts deduplicated successfully"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Deduplicate contacts",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/enrichment/batch": {
      "post": {
        "description": "Returns enrichment payloads for up to 50 contacts. Missing contacts are returned in a separate list.",
        "operationId": "ContactsController_batchContactEnrichment",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchContactEnrichmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Batch contact enrichment retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Batch contact enrichment",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/export": {
      "post": {
        "operationId": "ContactsController_exportContacts",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "csv",
                "pdf"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Export generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export contacts (csv/pdf)",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/export-csv": {
      "get": {
        "description": "Generates a CSV export of all contacts for the current organization.",
        "operationId": "ContactsController_exportContactsCsv",
        "parameters": [],
        "responses": {
          "200": {
            "description": "CSV export generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export contacts to CSV",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/filters": {
      "get": {
        "operationId": "SavedFiltersController_list",
        "parameters": [
          {
            "description": "Filter entity type",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "default": "contacts",
              "enum": [
                "contacts",
                "companies",
                "deals"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List saved filters",
        "tags": [
          "crm-contact-filters"
        ]
      },
      "post": {
        "operationId": "SavedFiltersController_create",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSavedFilterDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Filter created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create saved filter",
        "tags": [
          "crm-contact-filters"
        ]
      }
    },
    "/v1/contacts/filters/{id}": {
      "delete": {
        "operationId": "SavedFiltersController_remove",
        "parameters": [
          {
            "description": "Saved filter identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Filter deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete saved filter",
        "tags": [
          "crm-contact-filters"
        ]
      },
      "patch": {
        "operationId": "SavedFiltersController_updatePatchAlias",
        "parameters": [
          {
            "description": "Saved filter identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSavedFilterDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update saved filter (alias)",
        "tags": [
          "crm-contact-filters"
        ]
      },
      "put": {
        "operationId": "SavedFiltersController_update",
        "parameters": [
          {
            "description": "Saved filter identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSavedFilterDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update saved filter",
        "tags": [
          "crm-contact-filters"
        ]
      }
    },
    "/v1/contacts/filters/{id}/run": {
      "post": {
        "operationId": "SavedFiltersController_run",
        "parameters": [
          {
            "description": "Saved filter identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 200,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "createdAt",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute saved filter and return matching records",
        "tags": [
          "crm-contact-filters"
        ]
      }
    },
    "/v1/contacts/import-csv/analyze": {
      "post": {
        "description": "Uploads a CSV file, analyzes headers and sample data, and returns suggested field mappings.",
        "operationId": "ContactsController_analyzeImportCsv",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "description": "CSV file containing contacts to import",
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "CSV analyzed successfully"
          },
          "400": {
            "description": "Invalid CSV file"
          },
          "413": {
            "description": "File too large"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Analyze CSV import file",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/import-csv/execute": {
      "post": {
        "description": "Processes a previously analyzed CSV file, validates all rows, and imports valid contacts in bulk.",
        "operationId": "ContactsController_executeImportCsv",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteContactsImportDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "CSV import executed successfully"
          },
          "400": {
            "description": "Invalid mapping or malformed CSV"
          },
          "404": {
            "description": "Filestack handle not found"
          },
          "422": {
            "description": "No valid data to import"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute CSV contact import",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/import-csv/execute-hybrid": {
      "post": {
        "description": "Hybrid mode: auto-merge high-confidence duplicates (exact email/phone match + consistent name), create new contacts for unmatched rows, and queue the rest for review.",
        "operationId": "ContactsController_executeHybridImportCsv",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteHybridContactsImportDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Hybrid CSV import executed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute hybrid CSV contact import",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/import-csv/preview": {
      "post": {
        "description": "Classifies CSV rows into: new contacts, auto-merge candidates (high confidence), review-needed matches (name mismatch / ambiguous), and invalid rows.",
        "operationId": "ContactsController_previewImportCsv",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewContactsImportDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "CSV import preview generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview hybrid CSV contact import",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/import-csv/review-tasks": {
      "get": {
        "operationId": "ContactsController_listImportReviewTasks",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List open CSV import review tasks",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/import-csv/review-tasks/{taskId}": {
      "get": {
        "operationId": "ContactsController_getImportReviewTask",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a CSV import review task with candidates",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/import-csv/review-tasks/{taskId}/resolve": {
      "post": {
        "operationId": "ContactsController_resolveImportReviewTask",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveImportReviewTaskDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Resolve a CSV import review task (merge/create/ignore)",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/lifecycle-stages": {
      "get": {
        "operationId": "LifecycleStagesController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List lifecycle stages for the organization",
        "tags": [
          "crm-lifecycle"
        ]
      }
    },
    "/v1/contacts/lifecycle-stages/apply-preset": {
      "post": {
        "operationId": "LifecycleStagesController_applyPreset",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyLifecyclePresetDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Apply a lifecycle preset to rename and reorder stages",
        "tags": [
          "crm-lifecycle"
        ]
      }
    },
    "/v1/contacts/lifecycle-stages/presets/list": {
      "get": {
        "operationId": "LifecycleStagesController_presets",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available lifecycle stage presets",
        "tags": [
          "crm-lifecycle"
        ]
      }
    },
    "/v1/contacts/lifecycle-stages/{id}": {
      "patch": {
        "operationId": "LifecycleStagesController_update",
        "parameters": [
          {
            "description": "Lifecycle stage identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLifecycleStageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update lifecycle stage properties (rename, probability, routing)",
        "tags": [
          "crm-lifecycle"
        ]
      }
    },
    "/v1/contacts/{id}": {
      "delete": {
        "description": "Permanently deletes a contact and associated analytics. Ensure no critical workflows depend on this record before deletion.",
        "operationId": "ContactsController_remove",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact deleted successfully"
          },
          "404": {
            "description": "Contact not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a contact",
        "tags": [
          "crm-contacts"
        ]
      },
      "patch": {
        "description": "Partially updates contact attributes including profile fields, ownership, lifecycle stage, or custom fields.",
        "operationId": "ContactsController_update",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateContactDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contact updated successfully"
          },
          "404": {
            "description": "Contact not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a contact",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}({0}.+)": {
      "get": {
        "description": "Retrieves a single contact with related timelines, companies, and metadata. Returns 404 if not found within the organization.",
        "operationId": "ContactsController_findOne",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact retrieved successfully"
          },
          "404": {
            "description": "Contact not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a contact by ID",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/behavioral-profile": {
      "patch": {
        "description": "Manually updates the behavioral profile for a contact, overriding AI-detected behaviors when necessary.",
        "operationId": "ContactsController_updateBehavioralProfile",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Behavioral profile updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update behavioral profile",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/contextual-profile": {
      "patch": {
        "description": "Updates contextual understanding (e.g., buyer journey stage, preferences) for a contact.",
        "operationId": "ContactsController_updateContextualProfile",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contextual profile updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update contextual profile",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/enrichment": {
      "get": {
        "description": "Returns aggregated enrichment signals (calls, tickets, surveys, invoices) plus a computed health score and risk flags.",
        "operationId": "ContactsController_getContactEnrichment",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "If true, bypass cache and recompute enrichment.",
            "in": "query",
            "name": "refresh",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact enrichment retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get contact enrichment",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/insights": {
      "get": {
        "description": "Returns AI-generated insights highlighting recommended actions, risks, and opportunities for the contact.",
        "operationId": "ContactsController_getContactInsights",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact insights retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get contact insights",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/insights/{insightId}": {
      "delete": {
        "description": "Dismisses an insight so it no longer appears in the contact dashboard.",
        "operationId": "ContactsController_dismissInsight",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Insight identifier",
            "in": "path",
            "name": "insightId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Insight dismissed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Dismiss an insight",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/insights/{insightId}/action": {
      "post": {
        "description": "Marks a specific insight as acted upon and records optional notes about the action.",
        "operationId": "ContactsController_markInsightAction",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Insight identifier",
            "in": "path",
            "name": "insightId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InsightActionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Insight action marked successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark insight action as taken",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/intelligence": {
      "get": {
        "description": "Retrieves aggregated intelligence for the contact including AI-enriched insights and recommended actions.",
        "operationId": "ContactsController_getContactIntelligence",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact intelligence retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get contact intelligence data",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/intelligence/refresh": {
      "post": {
        "description": "Recomputes contact intelligence insights, triggering downstream AI pipelines to refresh scores and recommendations.",
        "operationId": "ContactsController_refreshContactIntelligence",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact intelligence refreshed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Refresh contact intelligence",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/network": {
      "get": {
        "description": "Returns the extended network graph for the contact to help visualize multi-hop relationships.",
        "operationId": "ContactsController_getContactNetwork",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Depth of the network traversal (default defined by service).",
            "in": "query",
            "name": "depth",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact network retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get contact network",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/predictions": {
      "get": {
        "description": "Retrieves predictive metrics such as deal conversion likelihood and churn risk for the contact.",
        "operationId": "ContactsController_getContactPredictions",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictiveAnalyticsDto"
                }
              }
            },
            "description": "Predictive analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get predictive analytics",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/predictive-profile": {
      "patch": {
        "description": "Overrides predictive scoring outputs for the contact with manually curated values.",
        "operationId": "ContactsController_updatePredictiveProfile",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Predictive profile updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update predictive profile",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/relationship-profile": {
      "patch": {
        "description": "Updates relationship strength and connection mapping details for the contact.",
        "operationId": "ContactsController_updateRelationshipProfile",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Relationship profile updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update relationship profile",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/relationships": {
      "get": {
        "description": "Returns relationship graph information such as reporting structure or partner connections.",
        "operationId": "ContactsController_getContactRelationships",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact relationships retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get contact relationships",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/scores": {
      "get": {
        "description": "Returns behavioral scoring metrics (engagement, intent, health) for the contact.",
        "operationId": "ContactsController_getContactScores",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Behavioral scores retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get behavioral scores",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/scores/calculate": {
      "post": {
        "description": "Forces recalculation of behavioral scoring pipelines for the contact. Useful after large data imports or corrections.",
        "operationId": "ContactsController_calculateBehavioralScores",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Behavioral scores recalculated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Recalculate behavioral scores",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/contacts/{id}/timeline": {
      "get": {
        "description": "Returns chronological timeline events (emails, calls, activities) for the contact. Supports limiting event count.",
        "operationId": "ContactsController_getContactTimeline",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum timeline events to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact timeline retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get contact timeline",
        "tags": [
          "crm-contacts"
        ]
      },
      "post": {
        "description": "Adds a custom timeline event (note, meeting, call, etc.) to the contact history.",
        "operationId": "ContactsController_addTimelineEvent",
        "parameters": [
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTimelineEventDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Timeline event created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add timeline event",
        "tags": [
          "crm-contacts"
        ]
      }
    },
    "/v1/context/summary/{entityId}": {
      "get": {
        "description": "Returns entity snapshot, prioritized highlights, key stats, recent activity, pending actions, and a pre-built emmaPrompt for chat context.",
        "operationId": "ContextSummaryController_getContextSummary",
        "parameters": [
          {
            "description": "Contact, deal, or company ID",
            "in": "path",
            "name": "entityId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "enum": [
                "contact",
                "deal",
                "company"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Context summary retrieved successfully"
          },
          "400": {
            "description": "Invalid type query parameter"
          },
          "404": {
            "description": "Entity not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get concise context summary for an entity",
        "tags": [
          "context"
        ]
      }
    },
    "/v1/conversations/by-contact/{contactId}": {
      "get": {
        "description": "Read path for the handoff UI. Returns at most `limit` threads (default 20, max 100) with message counts but NOT full message bodies — fetch those via `GET /conversations/:id` when the user expands a thread.",
        "operationId": "ConversationsController_listByContact",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation list"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List recent conversations for a contact, newest first",
        "tags": [
          "conversations"
        ]
      }
    },
    "/v1/conversations/{id}": {
      "get": {
        "operationId": "ConversationsController_getConversation",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conversation payload with messages"
          },
          "404": {
            "description": "Conversation not found for this org"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch a single conversation with its full ordered message list",
        "tags": [
          "conversations"
        ]
      }
    },
    "/v1/crm/quality/duplicates": {
      "get": {
        "operationId": "CrmQualityController_duplicates",
        "parameters": [
          {
            "description": "Max duplicate groups per type",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Duplicate candidates returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Duplicate candidates grouped by email/phone",
        "tags": [
          "crm-quality"
        ]
      }
    },
    "/v1/crm/quality/stale": {
      "get": {
        "operationId": "CrmQualityController_stale",
        "parameters": [
          {
            "in": "query",
            "name": "staleLeadDays",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "staleDealDays",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stale lists returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Stale leads and stalled deals lists (for ops queues)",
        "tags": [
          "crm-quality"
        ]
      }
    },
    "/v1/crm/quality/summary": {
      "get": {
        "operationId": "CrmQualityController_summary",
        "parameters": [
          {
            "description": "Days since last update to consider a lead stale",
            "in": "query",
            "name": "staleLeadDays",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Days since last update to consider a deal stalled",
            "in": "query",
            "name": "staleDealDays",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quality summary returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "CRM data quality summary (missing fields, duplicates, staleness)",
        "tags": [
          "crm-quality"
        ]
      }
    },
    "/v1/crm/reports/export": {
      "post": {
        "operationId": "CrmReportsController_requestExport",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmReportExportRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmReportExportRequestResponseDto"
                }
              }
            },
            "description": "Export requested"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Request a CRM report export",
        "tags": [
          "crm-reports"
        ]
      }
    },
    "/v1/crm/reports/export/{exportId}": {
      "get": {
        "operationId": "CrmReportsController_getExport",
        "parameters": [
          {
            "description": "Export identifier",
            "in": "path",
            "name": "exportId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmReportExportStatusResponseDto"
                }
              }
            },
            "description": "Export status retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get CRM report export status",
        "tags": [
          "crm-reports"
        ]
      }
    },
    "/v1/crm/workflows": {
      "get": {
        "operationId": "CrmWorkflowsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List CRM workflows",
        "tags": [
          "crm-workflows"
        ]
      },
      "post": {
        "operationId": "CrmWorkflowsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create CRM workflow",
        "tags": [
          "crm-workflows"
        ]
      }
    },
    "/v1/crm/workflows/{id}": {
      "delete": {
        "operationId": "CrmWorkflowsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete CRM workflow",
        "tags": [
          "crm-workflows"
        ]
      },
      "get": {
        "operationId": "CrmWorkflowsController_get",
        "parameters": [
          {
            "description": "Workflow identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get CRM workflow",
        "tags": [
          "crm-workflows"
        ]
      },
      "patch": {
        "operationId": "CrmWorkflowsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update CRM workflow",
        "tags": [
          "crm-workflows"
        ]
      }
    },
    "/v1/custom-fields": {
      "get": {
        "operationId": "CustomFieldsController_getDefinitions",
        "parameters": [
          {
            "in": "query",
            "name": "entityType",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List custom field definitions",
        "tags": [
          "custom-fields"
        ]
      },
      "post": {
        "operationId": "CustomFieldsController_createDefinition",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomFieldDefinitionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create custom field definition",
        "tags": [
          "custom-fields"
        ]
      }
    },
    "/v1/custom-fields/defs": {
      "get": {
        "description": "Returns all custom field definitions for a given entity type within the organization.",
        "operationId": "CustomFieldsController_listDefs",
        "parameters": [
          {
            "description": "Entity type (e.g., contact, company, deal).",
            "in": "query",
            "name": "entity",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom field definitions retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List custom field definitions by entity",
        "tags": [
          "custom-fields"
        ]
      },
      "post": {
        "description": "Creates a custom field definition for an entity (contact, company, deal, etc.). Definitions describe metadata such as label, type, and options.",
        "operationId": "CustomFieldsController_createDef",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Definition created successfully"
          },
          "400": {
            "description": "Invalid field definition request"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create custom field definition",
        "tags": [
          "custom-fields"
        ]
      }
    },
    "/v1/custom-fields/defs/{id}": {
      "delete": {
        "description": "Removes a custom field definition. This action may also remove associated values depending on service implementation.",
        "operationId": "CustomFieldsController_removeDef",
        "parameters": [
          {
            "description": "Custom field definition identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Definition deleted successfully"
          },
          "404": {
            "description": "Definition not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete custom field definition",
        "tags": [
          "custom-fields"
        ]
      },
      "patch": {
        "description": "Modifies metadata for an existing custom field definition. Use to rename fields, adjust options, or toggle active state.",
        "operationId": "CustomFieldsController_updateDef",
        "parameters": [
          {
            "description": "Custom field definition identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Definition updated successfully"
          },
          "404": {
            "description": "Definition not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update custom field definition",
        "tags": [
          "custom-fields"
        ]
      }
    },
    "/v1/custom-fields/migrate": {
      "post": {
        "operationId": "CustomFieldsController_migrate",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Migration summary"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Migrate legacy custom fields into registry",
        "tags": [
          "custom-fields"
        ]
      }
    },
    "/v1/custom-fields/usage": {
      "get": {
        "operationId": "CustomFieldsController_getUsage",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get custom field usage statistics",
        "tags": [
          "custom-fields"
        ]
      }
    },
    "/v1/custom-fields/vals/{entity}/{entityId}": {
      "get": {
        "description": "Returns the key-value pairs for custom fields associated with a specific entity record.",
        "operationId": "CustomFieldsController_getVals",
        "parameters": [
          {
            "description": "Entity type (e.g., contact, company, deal).",
            "in": "path",
            "name": "entity",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Primary identifier for the entity record.",
            "in": "path",
            "name": "entityId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom field values retrieved successfully"
          },
          "404": {
            "description": "Entity or custom field values not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all custom field values for an entity record",
        "tags": [
          "custom-fields"
        ]
      },
      "post": {
        "description": "Creates or updates custom field values for the specified entity. Values are provided as a map of definition IDs to field data.",
        "operationId": "CustomFieldsController_upsertVals",
        "parameters": [
          {
            "description": "Entity type (e.g., contact, company, deal).",
            "in": "path",
            "name": "entity",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Primary identifier for the entity record.",
            "in": "path",
            "name": "entityId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom field values upserted successfully"
          },
          "400": {
            "description": "Invalid custom field payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upsert custom field values for an entity record",
        "tags": [
          "custom-fields"
        ]
      }
    },
    "/v1/custom-fields/values/{entityType}/{entityId}": {
      "get": {
        "operationId": "CustomFieldsController_getValues",
        "parameters": [
          {
            "in": "path",
            "name": "entityType",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "entityId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get custom field values for entity",
        "tags": [
          "custom-fields"
        ]
      },
      "put": {
        "operationId": "CustomFieldsController_upsertValues",
        "parameters": [
          {
            "in": "path",
            "name": "entityType",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "entityId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertCustomFieldValuesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upsert custom field values for entity",
        "tags": [
          "custom-fields"
        ]
      }
    },
    "/v1/custom-fields/{id}": {
      "delete": {
        "operationId": "CustomFieldsController_deleteDefinition",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete custom field definition",
        "tags": [
          "custom-fields"
        ]
      },
      "put": {
        "operationId": "CustomFieldsController_updateDefinition",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCustomFieldDefinitionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update custom field definition",
        "tags": [
          "custom-fields"
        ]
      }
    },
    "/v1/dashboard/summary": {
      "get": {
        "operationId": "DashboardSummaryController_getSummary",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Dashboard summary retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get dashboard summary counters",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/deals": {
      "get": {
        "description": "Retrieves paginated deals for the current organization. Supports filtering by ownership, pipeline, stage, company, contact, status, and text search.",
        "operationId": "DealsController_findAll",
        "parameters": [
          {
            "description": "Filter by related contact.",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Filter by related company.",
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Restrict results to a stage within the selected pipeline.",
            "in": "query",
            "name": "stageId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Restrict results to a pipeline.",
            "in": "query",
            "name": "pipelineId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Filter deals owned by the specified teammate.",
            "in": "query",
            "name": "ownerId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Filter by lifecycle status (e.g., OPEN, WON, LOST).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          },
          {
            "description": "Free-text search across deal titles and related entities.",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          },
          {
            "description": "Set true to force cursor response shape even for the first page (cursorId omitted).",
            "in": "query",
            "name": "cursorMode",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Optional cursor-based pagination. When provided (or when cursorMode=true), returns { items, nextCursorId } instead of an array.",
            "in": "query",
            "name": "cursorId",
            "required": false,
            "schema": {}
          },
          {
            "description": "Max items per page. Defaults to service-level default.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Page number (1-based). Defaults to 1.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deals retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all deals",
        "tags": [
          "crm-deals"
        ]
      },
      "post": {
        "description": "Creates a deal associated with the current organization. Deals can optionally reference contacts, companies, and pipelines.",
        "operationId": "DealsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDealDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Deal created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new deal",
        "tags": [
          "crm-deals"
        ]
      }
    },
    "/v1/deals/analytics": {
      "get": {
        "operationId": "DealsController_getAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "enum": [
                "week",
                "month",
                "year"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deal analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get deal analytics for a period",
        "tags": [
          "crm-deals"
        ]
      }
    },
    "/v1/deals/bulk-update": {
      "post": {
        "operationId": "DealsController_bulkUpdate",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateDealsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Bulk update completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Bulk update deals",
        "tags": [
          "crm-deals"
        ]
      }
    },
    "/v1/deals/{id}": {
      "delete": {
        "description": "Deletes a deal permanently. Consider archiving via status update instead if history must be preserved.",
        "operationId": "DealsController_remove",
        "parameters": [
          {
            "description": "Deal identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deal deleted successfully"
          },
          "404": {
            "description": "Deal not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a deal",
        "tags": [
          "crm-deals"
        ]
      },
      "get": {
        "description": "Returns a single deal with its relationships and stage data. The deal must belong to the current organization.",
        "operationId": "DealsController_findOne",
        "parameters": [
          {
            "description": "Deal identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deal retrieved successfully"
          },
          "404": {
            "description": "Deal not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a deal by ID",
        "tags": [
          "crm-deals"
        ]
      },
      "patch": {
        "description": "Updates deal fields such as title, value, owner, pipeline, or stage. Partial updates are supported.",
        "operationId": "DealsController_update",
        "parameters": [
          {
            "description": "Deal identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDealDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Deal updated successfully"
          },
          "404": {
            "description": "Deal not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a deal",
        "tags": [
          "crm-deals"
        ]
      },
      "put": {
        "description": "Updates deal fields such as title, value, owner, pipeline, or stage. Supports partial updates.",
        "operationId": "DealsController_updatePut",
        "parameters": [
          {
            "description": "Deal identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDealDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Deal updated successfully"
          },
          "404": {
            "description": "Deal not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a deal (PUT)",
        "tags": [
          "crm-deals"
        ]
      }
    },
    "/v1/deals/{id}/transfer": {
      "post": {
        "operationId": "DealsController_transfer",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferDealDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Deal transferred successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Transfer a deal to another location",
        "tags": [
          "crm-deals"
        ]
      }
    },
    "/v1/developer/auth/login": {
      "post": {
        "operationId": "DeveloperAuthController_login",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginDeveloperDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Authenticate developer API key and return JWT",
        "tags": [
          "developer"
        ]
      }
    },
    "/v1/developer/auth/register": {
      "post": {
        "operationId": "DeveloperAuthController_register",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterDeveloperDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Register a developer account and issue API key",
        "tags": [
          "developer"
        ]
      }
    },
    "/v1/developer/portal/auth/sso/exchange": {
      "post": {
        "operationId": "DeveloperAuthController_exchangeDeveloperPortalSso",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExchangeDeveloperPortalSsoDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Exchange a short-lived developer portal SSO handoff for an access token",
        "tags": [
          "developer"
        ]
      }
    },
    "/v1/developer/portal/auth/sso/start": {
      "post": {
        "operationId": "DeveloperAuthController_startDeveloperPortalSso",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartDeveloperPortalSsoDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a short-lived SSO handoff into the developer portal",
        "tags": [
          "developer"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/access": {
      "get": {
        "operationId": "DeveloperPortalController_listAccessMembers",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List developer portal access members",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/access/{userId}": {
      "put": {
        "operationId": "DeveloperPortalController_upsertAccessMember",
        "parameters": [
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDeveloperPortalAccessDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Grant or update developer portal access for a user",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/apps": {
      "get": {
        "operationId": "DeveloperPortalController_listApps",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List developer apps for an organization",
        "tags": [
          "developer-portal"
        ]
      },
      "post": {
        "operationId": "DeveloperPortalController_createApp",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeveloperAppDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a developer app",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/apps/{appId}": {
      "get": {
        "operationId": "DeveloperPortalController_getApp",
        "parameters": [
          {
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get one developer app",
        "tags": [
          "developer-portal"
        ]
      },
      "patch": {
        "operationId": "DeveloperPortalController_updateApp",
        "parameters": [
          {
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDeveloperAppDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a developer app",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/apps/{appId}/prompts": {
      "get": {
        "operationId": "DeveloperPortalController_listAppPrompts",
        "parameters": [
          {
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List saved prompts for a developer app",
        "tags": [
          "developer-portal"
        ]
      },
      "post": {
        "operationId": "DeveloperPortalController_createAppPrompt",
        "parameters": [
          {
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeveloperAppPromptDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a saved prompt for a developer app",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/apps/{appId}/prompts/{promptId}": {
      "patch": {
        "operationId": "DeveloperPortalController_updateAppPrompt",
        "parameters": [
          {
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "promptId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDeveloperAppPromptDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a saved prompt for a developer app",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/apps/{appId}/scopes": {
      "get": {
        "operationId": "DeveloperPortalController_listAppScopes",
        "parameters": [
          {
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List scope grants for a developer app",
        "tags": [
          "developer-portal"
        ]
      },
      "put": {
        "operationId": "DeveloperPortalController_replaceAppScopes",
        "parameters": [
          {
            "in": "path",
            "name": "appId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDeveloperAppScopesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replace scope grants for a developer app",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/audit-events": {
      "get": {
        "operationId": "DeveloperPortalController_listAuditEvents",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List developer portal audit events",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/credentials": {
      "get": {
        "operationId": "DeveloperPortalController_listCredentials",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List developer credentials for an organization",
        "tags": [
          "developer-portal"
        ]
      },
      "post": {
        "operationId": "DeveloperPortalController_createCredential",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeveloperCredentialDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a developer credential",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/credentials/{credentialId}": {
      "get": {
        "operationId": "DeveloperPortalController_getCredential",
        "parameters": [
          {
            "in": "path",
            "name": "credentialId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get one developer credential",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/credentials/{credentialId}/revoke": {
      "post": {
        "operationId": "DeveloperPortalController_revokeCredential",
        "parameters": [
          {
            "in": "path",
            "name": "credentialId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Revoke a developer credential",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/credentials/{credentialId}/rotate": {
      "post": {
        "operationId": "DeveloperPortalController_rotateCredential",
        "parameters": [
          {
            "in": "path",
            "name": "credentialId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Rotate a developer credential",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/gateway/errors": {
      "get": {
        "operationId": "DeveloperPortalController_getGatewayErrors",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get developer portal gateway error signals",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/gateway/summary": {
      "get": {
        "operationId": "DeveloperPortalController_getGatewaySummary",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get developer portal gateway summary",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/oauth/clients": {
      "get": {
        "operationId": "DeveloperPortalController_listOAuthClients",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List developer portal OAuth clients",
        "tags": [
          "developer-portal"
        ]
      },
      "post": {
        "operationId": "DeveloperPortalController_createOAuthClient",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeveloperOAuthClientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a developer portal OAuth client",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/oauth/clients/{clientId}": {
      "get": {
        "operationId": "DeveloperPortalController_getOAuthClient",
        "parameters": [
          {
            "in": "path",
            "name": "clientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get one developer portal OAuth client",
        "tags": [
          "developer-portal"
        ]
      },
      "patch": {
        "operationId": "DeveloperPortalController_updateOAuthClient",
        "parameters": [
          {
            "in": "path",
            "name": "clientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDeveloperOAuthClientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a developer portal OAuth client",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/oauth/clients/{clientId}/rotate-secret": {
      "post": {
        "operationId": "DeveloperPortalController_rotateOAuthClientSecret",
        "parameters": [
          {
            "in": "path",
            "name": "clientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Rotate a developer portal OAuth client secret",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/overview": {
      "get": {
        "operationId": "DeveloperPortalController_getOverview",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get developer portal dashboard overview",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/prompts": {
      "get": {
        "operationId": "DeveloperPortalController_listPrompts",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List saved developer app prompts for an organization",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/webhooks/deliveries": {
      "get": {
        "operationId": "DeveloperPortalController_listWebhookDeliveries",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List developer portal webhook deliveries",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/webhooks/deliveries/{deliveryId}/replay": {
      "post": {
        "operationId": "DeveloperPortalController_replayWebhookDelivery",
        "parameters": [
          {
            "in": "path",
            "name": "deliveryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replay a developer portal webhook delivery",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/webhooks/endpoints": {
      "get": {
        "operationId": "DeveloperPortalController_listWebhookEndpoints",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List developer portal webhook endpoints",
        "tags": [
          "developer-portal"
        ]
      },
      "post": {
        "operationId": "DeveloperPortalController_createWebhookEndpoint",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create developer portal webhook endpoint",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/webhooks/endpoints/{endpointId}": {
      "get": {
        "operationId": "DeveloperPortalController_getWebhookEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpointId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get one developer portal webhook endpoint",
        "tags": [
          "developer-portal"
        ]
      },
      "patch": {
        "operationId": "DeveloperPortalController_updateWebhookEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpointId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update developer portal webhook endpoint",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/portal/orgs/{orgId}/webhooks/endpoints/{endpointId}/test": {
      "post": {
        "operationId": "DeveloperPortalController_testWebhookEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpointId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a test event to a developer portal webhook endpoint",
        "tags": [
          "developer-portal"
        ]
      }
    },
    "/v1/developer/sandbox/execute": {
      "post": {
        "operationId": "DeveloperAuthController_executeSandbox",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeveloperSandboxExecuteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute a sandboxed API request as developer",
        "tags": [
          "developer"
        ]
      }
    },
    "/v1/dialer/analytics": {
      "get": {
        "operationId": "DialerController_getDialerAnalytics",
        "parameters": [
          {
            "description": "Time range for analytics (e.g., 30d, 7d). Ignored if startDate/endDate provided.",
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "default": "30d",
              "type": "string"
            }
          },
          {
            "description": "ISO start date (overrides timeRange when provided)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO end date (defaults to now when startDate provided)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Grouping granularity",
            "in": "query",
            "name": "groupBy",
            "required": false,
            "schema": {
              "enum": [
                "day",
                "week",
                "month"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by userId (optional)",
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by direction (inbound|outbound) (optional)",
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dialer analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get dialer call analytics",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/calls/{callId}": {
      "patch": {
        "description": "Apply notes, dispositions, tags, or voicemail drop references to a call.",
        "operationId": "DialerController_updateCallDetails",
        "parameters": [
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDialerCallDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update call metadata",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/calls/{callId}/recording": {
      "get": {
        "description": "Returns the recording URL and metadata for a specific call.",
        "operationId": "DialerController_getCallRecording",
        "parameters": [
          {
            "description": "Call ID",
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallRecordingResponseDto"
                }
              }
            },
            "description": "Recording retrieved"
          },
          "404": {
            "description": "Call or recording not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call recording",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/calls/{callId}/status": {
      "get": {
        "description": "Returns the current status and details of a specific call.",
        "operationId": "DialerController_getCallStatus",
        "parameters": [
          {
            "description": "Call ID",
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallStatusResponseDto"
                }
              }
            },
            "description": "Call status retrieved"
          },
          "404": {
            "description": "Call not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call status",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/calls/{callId}/transcript": {
      "get": {
        "description": "Returns the full transcript and AI analysis for a specific call.",
        "operationId": "DialerController_getCallTranscript",
        "parameters": [
          {
            "description": "Call ID",
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallTranscriptResponseDto"
                }
              }
            },
            "description": "Transcript retrieved"
          },
          "404": {
            "description": "Call or transcript not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call transcript",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/end-call": {
      "post": {
        "description": "Terminates an active call. User must own the call or be an admin.",
        "operationId": "DialerController_endCall",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndCallDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndCallResponseDto"
                }
              }
            },
            "description": "Call ended successfully"
          },
          "403": {
            "description": "Not authorized to end this call"
          },
          "404": {
            "description": "Call not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "End an active call",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/initiate-call": {
      "post": {
        "description": "Starts an outbound call to the specified phone number via Twilio. Rate limited to 10 calls per minute per user.",
        "operationId": "DialerController_initiateCall",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiateCallDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InitiateCallResponseDto"
                }
              }
            },
            "description": "Call initiated successfully"
          },
          "400": {
            "description": "Invalid phone number format"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate an outbound call",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/queues": {
      "get": {
        "operationId": "DialerController_listQueues",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List power-dialer queues (frontend contract)",
        "tags": [
          "dialer"
        ]
      },
      "post": {
        "operationId": "DialerController_createQueue",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create power-dialer queue (frontend contract)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/queues/{id}/pause": {
      "post": {
        "operationId": "DialerController_pauseQueue",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pause power-dialer session (frontend contract)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/queues/{id}/start": {
      "post": {
        "operationId": "DialerController_startQueue",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start power-dialer queue (frontend contract)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/queues/{id}/stop": {
      "post": {
        "operationId": "DialerController_stopQueue",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Stop power-dialer session (frontend contract)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/recent-calls": {
      "get": {
        "description": "Returns a paginated list of recent calls with optional filtering.",
        "operationId": "DialerController_getRecentCalls",
        "parameters": [
          {
            "description": "Number of records (default: 20, max: 100)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "description": "Pagination offset (default: 0)",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "type": "number"
            }
          },
          {
            "description": "Filter by user ID (admin only)",
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by contact ID",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by phone number",
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by status (completed, missed, failed)",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "completed",
                "missed",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by agent/user ID",
            "in": "query",
            "name": "agentId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by direction (inbound, outbound)",
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "enum": [
                "inbound",
                "outbound"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by start date (ISO 8601)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by end date (ISO 8601)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecentCallsResponseDto"
                }
              }
            },
            "description": "Recent calls retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get recent calls",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/session/{sessionId}": {
      "get": {
        "operationId": "DialerController_getSession",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get power-dialer session state (frontend contract)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/settings": {
      "get": {
        "operationId": "DialerSettingsController_getSettings",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DialerSettingsResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch organization + user dialer settings bundle",
        "tags": [
          "dialer-settings"
        ]
      },
      "patch": {
        "operationId": "DialerSettingsController_updateOrganizationSettings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDialerSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update organization-level dialer defaults",
        "tags": [
          "dialer-settings"
        ]
      },
      "put": {
        "operationId": "DialerSettingsController_putOrganizationSettings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDialerSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replace dialer settings (frontend alias)",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/connection-test": {
      "get": {
        "operationId": "DialerSettingsController_connectionTest",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Dialer API connection test (Twilio + configuration)",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/dispositions": {
      "get": {
        "operationId": "DialerSettingsController_listDispositionCodes",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispositionCodesResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List current dialer disposition codes",
        "tags": [
          "dialer-settings"
        ]
      },
      "post": {
        "operationId": "DialerSettingsController_createDispositionCode",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDispositionCodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispositionCodesResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a dialer disposition code",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/dispositions/{code}": {
      "delete": {
        "operationId": "DialerSettingsController_deleteDispositionCode",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispositionCodesResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a dialer disposition code",
        "tags": [
          "dialer-settings"
        ]
      },
      "patch": {
        "operationId": "DialerSettingsController_updateDispositionCode",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDispositionCodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DispositionCodesResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Rename a dialer disposition code",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/forwarding-rules": {
      "get": {
        "operationId": "DialerSettingsController_listForwardingRules",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List current call forwarding rules",
        "tags": [
          "dialer-settings"
        ]
      },
      "put": {
        "operationId": "DialerSettingsController_upsertForwardingRules",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertForwardingRulesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replace call forwarding rules (order sensitive)",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/me": {
      "get": {
        "operationId": "DialerSettingsController_getMySettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch current user dialer settings (frontend contract)",
        "tags": [
          "dialer-settings"
        ]
      },
      "patch": {
        "operationId": "DialerSettingsController_updateMySettings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDialerUserSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update current user dialer overrides",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/organization": {
      "patch": {
        "operationId": "DialerSettingsController_updateOrganizationSettingsAlias",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDialerSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update organization dialer settings (frontend contract alias)",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/ring-groups": {
      "get": {
        "operationId": "DialerSettingsController_listRingGroups",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List call routing ring groups",
        "tags": [
          "dialer-settings"
        ]
      },
      "post": {
        "operationId": "DialerSettingsController_createRingGroup",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDialerRingGroupDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a ring group (call center team)",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/ring-groups/{id}": {
      "delete": {
        "operationId": "DialerSettingsController_deleteRingGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete ring group",
        "tags": [
          "dialer-settings"
        ]
      },
      "patch": {
        "operationId": "DialerSettingsController_updateRingGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDialerRingGroupDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update ring group (optionally replace members)",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/test": {
      "get": {
        "operationId": "DialerSettingsController_connectionTestAlias",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Dialer API connection test (alias)",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/voicemail-drops": {
      "get": {
        "operationId": "DialerSettingsController_listVoicemailDrops",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List voicemail drops for the organization",
        "tags": [
          "dialer-settings"
        ]
      },
      "post": {
        "operationId": "DialerSettingsController_createVoicemailDrop",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVoicemailDropDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a voicemail drop asset",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/settings/voicemail-drops/{dropId}": {
      "delete": {
        "operationId": "DialerSettingsController_deleteVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "dropId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a voicemail drop",
        "tags": [
          "dialer-settings"
        ]
      },
      "patch": {
        "operationId": "DialerSettingsController_updateVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "dropId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVoicemailDropDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update voicemail drop metadata",
        "tags": [
          "dialer-settings"
        ]
      }
    },
    "/v1/dialer/voicemail-drops": {
      "get": {
        "operationId": "DialerController_listVoicemailDrops",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List voicemail drops (frontend contract)",
        "tags": [
          "dialer"
        ]
      },
      "post": {
        "operationId": "DialerController_createVoicemailDrop",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVoicemailDropDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create voicemail drop (frontend contract)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/voicemail-drops/{id}": {
      "delete": {
        "operationId": "DialerController_deleteVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete voicemail drop (frontend contract)",
        "tags": [
          "dialer"
        ]
      },
      "patch": {
        "operationId": "DialerController_updateVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVoicemailDropDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update voicemail drop (frontend contract)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/voicemail-drops/{id}/activate": {
      "post": {
        "operationId": "DialerController_activateVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish/activate voicemail drop (DRAFT -> ACTIVE)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/voicemail-drops/{id}/archive": {
      "post": {
        "operationId": "DialerController_archiveVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Archive voicemail drop (ACTIVE -> ARCHIVED)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/voicemail-drops/{id}/deactivate": {
      "post": {
        "operationId": "DialerController_deactivateVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Deactivate voicemail drop (contract alias)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/voicemail-drops/{id}/preview": {
      "get": {
        "operationId": "DialerController_previewVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview voicemail drop audio (returns URL)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/voicemail-drops/{id}/stream": {
      "get": {
        "operationId": "DialerController_streamVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Stream voicemail drop audio (redirect to URL)",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/voicemail-drops/{id}/transcribe": {
      "post": {
        "operationId": "DialerController_transcribeVoicemailDrop",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Auto-transcribe voicemail drop audio into transcript",
        "tags": [
          "dialer"
        ]
      }
    },
    "/v1/dialer/webhooks/twilio/call-status": {
      "post": {
        "description": "Receives call status updates from Twilio. Validates signature for security.",
        "operationId": "DialerWebhookController_handleCallStatus",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TwilioCallStatusWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          },
          "403": {
            "description": "Invalid Twilio signature"
          }
        },
        "summary": "Handle Twilio call status webhook",
        "tags": [
          "dialer-webhooks"
        ]
      }
    },
    "/v1/dialer/webhooks/twilio/recording-ready": {
      "post": {
        "description": "Receives notification when a call recording is ready. Triggers transcription.",
        "operationId": "DialerWebhookController_handleRecordingReady",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TwilioRecordingWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          },
          "403": {
            "description": "Invalid Twilio signature"
          }
        },
        "summary": "Handle Twilio recording ready webhook",
        "tags": [
          "dialer-webhooks"
        ]
      }
    },
    "/v1/domains/purchase": {
      "post": {
        "operationId": "DomainsController_purchaseDomain",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseDomainDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Domain purchased successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Purchase a domain",
        "tags": [
          "Domains"
        ]
      }
    },
    "/v1/domains/search": {
      "get": {
        "operationId": "DomainsController_searchDomains",
        "parameters": [
          {
            "description": "The domain name or keyword to search for",
            "in": "query",
            "name": "query",
            "required": true,
            "schema": {
              "example": "example.com",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of domains with pricing"
          }
        },
        "summary": "Search for available domains",
        "tags": [
          "Domains"
        ]
      }
    },
    "/v1/email": {
      "get": {
        "operationId": "EmailsController_getEmailThread__email",
        "parameters": [
          {
            "in": "query",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contact_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "company_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "deal_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email thread retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get email thread/history",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email-campaigns": {
      "get": {
        "operationId": "EmailCampaignsController_list",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List campaigns (with filters)",
        "tags": [
          "Email Campaigns"
        ]
      },
      "post": {
        "operationId": "EmailCampaignsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmailCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create campaign",
        "tags": [
          "Email Campaigns"
        ]
      }
    },
    "/v1/email-campaigns/{id}": {
      "delete": {
        "operationId": "EmailCampaignsController_delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete campaign",
        "tags": [
          "Email Campaigns"
        ]
      },
      "get": {
        "operationId": "EmailCampaignsController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get campaign details",
        "tags": [
          "Email Campaigns"
        ]
      },
      "patch": {
        "operationId": "EmailCampaignsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmailCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update campaign",
        "tags": [
          "Email Campaigns"
        ]
      }
    },
    "/v1/email-campaigns/{id}/analytics": {
      "get": {
        "operationId": "EmailCampaignsController_analytics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get open/click/bounce stats",
        "tags": [
          "Email Campaigns"
        ]
      }
    },
    "/v1/email-campaigns/{id}/cancel": {
      "post": {
        "operationId": "EmailCampaignsController_cancel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel scheduled campaign",
        "tags": [
          "Email Campaigns"
        ]
      }
    },
    "/v1/email-campaigns/{id}/compliance": {
      "get": {
        "description": "Runs the email compliance check (CAN-SPAM unsubscribe + postal address, spam-trigger words in subject, length / all-caps, vertical-specific FINRA / bar / before-after disclosure traps) without mutating campaign state. Returns a structured report. Errors block scheduling/send via the /send endpoint; warnings are advisory.",
        "operationId": "EmailCampaignsController_compliance",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pre-send compliance + quality lint",
        "tags": [
          "Email Campaigns"
        ]
      }
    },
    "/v1/email-campaigns/{id}/send": {
      "post": {
        "operationId": "EmailCampaignsController_send",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendEmailCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send/schedule campaign",
        "tags": [
          "Email Campaigns"
        ]
      }
    },
    "/v1/email-campaigns/{id}/test": {
      "post": {
        "operationId": "EmailCampaignsController_test",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestEmailCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send test email",
        "tags": [
          "Email Campaigns"
        ]
      }
    },
    "/v1/email-lists": {
      "get": {
        "operationId": "EmailListsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Lists retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List subscriber segments",
        "tags": [
          "Email Lists"
        ]
      },
      "post": {
        "operationId": "EmailListsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmailListDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "List created"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create segment from filters",
        "tags": [
          "Email Lists"
        ]
      }
    },
    "/v1/email-lists/{id}/preview": {
      "get": {
        "operationId": "EmailListsController_preview",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sampleSize",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preview retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview recipients (count + sample)",
        "tags": [
          "Email Lists"
        ]
      }
    },
    "/v1/email-templates": {
      "get": {
        "operationId": "EmailTemplatesApiController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List templates",
        "tags": [
          "Email Templates"
        ]
      },
      "post": {
        "operationId": "EmailTemplatesApiController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmailTemplateApiDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create template",
        "tags": [
          "Email Templates"
        ]
      }
    },
    "/v1/email-templates/{id}": {
      "delete": {
        "operationId": "EmailTemplatesApiController_delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete template",
        "tags": [
          "Email Templates"
        ]
      },
      "get": {
        "operationId": "EmailTemplatesApiController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get template with preview",
        "tags": [
          "Email Templates"
        ]
      },
      "patch": {
        "operationId": "EmailTemplatesApiController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmailTemplateApiDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update template",
        "tags": [
          "Email Templates"
        ]
      }
    },
    "/v1/email-templates/{id}/duplicate": {
      "post": {
        "operationId": "EmailTemplatesApiController_duplicate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Clone template",
        "tags": [
          "Email Templates"
        ]
      }
    },
    "/v1/email/analytics/overview": {
      "get": {
        "operationId": "EmailsController_getEmailAnalytics__email_analytics_overview",
        "parameters": [
          {
            "in": "query",
            "name": "date_range",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email analytics retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get email analytics overview",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/attachments": {
      "post": {
        "operationId": "EmailsController_uploadAttachmentAlias__email_attachments",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Attachment uploaded successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload an email attachment (spec alias)",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/bulk-send": {
      "post": {
        "operationId": "EmailsController_sendBulkEmails__email_bulk_send",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendBulkEmailDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Bulk emails queued successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send bulk emails",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/send": {
      "post": {
        "operationId": "EmailsController_sendEmail__email_send",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendEmailDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Email sent successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send individual email",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/templates": {
      "get": {
        "operationId": "EmailsController_getTemplates__email_templates",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Templates retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all email templates",
        "tags": [
          "Emails"
        ]
      },
      "post": {
        "operationId": "EmailsController_createTemplate__email_templates",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmailTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Template created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create email template",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/templates/industry/{industry}": {
      "get": {
        "operationId": "EmailsController_getIndustryTemplates__email_templates_industry_industry",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Industry templates retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific template suggestions",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/templates/{id}": {
      "delete": {
        "operationId": "EmailsController_deleteTemplate__email_templates_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template deleted successfully"
          },
          "400": {
            "description": "Cannot delete template in use"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete email template",
        "tags": [
          "Emails"
        ]
      },
      "get": {
        "operationId": "EmailsController_getTemplate__email_templates_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get single email template",
        "tags": [
          "Emails"
        ]
      },
      "put": {
        "operationId": "EmailsController_updateTemplate__email_templates_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmailTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Template updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update email template",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/templates/{id}/analytics": {
      "get": {
        "operationId": "EmailsController_getTemplateAnalytics__email_templates_id_analytics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template analytics retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get template analytics",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/upload-attachment": {
      "post": {
        "operationId": "EmailsController_uploadAttachment__email_upload_attachment",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "description": "Attachment file (max 1MB on free plan, 10MB on paid plan)",
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Attachment uploaded successfully"
          },
          "400": {
            "description": "Invalid attachment"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload an email attachment",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/email/{id}": {
      "get": {
        "operationId": "EmailsController_getEmail__email_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email details retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Email not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get single email details",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails": {
      "get": {
        "operationId": "EmailsController_getEmailThread__emails",
        "parameters": [
          {
            "in": "query",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contact_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "company_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "deal_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email thread retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get email thread/history",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/analytics/overview": {
      "get": {
        "operationId": "EmailsController_getEmailAnalytics__emails_analytics_overview",
        "parameters": [
          {
            "in": "query",
            "name": "date_range",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email analytics retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get email analytics overview",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/attachments": {
      "post": {
        "operationId": "EmailsController_uploadAttachmentAlias__emails_attachments",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Attachment uploaded successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload an email attachment (spec alias)",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/bulk-send": {
      "post": {
        "operationId": "EmailsController_sendBulkEmails__emails_bulk_send",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendBulkEmailDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Bulk emails queued successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send bulk emails",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/send": {
      "post": {
        "operationId": "EmailsController_sendEmail__emails_send",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendEmailDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Email sent successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send individual email",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/templates": {
      "get": {
        "operationId": "EmailsController_getTemplates__emails_templates",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Templates retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all email templates",
        "tags": [
          "Emails"
        ]
      },
      "post": {
        "operationId": "EmailsController_createTemplate__emails_templates",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEmailTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Template created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create email template",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/templates/industry/{industry}": {
      "get": {
        "operationId": "EmailsController_getIndustryTemplates__emails_templates_industry_industry",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Industry templates retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific template suggestions",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/templates/{id}": {
      "delete": {
        "operationId": "EmailsController_deleteTemplate__emails_templates_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template deleted successfully"
          },
          "400": {
            "description": "Cannot delete template in use"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete email template",
        "tags": [
          "Emails"
        ]
      },
      "get": {
        "operationId": "EmailsController_getTemplate__emails_templates_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get single email template",
        "tags": [
          "Emails"
        ]
      },
      "put": {
        "operationId": "EmailsController_updateTemplate__emails_templates_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEmailTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Template updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update email template",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/templates/{id}/analytics": {
      "get": {
        "operationId": "EmailsController_getTemplateAnalytics__emails_templates_id_analytics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template analytics retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get template analytics",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/upload-attachment": {
      "post": {
        "operationId": "EmailsController_uploadAttachment__emails_upload_attachment",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "description": "Attachment file (max 1MB on free plan, 10MB on paid plan)",
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Attachment uploaded successfully"
          },
          "400": {
            "description": "Invalid attachment"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload an email attachment",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/emails/webhooks/resend": {
      "post": {
        "operationId": "EmailsWebhookController_handleResendWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "resend-signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "resend-timestamp",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/emails/{id}": {
      "get": {
        "operationId": "EmailsController_getEmail__emails_id",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email details retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Email not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get single email details",
        "tags": [
          "Emails"
        ]
      }
    },
    "/v1/evals/personas": {
      "get": {
        "operationId": "EvalsController_listPersonas",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List eval personas",
        "tags": [
          "evals"
        ]
      },
      "post": {
        "operationId": "EvalsController_createPersona",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEvalPersonaDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an eval persona",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/personas/{id}": {
      "delete": {
        "operationId": "EvalsController_deletePersona",
        "parameters": [
          {
            "description": "Persona ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete eval persona",
        "tags": [
          "evals"
        ]
      },
      "get": {
        "operationId": "EvalsController_getPersona",
        "parameters": [
          {
            "description": "Persona ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get eval persona",
        "tags": [
          "evals"
        ]
      },
      "put": {
        "operationId": "EvalsController_updatePersona",
        "parameters": [
          {
            "description": "Persona ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEvalPersonaDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update eval persona",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/runs": {
      "get": {
        "operationId": "EvalsController_listRuns",
        "parameters": [
          {
            "in": "query",
            "name": "suiteId",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List eval runs",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/runs/{id}": {
      "get": {
        "operationId": "EvalsController_getRun",
        "parameters": [
          {
            "description": "Run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get eval run with per-scenario results",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/runs/{id}/compare/{otherId}": {
      "get": {
        "operationId": "EvalsController_compareRuns",
        "parameters": [
          {
            "description": "Baseline run ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Candidate run ID",
            "in": "path",
            "name": "otherId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Compare two eval runs side-by-side",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/scenarios": {
      "get": {
        "operationId": "EvalsController_listScenarios",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List eval scenarios",
        "tags": [
          "evals"
        ]
      },
      "post": {
        "operationId": "EvalsController_createScenario",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEvalScenarioDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an eval scenario",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/scenarios/{id}": {
      "delete": {
        "operationId": "EvalsController_deleteScenario",
        "parameters": [
          {
            "description": "Scenario ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete eval scenario",
        "tags": [
          "evals"
        ]
      },
      "get": {
        "operationId": "EvalsController_getScenario",
        "parameters": [
          {
            "description": "Scenario ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get eval scenario",
        "tags": [
          "evals"
        ]
      },
      "put": {
        "operationId": "EvalsController_updateScenario",
        "parameters": [
          {
            "description": "Scenario ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEvalScenarioDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update eval scenario",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/suites": {
      "get": {
        "operationId": "EvalsController_listSuites",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List eval suites",
        "tags": [
          "evals"
        ]
      },
      "post": {
        "operationId": "EvalsController_createSuite",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEvalSuiteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an eval suite",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/suites/{id}": {
      "delete": {
        "operationId": "EvalsController_deleteSuite",
        "parameters": [
          {
            "description": "Suite ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete eval suite",
        "tags": [
          "evals"
        ]
      },
      "get": {
        "operationId": "EvalsController_getSuite",
        "parameters": [
          {
            "description": "Suite ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get eval suite with scenarios",
        "tags": [
          "evals"
        ]
      },
      "put": {
        "operationId": "EvalsController_updateSuite",
        "parameters": [
          {
            "description": "Suite ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEvalSuiteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update eval suite",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/evals/suites/{suiteId}/run": {
      "post": {
        "operationId": "EvalsController_startRun",
        "parameters": [
          {
            "description": "Suite ID to run",
            "in": "path",
            "name": "suiteId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartEvalRunDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start an eval run against a voice agent",
        "tags": [
          "evals"
        ]
      }
    },
    "/v1/export/companies": {
      "get": {
        "operationId": "ExportController_exportCompanies",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "csv",
                "xlsx"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "example": "acme",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "example": "technology",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateRange",
            "required": false,
            "schema": {
              "example": "2024-01-01,2024-12-31",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Companies exported successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export companies to CSV",
        "tags": [
          "export"
        ]
      }
    },
    "/v1/export/contacts": {
      "get": {
        "operationId": "ExportController_exportContacts",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "csv",
                "xlsx"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "example": "john",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "ACTIVE",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "example": "company_123",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateRange",
            "required": false,
            "schema": {
              "example": "2024-01-01,2024-12-31",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contacts exported successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export contacts to CSV",
        "tags": [
          "export"
        ]
      }
    },
    "/v1/export/deals": {
      "get": {
        "operationId": "ExportController_exportDeals",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "csv",
                "xlsx"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "example": "enterprise",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "stage",
            "required": false,
            "schema": {
              "example": "PROPOSAL",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "minValue",
            "required": false,
            "schema": {
              "example": "1000",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "maxValue",
            "required": false,
            "schema": {
              "example": "10000",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateRange",
            "required": false,
            "schema": {
              "example": "2024-01-01,2024-12-31",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deals exported successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export deals to CSV",
        "tags": [
          "export"
        ]
      }
    },
    "/v1/feature-flags": {
      "get": {
        "operationId": "FeatureFlagsController_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FeatureFlagDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Feature flags retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all feature flags",
        "tags": [
          "Feature Flags"
        ]
      },
      "post": {
        "operationId": "FeatureFlagsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFeatureFlagDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlagDto"
                }
              }
            },
            "description": "Feature flag created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a feature flag",
        "tags": [
          "Feature Flags"
        ]
      }
    },
    "/v1/feature-flags/check/{key}": {
      "get": {
        "operationId": "FeatureFlagsController_isEnabled",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feature flag status checked successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check if a feature flag is enabled",
        "tags": [
          "Feature Flags"
        ]
      }
    },
    "/v1/feature-flags/config/{key}": {
      "get": {
        "operationId": "FeatureFlagsController_getConfig",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feature flag configuration retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get feature flag configuration",
        "tags": [
          "Feature Flags"
        ]
      }
    },
    "/v1/feature-flags/key/{key}": {
      "get": {
        "operationId": "FeatureFlagsController_findByKey",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlagDto"
                }
              }
            },
            "description": "Feature flag retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Feature flag not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a feature flag by key",
        "tags": [
          "Feature Flags"
        ]
      }
    },
    "/v1/feature-flags/{id}": {
      "delete": {
        "operationId": "FeatureFlagsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feature flag deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Feature flag not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a feature flag",
        "tags": [
          "Feature Flags"
        ]
      },
      "get": {
        "operationId": "FeatureFlagsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlagDto"
                }
              }
            },
            "description": "Feature flag retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Feature flag not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a feature flag by ID",
        "tags": [
          "Feature Flags"
        ]
      },
      "patch": {
        "operationId": "FeatureFlagsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFeatureFlagDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureFlagDto"
                }
              }
            },
            "description": "Feature flag updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Feature flag not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a feature flag",
        "tags": [
          "Feature Flags"
        ]
      }
    },
    "/v1/google-business-callback": {
      "get": {
        "operationId": "GoogleBusinessCompatOAuthController_callback",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns HTML that posts a message to opener"
          }
        },
        "summary": "Google Business Profile OAuth callback (compat)",
        "tags": [
          "Google Business OAuth (compat)"
        ]
      }
    },
    "/v1/google-business-oauth": {
      "get": {
        "operationId": "GoogleBusinessCompatOAuthController_initiateGet",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate Google Business Profile OAuth URL (GET alias)",
        "tags": [
          "Google Business OAuth (compat)"
        ]
      },
      "post": {
        "operationId": "GoogleBusinessCompatOAuthController_initiate",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate Google Business Profile OAuth URL (compat)",
        "tags": [
          "Google Business OAuth (compat)"
        ]
      }
    },
    "/v1/inbox/messages": {
      "get": {
        "operationId": "InboxController_getMessages",
        "parameters": [
          {
            "description": "Limit",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "description": "Thread ID",
            "in": "query",
            "name": "threadId",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Messages retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get messages",
        "tags": [
          "inbox"
        ]
      },
      "post": {
        "operationId": "InboxController_sendMessage",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Message sent successfully"
          },
          "400": {
            "description": "Bad request"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a message",
        "tags": [
          "inbox"
        ]
      }
    },
    "/v1/inbox/telegram/connect-link": {
      "post": {
        "operationId": "InboxController_createTelegramConnectLink",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Telegram connect link created"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Telegram connect link for current user",
        "tags": [
          "inbox"
        ]
      }
    },
    "/v1/inbox/telegram/connections": {
      "get": {
        "operationId": "InboxController_getTelegramConnections",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Telegram connections retrieved"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Telegram chats connected by current user",
        "tags": [
          "inbox"
        ]
      }
    },
    "/v1/inbox/telegram/connections/{chatId}": {
      "delete": {
        "operationId": "InboxController_deleteTelegramConnection",
        "parameters": [
          {
            "in": "path",
            "name": "chatId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Telegram connection removed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Disconnect a Telegram chat from current user",
        "tags": [
          "inbox"
        ]
      }
    },
    "/v1/inbox/threads": {
      "get": {
        "operationId": "InboxController_getThreads",
        "parameters": [
          {
            "in": "query",
            "name": "unreadOnly",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Thread status",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          },
          {
            "description": "Thread type",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {}
          },
          {
            "description": "Search term",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          },
          {
            "description": "Items per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Message threads retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all message threads",
        "tags": [
          "inbox"
        ]
      },
      "post": {
        "operationId": "InboxController_createThread",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Message thread created successfully"
          },
          "400": {
            "description": "Bad request"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new message thread",
        "tags": [
          "inbox"
        ]
      }
    },
    "/v1/inbox/threads/{id}": {
      "get": {
        "operationId": "InboxController_getThread",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message thread retrieved successfully"
          },
          "404": {
            "description": "Message thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a message thread by ID",
        "tags": [
          "inbox"
        ]
      }
    },
    "/v1/industries/packs": {
      "get": {
        "description": "Returns pack manifests. Pack *contents* (prompts, tool lists, workflow template keys) are served here verbatim so the UI can render the catalog without a second round-trip.",
        "operationId": "IndustryPackController_listCatalog",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Pack catalog"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List the catalog of platform-shipped industry packs",
        "tags": [
          "industry-packs"
        ]
      }
    },
    "/v1/industries/packs/installed": {
      "get": {
        "description": "Returns active + paused installs. Each entry includes the pinned `installedVersion` and whether a newer pack version is available.",
        "operationId": "IndustryPackController_listInstalled",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Installed packs"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List packs installed on the caller organization",
        "tags": [
          "industry-packs"
        ]
      }
    },
    "/v1/industries/packs/{key}": {
      "get": {
        "operationId": "IndustryPackController_getPack",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pack manifest"
          },
          "404": {
            "description": "Pack not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch a single pack manifest from the catalog",
        "tags": [
          "industry-packs"
        ]
      }
    },
    "/v1/industries/packs/{key}/install": {
      "delete": {
        "description": "Sets the install row to `uninstalled`. The row is preserved so ops can still audit historical installs; call install again to reactivate.",
        "operationId": "IndustryPackController_uninstallPack",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pack uninstalled"
          },
          "404": {
            "description": "Pack not installed on this org"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Uninstall a pack on the caller organization",
        "tags": [
          "industry-packs"
        ]
      },
      "post": {
        "description": "Idempotent. Reinstalling overwrites the prior install row with the current manifest version and merges new overrides.",
        "operationId": "IndustryPackController_installPack",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pack installed"
          },
          "404": {
            "description": "Unknown or disabled pack"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Install (or reinstall) a pack on the caller organization",
        "tags": [
          "industry-packs"
        ]
      }
    },
    "/v1/industries/packs/{key}/resolved": {
      "get": {
        "description": "Returns the manifest merged with any per-tenant overrides stored on the install row. Runtime consumers call this when they need the effective pack for an org rather than the raw catalog entry.",
        "operationId": "IndustryPackController_resolvePack",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved pack"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Resolve a pack with the caller org's overrides applied",
        "tags": [
          "industry-packs"
        ]
      }
    },
    "/v1/install/admin/cleanup-stats": {
      "get": {
        "description": "Returns statistics about demo workspace cleanup.",
        "operationId": "InstallController_getCleanupStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get demo cleanup statistics",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/assets/agents-md": {
      "get": {
        "description": "Returns a maintained AGENTS.md block (concise) that AI coding agents can drop into a project root. Compatible with the `<!-- BEGIN:serviceagent-rules -->` markers the CLI uses for merge-safe updates.",
        "operationId": "InstallAssetsController_agentsMd",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Canonical AGENTS.md snippet for ServiceAgent integrations",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/assets/claude-desktop-config": {
      "get": {
        "description": "Returns a JSON snippet (`mcpServers.serviceagent`) ready to paste into `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or the Windows equivalent. Used by the \"Add to Claude Desktop\" buttons on the docs site.",
        "operationId": "InstallAssetsController_claudeDesktopConfig",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Pre-baked Claude Desktop MCP config block",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/assets/continue-mcp-config": {
      "get": {
        "operationId": "InstallAssetsController_continueMcpConfig",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Pre-baked Continue.dev MCP config block",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/assets/cursor-mcp-config": {
      "get": {
        "description": "Returns a JSON snippet (`mcpServers.serviceagent`) ready to paste into `.cursor/mcp.json`. Used as the second pillar of the \"Add to Cursor\" UX (the cursor:// deep link is the first).",
        "operationId": "InstallAssetsController_cursorMcpConfig",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Pre-baked Cursor MCP config block",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/assets/cursor-rules": {
      "get": {
        "description": "Returns the canonical Cursor rules file as `text/markdown`. Used by `npx @serviceagent/cli add rules` and similar integrations to drop a maintained rule file into customer projects.",
        "operationId": "InstallAssetsController_cursorRules",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Canonical .cursor/rules/serviceagent.mdc",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/assets/windsurf-mcp-config": {
      "get": {
        "operationId": "InstallAssetsController_windsurfMcpConfig",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Pre-baked Windsurf MCP config block",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/claim": {
      "get": {
        "operationId": "InstallAssetsController_claimPage",
        "parameters": [
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "install"
        ]
      },
      "post": {
        "description": "Claims the demo workspace by creating an owner account with email/password.",
        "operationId": "InstallController_claim",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallClaimDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workspace claimed"
          }
        },
        "summary": "Claim demo workspace (email + password)",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/exchange": {
      "post": {
        "description": "Exchanges an install token for a long-lived API key. Only works for claimed workspaces.",
        "operationId": "InstallController_exchange",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallExchangeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "API key returned"
          }
        },
        "summary": "Exchange install token for API key (server-only)",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/iframe": {
      "get": {
        "operationId": "InstallAssetsController_iframe",
        "parameters": [
          {
            "in": "query",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/magic-link/send": {
      "post": {
        "description": "Sends a magic link email to claim the demo workspace without password.",
        "operationId": "InstallController_sendMagicLink",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMagicLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Magic link sent"
          }
        },
        "summary": "Send magic link to claim workspace (passwordless)",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/magic-link/verify": {
      "get": {
        "description": "GET endpoint for magic link verification from email clicks.",
        "operationId": "InstallController_verifyMagicLinkGet",
        "parameters": [
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Claim completed"
          }
        },
        "summary": "Verify magic link (GET for email links)",
        "tags": [
          "install"
        ]
      },
      "post": {
        "description": "Verifies the magic link token and claims the workspace.",
        "operationId": "InstallController_verifyMagicLink",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyMagicLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Claim completed"
          }
        },
        "summary": "Verify magic link and complete claim",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/preview": {
      "get": {
        "operationId": "InstallAssetsController_preview",
        "parameters": [
          {
            "in": "query",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/provision": {
      "post": {
        "description": "Creates a new widget/agent in an existing (claimed) workspace. Requires authentication.",
        "operationId": "InstallController_provision",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallProvisionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Widget provisioned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Provision new widget into existing workspace",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/sessions": {
      "get": {
        "description": "Returns org-scoped install sessions without token hashes. Supports optional `page` and `limit` query params.",
        "operationId": "InstallController_listSessions",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List install sessions for the current organization",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/start": {
      "post": {
        "description": "Creates a demo workspace with a chat widget and returns embed snippets. No account required.",
        "operationId": "InstallController_start",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallStartDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Install started"
          }
        },
        "summary": "Start instant install: create demo workspace + chat widget",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/status": {
      "get": {
        "description": "Polls the install session to see whether the demo workspace has been claimed yet. Used by CLIs / MCP servers to drive an in-IDE claim flow without consuming the install token via /install/exchange.",
        "operationId": "InstallController_status",
        "parameters": [
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`{ claimed, claimedAt, expiresAt, organizationId, widgetKey, isDemo }` — `claimed: true` means /install/exchange is now safe to call."
          }
        },
        "summary": "Check install session status by token",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/telemetry/funnel": {
      "get": {
        "description": "Returns funnel metrics and conversion rates for the install flow.",
        "operationId": "InstallController_getFunnelMetrics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "platform",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get install funnel metrics",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/telemetry/funnel-by-platform": {
      "get": {
        "description": "Returns one row per AI-builder platform (cursor, lovable, bolt, …) plus an aggregate `totals` row. Use this for the \"which platform actually converts?\" dashboard panel — the single-platform endpoint above is still cheaper for spot-checks. Pass a comma-separated `platforms=cursor,lovable` to override the default list.",
        "operationId": "InstallController_getFunnelByPlatform",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "platforms",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get install funnel metrics broken down by platform",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/install/telemetry/mcp": {
      "post": {
        "description": "Fire-and-forget telemetry from `@serviceagent/mcp`. Lets us measure tool usage across Cursor / Claude Desktop / Windsurf / Cloud MCP clients without coupling to user identity (some events fire before a workspace is claimed).",
        "operationId": "InstallController_recordMcpTelemetry",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpTelemetryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Event accepted"
          }
        },
        "summary": "Record an MCP tool invocation event",
        "tags": [
          "install"
        ]
      }
    },
    "/v1/instant-sites": {
      "get": {
        "operationId": "InstantSitesController_list",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "DRAFT",
                "REVIEW",
                "READY",
                "PUBLISHING",
                "LIVE",
                "ARCHIVED"
              ],
              "type": "string"
            }
          },
          {
            "description": "Search by name or slug.",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number (1-indexed)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "description": "Page size",
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "description": "Alias for pageSize",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List instant sites",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/analytics/events": {
      "post": {
        "operationId": "InstantSitesController_recordAnalyticsEvents",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsEventsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Track instant sites analytics events",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/generate": {
      "post": {
        "operationId": "InstantSitesController_generate",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateInstantSiteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate a new instant site using AI plan",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}": {
      "delete": {
        "operationId": "InstantSitesController_deleteSite",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an instant site",
        "tags": [
          "Instant Sites"
        ]
      },
      "get": {
        "operationId": "InstantSitesController_getSite",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get instant site details",
        "tags": [
          "Instant Sites"
        ]
      },
      "patch": {
        "operationId": "InstantSitesController_updateSite",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSiteMetadataDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update site metadata/theme",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/blocks": {
      "post": {
        "operationId": "InstantSitesController_createBlock",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSiteBlockDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new block on a page",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/blocks/reorder": {
      "post": {
        "operationId": "InstantSitesController_reorderBlocks",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderBlocksDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder/move blocks across pages",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/blocks/{blockId}": {
      "delete": {
        "operationId": "InstantSitesController_deleteBlock",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "blockId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a block",
        "tags": [
          "Instant Sites"
        ]
      },
      "patch": {
        "operationId": "InstantSitesController_updateBlock",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "blockId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSiteBlockDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a block content/metadata",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/blocks/{blockId}/regenerate": {
      "post": {
        "operationId": "InstantSitesController_regenerateBlock",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "blockId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegenerateBlockDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "AI regenerate a block",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/pages": {
      "post": {
        "operationId": "InstantSitesController_createPage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSitePageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new page",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/pages/{pageId}": {
      "delete": {
        "operationId": "InstantSitesController_deletePage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a page",
        "tags": [
          "Instant Sites"
        ]
      },
      "patch": {
        "operationId": "InstantSitesController_updatePage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "pageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSitePageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update site page metadata",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/publish": {
      "post": {
        "operationId": "InstantSitesController_publish",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishSiteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish an instant site (or generate preview)",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/publish-jobs": {
      "get": {
        "operationId": "InstantSitesController_listPublishJobs",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Limit number of jobs",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "type": "number"
            }
          },
          {
            "description": "Filter by status",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "QUEUED",
                "RUNNING",
                "FAILED",
                "COMPLETED",
                "CANCELLED"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by publish type",
            "in": "query",
            "name": "publishType",
            "required": false,
            "schema": {
              "enum": [
                "PREVIEW",
                "LIVE"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List recent publish jobs",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/publish-jobs/{jobId}/cancel": {
      "post": {
        "operationId": "InstantSitesController_cancelPublishJob",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a publish job",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/publish-jobs/{jobId}/status": {
      "get": {
        "operationId": "InstantSitesController_getPublishJobStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "since",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get publish job status (polling)",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/publish-jobs/{jobId}/stream": {
      "get": {
        "operationId": "InstantSitesController_streamPublishJob",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Stream publish job updates via SSE",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/instant-sites/{id}/publish/events": {
      "get": {
        "operationId": "InstantSitesController_streamPublishEvents",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Frontend contract alias for publish SSE (uses latest job when jobId is omitted)",
        "tags": [
          "Instant Sites"
        ]
      }
    },
    "/v1/integration-requests": {
      "post": {
        "operationId": "IntegrationRequestsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIntegrationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Integration request submitted successfully"
          },
          "400": {
            "description": "Validation error"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Submit a public integration request",
        "tags": [
          "integration-requests"
        ]
      }
    },
    "/v1/integrations": {
      "get": {
        "operationId": "IntegrationController_getIntegrations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Integrations retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all integrations for organization",
        "tags": [
          "integrations"
        ]
      },
      "post": {
        "operationId": "IntegrationController_createIntegration",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Integration created successfully"
          },
          "400": {
            "description": "Invalid integration data"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new CRM integration",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/asana/projects": {
      "get": {
        "operationId": "IntegrationController_getAsanaProjects",
        "parameters": [
          {
            "in": "query",
            "name": "workspaceGid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asana projects retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Asana projects",
        "tags": [
          "integrations"
        ]
      },
      "post": {
        "operationId": "IntegrationController_createAsanaProject",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Asana project created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Asana project",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/asana/projects/{projectId}/tasks": {
      "get": {
        "operationId": "IntegrationController_getAsanaProjectTasks",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asana tasks retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Asana project tasks",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/asana/tasks": {
      "post": {
        "operationId": "IntegrationController_createAsanaTask",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Asana task created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Asana task",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/asana/tasks/{taskId}": {
      "patch": {
        "operationId": "IntegrationController_updateAsanaTask",
        "parameters": [
          {
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asana task updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update Asana task",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/asana/workspaces": {
      "get": {
        "operationId": "IntegrationController_getAsanaWorkspaces",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Asana workspaces retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Asana workspaces",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/available": {
      "get": {
        "operationId": "IntegrationController_getAvailableIntegrations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Available integrations retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available integrations with metadata",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/available-crms": {
      "get": {
        "operationId": "IntegrationController_getAvailableCRMs",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Available CRMs retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get list of available CRM types",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/calendar/available": {
      "get": {
        "operationId": "IntegrationController_getCalendarIntegrations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Calendar integrations retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available calendar integrations",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/calendly/event-types": {
      "get": {
        "operationId": "IntegrationController_getCalendlyEventTypes",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Calendly event types retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Calendly event types",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/calendly/scheduled-events": {
      "get": {
        "operationId": "IntegrationController_getCalendlyScheduledEvents",
        "parameters": [
          {
            "in": "query",
            "name": "count",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "minStartTime",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "maxStartTime",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calendly scheduled events retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Calendly scheduled events",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/calendly/scheduled-events/{eventId}/invitees": {
      "get": {
        "operationId": "IntegrationController_getCalendlyInvitees",
        "parameters": [
          {
            "in": "path",
            "name": "eventId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calendly invitees retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Calendly invitees for an event",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/catalog": {
      "get": {
        "description": "Alias of /integrations/available for the frontend catalog. Includes tier, connectMethod, connectPath, capabilities, and category.",
        "operationId": "IntegrationController_getIntegrationsCatalog",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Integration catalog retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List integration catalog with tier + connection metadata",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/connect": {
      "post": {
        "operationId": "IntegrationController_connectIntegration",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Integration connection initiated"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Connect a new integration (OAuth or API-key)",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/health": {
      "get": {
        "operationId": "IntegrationController_getIntegrationHealth",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Health status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all integrations health status",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/health/summary": {
      "get": {
        "operationId": "IntegrationController_getHealthStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Health status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get health status of all integrations",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/sync-all": {
      "post": {
        "operationId": "IntegrationController_syncAllIntegrations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "All integrations synced successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync all active integrations",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/webhooks/asana": {
      "post": {
        "operationId": "IntegrationWebhooksController_handleAsanaWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle webhook from Asana",
        "tags": [
          "integrations-webhooks"
        ]
      }
    },
    "/v1/integrations/webhooks/calendly": {
      "post": {
        "operationId": "IntegrationWebhooksController_handleCalendlyWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle webhook from Calendly",
        "tags": [
          "integrations-webhooks"
        ]
      }
    },
    "/v1/integrations/webhooks/clio": {
      "post": {
        "operationId": "IntegrationWebhooksController_handleClioWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle webhook from Clio",
        "tags": [
          "integrations-webhooks"
        ]
      }
    },
    "/v1/integrations/webhooks/dead-letter/retry": {
      "post": {
        "operationId": "IntegrationController_retryWebhookDeadLetters",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook retry job started successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry failed integration webhook events",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/webhooks/dead-letter/summary": {
      "get": {
        "operationId": "IntegrationController_getWebhookDeadLetterSummary",
        "parameters": [
          {
            "in": "query",
            "name": "maxRetryThreshold",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "crmType",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook dead-letter summary retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get webhook retry/dead-letter backlog summary",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/webhooks/hubspot": {
      "post": {
        "operationId": "IntegrationWebhooksController_handleHubSpotWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle webhook from HubSpot",
        "tags": [
          "integrations-webhooks"
        ]
      }
    },
    "/v1/integrations/webhooks/jobber": {
      "post": {
        "operationId": "IntegrationWebhooksController_handleJobberWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle webhook from Jobber",
        "tags": [
          "integrations-webhooks"
        ]
      }
    },
    "/v1/integrations/webhooks/salesforce": {
      "post": {
        "operationId": "IntegrationWebhooksController_handleSalesforceWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle webhook from Salesforce",
        "tags": [
          "integrations-webhooks"
        ]
      }
    },
    "/v1/integrations/webhooks/servicetitan": {
      "post": {
        "operationId": "IntegrationWebhooksController_handleServiceTitanWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle webhook from ServiceTitan",
        "tags": [
          "integrations-webhooks"
        ]
      }
    },
    "/v1/integrations/webhooks/{crmType}": {
      "post": {
        "operationId": "IntegrationWebhooksController_handleGenericWebhook",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle webhook from any CRM",
        "tags": [
          "integrations-webhooks"
        ]
      }
    },
    "/v1/integrations/{crmType}({0}.+)": {
      "delete": {
        "operationId": "IntegrationController_deleteIntegration",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Integration deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete integration",
        "tags": [
          "integrations"
        ]
      },
      "get": {
        "operationId": "IntegrationController_getIntegration",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Integration retrieved successfully"
          },
          "404": {
            "description": "Integration not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get specific integration",
        "tags": [
          "integrations"
        ]
      },
      "patch": {
        "operationId": "IntegrationController_updateIntegration",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Integration updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update integration settings",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/appointments": {
      "get": {
        "operationId": "IntegrationController_getCRMAppointments",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "startBefore",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "startAfter",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Appointments retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get CRM appointments",
        "tags": [
          "integrations"
        ]
      },
      "post": {
        "operationId": "IntegrationController_createCRMAppointment",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Appointment created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create CRM appointment",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/contacts": {
      "get": {
        "operationId": "IntegrationController_getCRMContacts",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "phone",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Contacts retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get CRM contacts",
        "tags": [
          "integrations"
        ]
      },
      "post": {
        "operationId": "IntegrationController_createCRMContact",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Contact created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create CRM contact",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/contacts/{contactId}": {
      "patch": {
        "operationId": "IntegrationController_updateCRMContact",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update CRM contact",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/deals": {
      "get": {
        "operationId": "IntegrationController_getCRMDeals",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Deals retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get CRM deals",
        "tags": [
          "integrations"
        ]
      },
      "post": {
        "operationId": "IntegrationController_createCRMDeal",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Deal created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create CRM deal",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/deals/{dealId}": {
      "patch": {
        "operationId": "IntegrationController_updateCRMDeal",
        "parameters": [
          {
            "in": "path",
            "name": "dealId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deal updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update CRM deal",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/field-mappings": {
      "get": {
        "operationId": "IntegrationController_getFieldMappings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Field mappings retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get field mappings for integration",
        "tags": [
          "integrations"
        ]
      },
      "patch": {
        "operationId": "IntegrationController_updateFieldMappings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Field mappings updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update field mappings for integration",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/metadata": {
      "get": {
        "operationId": "IntegrationController_getCRMMetadata",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Metadata retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get CRM metadata and capabilities",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/oauth/callback": {
      "post": {
        "operationId": "IntegrationController_handleOAuthCallback",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OAuth completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Handle OAuth callback",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/oauth/initiate": {
      "post": {
        "operationId": "IntegrationController_initiateOAuth",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OAuth URL generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate OAuth flow",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/status": {
      "get": {
        "operationId": "IntegrationController_getIntegrationStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get integration status and health",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/sync": {
      "post": {
        "operationId": "IntegrationController_syncData",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sync completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync data with CRM",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/integrations/{crmType}/validate-credentials": {
      "post": {
        "operationId": "IntegrationController_validateCredentials",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credentials validated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Validate CRM credentials",
        "tags": [
          "integrations"
        ]
      }
    },
    "/v1/invoices": {
      "get": {
        "operationId": "InvoicesController_listInvoices",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List invoices (frontend alias)",
        "tags": [
          "invoices"
        ]
      },
      "post": {
        "operationId": "InvoicesController_createInvoice",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create invoice (frontend alias)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/analytics": {
      "get": {
        "operationId": "InvoicesController_getInvoiceAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Invoice analytics (frontend contract)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/analytics/forecast": {
      "get": {
        "operationId": "InvoicesController_getInvoiceForecast",
        "parameters": [
          {
            "in": "query",
            "name": "months",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Invoice revenue forecast (frontend contract)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/analytics/trends": {
      "get": {
        "operationId": "InvoicesController_getInvoiceTrends",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Invoice analytics trends (frontend contract)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/branding": {
      "get": {
        "operationId": "InvoicesController_getBranding",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice branding (frontend contract)",
        "tags": [
          "invoices"
        ]
      },
      "patch": {
        "operationId": "InvoicesController_patchBranding",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update invoice branding (frontend contract)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/upload-logo": {
      "post": {
        "operationId": "InvoicesController_uploadLogoAlias",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload logo (frontend contract)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}": {
      "delete": {
        "operationId": "InvoicesController_deleteInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete invoice (frontend alias)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}({0}.+)": {
      "get": {
        "operationId": "InvoicesController_getInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "404": {
            "description": "Invoice not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice (frontend alias)",
        "tags": [
          "invoices"
        ]
      },
      "patch": {
        "operationId": "InvoicesController_updateInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update invoice (frontend alias)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/deposit-link": {
      "post": {
        "operationId": "InvoicesController_generateDepositLink",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate invoice deposit payment link (partial payment / deposit)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/mark-paid": {
      "post": {
        "operationId": "InvoicesController_markPaid",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark invoice as paid (frontend alias)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/payment-link": {
      "post": {
        "operationId": "InvoicesController_generatePaymentLink",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate invoice payment link (frontend alias)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/payment-status": {
      "get": {
        "operationId": "InvoicesController_getPaymentStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice payment status (frontend alias)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/pdf": {
      "get": {
        "operationId": "InvoicesController_generatePdf",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate invoice PDF (frontend alias)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/recurring": {
      "get": {
        "operationId": "InvoicesController_getRecurring",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get recurring configuration for an invoice",
        "tags": [
          "invoices"
        ]
      },
      "post": {
        "operationId": "InvoicesController_upsertRecurring",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create/update recurring configuration for an invoice template",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/reminder": {
      "post": {
        "operationId": "InvoicesController_sendReminder",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send payment reminder for overdue invoice",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/send": {
      "post": {
        "operationId": "InvoicesController_sendEmail",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send invoice email (frontend alias)",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/invoices/{id}/void": {
      "post": {
        "operationId": "InvoicesController_voidInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Void/cancel an unpaid invoice",
        "tags": [
          "invoices"
        ]
      }
    },
    "/v1/knowledge-base": {
      "get": {
        "operationId": "KnowledgeBaseAliasController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Knowledge base articles retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Alias: list knowledge base articles",
        "tags": [
          "knowledge-base"
        ]
      },
      "post": {
        "operationId": "KnowledgeBaseAliasController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKbArticleDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Knowledge base article created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Alias: create knowledge base article",
        "tags": [
          "knowledge-base"
        ]
      }
    },
    "/v1/knowledge-base/analytics": {
      "get": {
        "operationId": "KnowledgeBaseAliasController_analytics",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Knowledge base analytics + recent queries",
        "tags": [
          "knowledge-base"
        ]
      }
    },
    "/v1/knowledge-base/articles": {
      "get": {
        "description": "Returns org KB articles with minimal fields, supports search. This is the canonical list for knowledge_article_ids selection.",
        "operationId": "KnowledgeBaseArticlesController_listArticles",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List org knowledge base articles (for agent picker)",
        "tags": [
          "knowledge-base"
        ]
      }
    },
    "/v1/knowledge-base/{id}": {
      "delete": {
        "operationId": "KnowledgeBaseAliasController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge base article deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Alias: delete knowledge base article",
        "tags": [
          "knowledge-base"
        ]
      },
      "patch": {
        "operationId": "KnowledgeBaseAliasController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKbArticleDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Knowledge base article updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Alias: update knowledge base article",
        "tags": [
          "knowledge-base"
        ]
      }
    },
    "/v1/knowledge-base/{id}({0}.+)": {
      "get": {
        "operationId": "KnowledgeBaseAliasController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge base article retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Alias: get knowledge base article",
        "tags": [
          "knowledge-base"
        ]
      }
    },
    "/v1/knowledge-bases": {
      "get": {
        "operationId": "KnowledgeBasesController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List knowledge bases",
        "tags": [
          "knowledge-bases"
        ]
      },
      "post": {
        "operationId": "KnowledgeBasesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKnowledgeBaseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create knowledge base",
        "tags": [
          "knowledge-bases"
        ]
      }
    },
    "/v1/knowledge-bases/{id}": {
      "delete": {
        "operationId": "KnowledgeBasesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete knowledge base",
        "tags": [
          "knowledge-bases"
        ]
      },
      "get": {
        "operationId": "KnowledgeBasesController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get knowledge base details",
        "tags": [
          "knowledge-bases"
        ]
      }
    },
    "/v1/knowledge-bases/{id}/documents": {
      "post": {
        "operationId": "KnowledgeBasesController_uploadDocument",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadKnowledgeDocumentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a knowledge base document (url/text/fileUrl)",
        "tags": [
          "knowledge-bases"
        ]
      }
    },
    "/v1/knowledge-bases/{id}/documents/{docId}": {
      "delete": {
        "operationId": "KnowledgeBasesController_removeDocument",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "docId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a knowledge base document",
        "tags": [
          "knowledge-bases"
        ]
      }
    },
    "/v1/knowledge-bases/{id}/sync": {
      "post": {
        "operationId": "KnowledgeBasesController_sync",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger re-indexing (embedding regeneration) for a knowledge base",
        "tags": [
          "knowledge-bases"
        ]
      }
    },
    "/v1/locations": {
      "get": {
        "operationId": "LocationsController_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Locations retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all locations",
        "tags": [
          "calendar-locations"
        ]
      },
      "post": {
        "operationId": "LocationsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLocationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Location created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new location",
        "tags": [
          "calendar-locations"
        ]
      }
    },
    "/v1/locations/service-request": {
      "post": {
        "operationId": "LocationsPublicController_createServiceRequest",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Service request received successfully"
          }
        },
        "summary": "Create a public service request for unserved areas",
        "tags": [
          "calendar-locations-public"
        ]
      }
    },
    "/v1/locations/{id}": {
      "delete": {
        "operationId": "LocationsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Location deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a location",
        "tags": [
          "calendar-locations"
        ]
      },
      "get": {
        "operationId": "LocationsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Location retrieved successfully"
          },
          "404": {
            "description": "Location not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a location by ID",
        "tags": [
          "calendar-locations"
        ]
      },
      "patch": {
        "operationId": "LocationsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLocationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Location updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a location",
        "tags": [
          "calendar-locations"
        ]
      }
    },
    "/v1/locations/{id}/availability": {
      "get": {
        "operationId": "LocationsController_getAvailability",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Availability retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get location availability",
        "tags": [
          "calendar-locations"
        ]
      }
    },
    "/v1/locations/{id}/default": {
      "post": {
        "operationId": "LocationsController_setDefaultLocation",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Default location updated"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set organization default location",
        "tags": [
          "calendar-locations"
        ]
      }
    },
    "/v1/locations/{id}/staff": {
      "get": {
        "operationId": "LocationsController_getLocationStaff",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List staff assigned to this location",
        "tags": [
          "calendar-locations"
        ]
      },
      "post": {
        "operationId": "LocationsController_setLocationStaff",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetLocationStaffDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replace staff assignments for this location",
        "tags": [
          "calendar-locations"
        ]
      }
    },
    "/v1/loyalty/tier/{contactId}": {
      "get": {
        "operationId": "LoyaltyController_getLoyaltyTier",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get loyalty tier for a contact",
        "tags": [
          "Loyalty"
        ]
      }
    },
    "/v1/loyalty/{contactId}/apply": {
      "post": {
        "operationId": "LoyaltyController_apply",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyLoyaltyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Apply loyalty credits (spec)",
        "tags": [
          "Loyalty"
        ]
      }
    },
    "/v1/loyalty/{contactId}/balance": {
      "get": {
        "operationId": "LoyaltyController_getBalance",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get loyalty credit balance (spec)",
        "tags": [
          "Loyalty"
        ]
      }
    },
    "/v1/loyalty/{contactId}/expiring": {
      "get": {
        "operationId": "LoyaltyController_expiring",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "example": 30,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get expiring loyalty credits (spec)",
        "tags": [
          "Loyalty"
        ]
      }
    },
    "/v1/loyalty/{contactId}/history": {
      "get": {
        "operationId": "LoyaltyController_getHistory",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get loyalty credit history (spec)",
        "tags": [
          "Loyalty"
        ]
      }
    },
    "/v1/make/events": {
      "get": {
        "operationId": "MakeController_getEvents",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List recommended event types for Make.com scenarios",
        "tags": [
          "make"
        ]
      }
    },
    "/v1/make/status": {
      "get": {
        "operationId": "MakeController_getStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Make.com connection status",
        "tags": [
          "make"
        ]
      }
    },
    "/v1/make/webhooks": {
      "get": {
        "operationId": "MakeController_listWebhooks",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Make.com webhook endpoints",
        "tags": [
          "make"
        ]
      },
      "post": {
        "operationId": "MakeController_connect",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMakeWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Connect Make.com by saving a scenario webhook URL",
        "tags": [
          "make"
        ]
      }
    },
    "/v1/make/webhooks/{id}": {
      "delete": {
        "operationId": "MakeController_disconnect",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Disconnect (deactivate) a Make.com webhook endpoint",
        "tags": [
          "make"
        ]
      }
    },
    "/v1/make/webhooks/{id}/test": {
      "post": {
        "operationId": "MakeController_test",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a targeted test payload to a Make.com webhook endpoint",
        "tags": [
          "make"
        ]
      }
    },
    "/v1/maps/places/autocomplete": {
      "get": {
        "operationId": "MapsController_getAutocomplete",
        "parameters": [
          {
            "description": "Address search input",
            "in": "query",
            "name": "input",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Country code (e.g., US)",
            "in": "query",
            "name": "country",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Autocomplete predictions"
          },
          "400": {
            "description": "Invalid input"
          },
          "403": {
            "description": "Google Places API request denied"
          },
          "429": {
            "description": "Google Places API quota exceeded"
          },
          "502": {
            "description": "Google Places API network error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Google Places autocomplete predictions (admin)",
        "tags": [
          "maps"
        ]
      }
    },
    "/v1/maps/places/business/autocomplete": {
      "get": {
        "operationId": "MapsController_getBusinessAutocomplete",
        "parameters": [
          {
            "description": "Business search input",
            "in": "query",
            "name": "input",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Country code (e.g., US)",
            "in": "query",
            "name": "country",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Business autocomplete predictions"
          },
          "400": {
            "description": "Invalid input"
          },
          "403": {
            "description": "Google Places API request denied"
          },
          "429": {
            "description": "Google Places API quota exceeded"
          },
          "502": {
            "description": "Google Places API network error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Google Places business autocomplete predictions (listings)",
        "tags": [
          "maps"
        ]
      }
    },
    "/v1/maps/places/business/{placeId}": {
      "get": {
        "operationId": "MapsController_getBusinessPlaceDetails",
        "parameters": [
          {
            "description": "Google Place ID",
            "in": "path",
            "name": "placeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Business place details"
          },
          "400": {
            "description": "Invalid place ID"
          },
          "403": {
            "description": "Google Places API request denied"
          },
          "404": {
            "description": "Place not found"
          },
          "429": {
            "description": "Google Places API quota exceeded"
          },
          "502": {
            "description": "Google Places API network error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Google Place business details (listings)",
        "tags": [
          "maps"
        ]
      }
    },
    "/v1/maps/places/{placeId}": {
      "get": {
        "operationId": "MapsController_getPlaceDetails",
        "parameters": [
          {
            "description": "Google Place ID",
            "in": "path",
            "name": "placeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Place details"
          },
          "400": {
            "description": "Invalid place ID"
          },
          "403": {
            "description": "Google Places API request denied"
          },
          "404": {
            "description": "Place not found"
          },
          "429": {
            "description": "Google Places API quota exceeded"
          },
          "502": {
            "description": "Google Places API network error"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Google Place details (admin)",
        "tags": [
          "maps"
        ]
      }
    },
    "/v1/marketing/ad-campaigns": {
      "get": {
        "operationId": "AdCampaignsController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "channelSubtype",
            "required": false,
            "schema": {
              "enum": [
                "google_search_responsive",
                "google_performance_max",
                "google_maps",
                "meta_feed",
                "meta_story"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "draft",
                "pending_publish",
                "submitting",
                "in_review",
                "active",
                "paused",
                "failed",
                "completed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Ad account filter",
            "in": "query",
            "name": "adAccountId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdCampaignResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List campaigns",
        "tags": [
          "Marketing Ad Campaigns"
        ]
      },
      "post": {
        "operationId": "AdCampaignsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAdCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCampaignResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a campaign draft",
        "tags": [
          "Marketing Ad Campaigns"
        ]
      }
    },
    "/v1/marketing/ad-campaigns/{id}": {
      "get": {
        "operationId": "AdCampaignsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCampaignResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get campaign detail",
        "tags": [
          "Marketing Ad Campaigns"
        ]
      }
    },
    "/v1/marketing/ad-campaigns/{id}/budget": {
      "patch": {
        "operationId": "AdCampaignsController_updateBudget",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignBudgetDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCampaignResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update campaign budget",
        "tags": [
          "Marketing Ad Campaigns"
        ]
      }
    },
    "/v1/marketing/ad-campaigns/{id}/metrics": {
      "get": {
        "operationId": "AdCampaignsController_getMetrics",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Start date for metrics (ISO 8601)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2024-01-01",
              "type": "string"
            }
          },
          {
            "description": "End date for metrics (ISO 8601)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2024-01-31",
              "type": "string"
            }
          },
          {
            "description": "Granularity of metrics",
            "in": "query",
            "name": "granularity",
            "required": false,
            "schema": {
              "default": "daily",
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignMetricsResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get campaign performance metrics",
        "tags": [
          "Marketing Ad Campaigns"
        ]
      }
    },
    "/v1/marketing/ad-campaigns/{id}/pause": {
      "post": {
        "operationId": "AdCampaignsController_pause",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCampaignResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pause an active campaign",
        "tags": [
          "Marketing Ad Campaigns"
        ]
      }
    },
    "/v1/marketing/ad-campaigns/{id}/publish": {
      "post": {
        "operationId": "AdCampaignsController_publish",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishAdCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCampaignResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish a campaign",
        "tags": [
          "Marketing Ad Campaigns"
        ]
      }
    },
    "/v1/marketing/ad-campaigns/{id}/resume": {
      "post": {
        "operationId": "AdCampaignsController_resume",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCampaignResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Resume a paused campaign",
        "tags": [
          "Marketing Ad Campaigns"
        ]
      }
    },
    "/v1/marketing/ad-creatives": {
      "get": {
        "operationId": "MarketingAdCreativesController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "channelSubtype",
            "required": false,
            "schema": {
              "enum": [
                "google_search_responsive",
                "google_performance_max",
                "google_maps",
                "meta_feed",
                "meta_story"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "queued",
                "processing",
                "ready",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by ad account ID",
            "in": "query",
            "name": "adAccountId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum rows to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "type": "number"
            }
          },
          {
            "description": "Include asset payloads in response",
            "in": "query",
            "name": "includeAssets",
            "required": false,
            "schema": {
              "default": true,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdCreativeResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List ad creative requests",
        "tags": [
          "Marketing Ad Creatives"
        ]
      },
      "post": {
        "operationId": "MarketingAdCreativesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAdCreativeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCreativeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new ad creative request",
        "tags": [
          "Marketing Ad Creatives"
        ]
      }
    },
    "/v1/marketing/ad-creatives/{id}": {
      "delete": {
        "operationId": "MarketingAdCreativesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Creative removed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a creative",
        "tags": [
          "Marketing Ad Creatives"
        ]
      },
      "get": {
        "operationId": "MarketingAdCreativesController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCreativeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a single ad creative",
        "tags": [
          "Marketing Ad Creatives"
        ]
      }
    },
    "/v1/marketing/ad-creatives/{id}/retry": {
      "post": {
        "operationId": "MarketingAdCreativesController_retry",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCreativeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry generation for a creative",
        "tags": [
          "Marketing Ad Creatives"
        ]
      }
    },
    "/v1/marketing/ads-builder/creatives": {
      "get": {
        "operationId": "MarketingAdsBuilderController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "channelSubtype",
            "required": false,
            "schema": {
              "enum": [
                "google_search_responsive",
                "google_performance_max",
                "google_maps",
                "meta_feed",
                "meta_story"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "queued",
                "processing",
                "ready",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by ad account ID",
            "in": "query",
            "name": "adAccountId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum rows to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "type": "number"
            }
          },
          {
            "description": "Include asset payloads in response",
            "in": "query",
            "name": "includeAssets",
            "required": false,
            "schema": {
              "default": true,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdCreativeResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List ad creative requests",
        "tags": [
          "Marketing Ads Builder"
        ]
      },
      "post": {
        "operationId": "MarketingAdsBuilderController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAdCreativeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCreativeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new ad creative request",
        "tags": [
          "Marketing Ads Builder"
        ]
      }
    },
    "/v1/marketing/ads-builder/creatives/{id}": {
      "delete": {
        "operationId": "MarketingAdsBuilderController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Creative removed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a creative",
        "tags": [
          "Marketing Ads Builder"
        ]
      },
      "get": {
        "operationId": "MarketingAdsBuilderController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCreativeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a single ad creative",
        "tags": [
          "Marketing Ads Builder"
        ]
      }
    },
    "/v1/marketing/ads-builder/creatives/{id}/retry": {
      "post": {
        "operationId": "MarketingAdsBuilderController_retry",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdCreativeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry generation for a creative",
        "tags": [
          "Marketing Ads Builder"
        ]
      }
    },
    "/v1/marketing/ads/accounts": {
      "get": {
        "operationId": "MarketingAdsController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "enum": [
                "google_ads",
                "meta_ads"
              ],
              "example": "google_ads",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "connected",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdAccountResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List advertising account connections",
        "tags": [
          "Marketing Ads"
        ]
      },
      "post": {
        "operationId": "MarketingAdsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAdAccountDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdAccountResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an advertising account connection",
        "tags": [
          "Marketing Ads"
        ]
      }
    },
    "/v1/marketing/ads/accounts/{id}": {
      "delete": {
        "operationId": "MarketingAdsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an advertising account connection",
        "tags": [
          "Marketing Ads"
        ]
      },
      "get": {
        "operationId": "MarketingAdsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdAccountResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retrieve an advertising account connection",
        "tags": [
          "Marketing Ads"
        ]
      },
      "patch": {
        "operationId": "MarketingAdsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAdAccountDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdAccountResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an advertising account connection",
        "tags": [
          "Marketing Ads"
        ]
      }
    },
    "/v1/marketing/ads/accounts/{id}/campaigns": {
      "get": {
        "operationId": "MarketingAdsController_listCampaigns",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO start date (inclusive). Defaults to 30 days ago.",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO end date (inclusive). Defaults to today.",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter summaries to these campaign ids.",
            "in": "query",
            "name": "campaignIds",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdCampaignSummaryDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List campaign-level performance summaries",
        "tags": [
          "Marketing Ads"
        ]
      }
    },
    "/v1/marketing/ads/accounts/{id}/campaigns/{campaignId}/budget": {
      "patch": {
        "operationId": "MarketingAdsController_updateCampaignBudget",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignBudgetDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Campaign budget updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update the daily budget of a campaign",
        "tags": [
          "Marketing Ads"
        ]
      }
    },
    "/v1/marketing/ads/accounts/{id}/campaigns/{campaignId}/status": {
      "patch": {
        "operationId": "MarketingAdsController_updateCampaignStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Campaign status updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update the lifecycle status of a campaign",
        "tags": [
          "Marketing Ads"
        ]
      }
    },
    "/v1/marketing/ads/accounts/{id}/campaigns/{campaignId}/timeseries": {
      "get": {
        "operationId": "MarketingAdsController_getCampaignTimeseries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO start date (inclusive). Defaults to 30 days ago.",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO end date (inclusive). Defaults to today.",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter summaries to these campaign ids.",
            "in": "query",
            "name": "campaignIds",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdCampaignTimeseriesDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get campaign performance time-series",
        "tags": [
          "Marketing Ads"
        ]
      }
    },
    "/v1/marketing/ads/accounts/{id}/insights/summary": {
      "get": {
        "operationId": "MarketingAdsController_getSummary",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO start date (inclusive). Defaults to 30 days ago.",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO end date (inclusive). Defaults to today.",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter summaries to these campaign ids.",
            "in": "query",
            "name": "campaignIds",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdAccountSummaryDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get aggregated performance summary for an advertising account",
        "tags": [
          "Marketing Ads"
        ]
      }
    },
    "/v1/marketing/ads/accounts/{id}/sync": {
      "post": {
        "operationId": "MarketingAdsController_triggerSync",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerAdSyncDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdAccountResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger advertising insights sync",
        "tags": [
          "Marketing Ads"
        ]
      }
    },
    "/v1/marketing/ads/billing": {
      "get": {
        "operationId": "MarketingAdsFinanceController_getSummary",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsBillingSummaryDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get ads prepaid wallet + spend caps summary",
        "tags": [
          "Marketing Ads Billing"
        ]
      }
    },
    "/v1/marketing/ads/billing/settings": {
      "put": {
        "operationId": "MarketingAdsFinanceController_updateSettings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAdsBillingSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update ads spend caps and autopause settings",
        "tags": [
          "Marketing Ads Billing"
        ]
      }
    },
    "/v1/marketing/ads/billing/topup-intent": {
      "post": {
        "operationId": "MarketingAdsFinanceController_createTopupIntent",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAdsPrepaidTopupIntentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsTopUpIntentResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a Stripe payment intent to top up ads prepaid wallet",
        "tags": [
          "Marketing Ads Billing"
        ]
      }
    },
    "/v1/marketing/ads/billing/transactions": {
      "get": {
        "operationId": "MarketingAdsFinanceController_listTransactions",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsBillingTransactionsResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get ads prepaid top-up + spend transaction history",
        "tags": [
          "Marketing Ads Billing"
        ]
      }
    },
    "/v1/marketing/ads/managed/check-mode": {
      "get": {
        "operationId": "ManagedAdsController_checkMode",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check if managed mode is enabled",
        "tags": [
          "Marketing Managed Ads"
        ]
      }
    },
    "/v1/marketing/ads/managed/google/create-customer": {
      "post": {
        "operationId": "ManagedAdsController_createGoogleCustomer",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new Google Ads customer account under ServiceAgent MCC (managed mode)",
        "tags": [
          "Marketing Managed Ads"
        ]
      }
    },
    "/v1/marketing/ads/managed/meta/create-ad-account": {
      "post": {
        "operationId": "ManagedAdsController_createMetaAdAccount",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new Meta ad account under ServiceAgent Business Manager (managed mode)",
        "tags": [
          "Marketing Managed Ads"
        ]
      }
    },
    "/v1/marketing/ads/managed/meta/link-account": {
      "post": {
        "operationId": "ManagedAdsController_linkMetaAdAccount",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Link an existing Meta ad account to the org (managed mode, no customer OAuth)",
        "tags": [
          "Marketing Managed Ads"
        ]
      }
    },
    "/v1/marketing/creative/suggestions": {
      "get": {
        "operationId": "MarketingCreativeController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "enum": [
                "google_ads",
                "meta_ads",
                "listings",
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "ready",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CreativeSuggestionResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List creative suggestions",
        "tags": [
          "Marketing Creative"
        ]
      },
      "post": {
        "operationId": "MarketingCreativeController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCreativeSuggestionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeSuggestionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a creative suggestion request",
        "tags": [
          "Marketing Creative"
        ]
      }
    },
    "/v1/marketing/creative/suggestions/{id}": {
      "delete": {
        "operationId": "MarketingCreativeController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suggestion deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a creative suggestion",
        "tags": [
          "Marketing Creative"
        ]
      },
      "get": {
        "operationId": "MarketingCreativeController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeSuggestionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retrieve a creative suggestion",
        "tags": [
          "Marketing Creative"
        ]
      }
    },
    "/v1/marketing/creative/suggestions/{id}/retry": {
      "post": {
        "operationId": "MarketingCreativeController_retry",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreativeSuggestionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry creative suggestion generation",
        "tags": [
          "Marketing Creative"
        ]
      }
    },
    "/v1/marketing/dashboard": {
      "get": {
        "description": "Single endpoint that fans out parallel queries server-side and returns the aggregate the marketing landing page needs. Replaces 4-5 separate frontend calls (campaigns, listings, reviews, NAP changes) with one. Read-only — no side effects.",
        "operationId": "MarketingDashboardController_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Aggregate dashboard payload (campaigns + listings + reviews)",
        "tags": [
          "Marketing Dashboard"
        ]
      }
    },
    "/v1/marketing/listings": {
      "get": {
        "operationId": "MarketingListingsController_listAll",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List listings (frontend contract)",
        "tags": [
          "Marketing Listings"
        ]
      },
      "post": {
        "operationId": "MarketingListingsController_createAlias",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateListingConnectionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingConnectionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new listing connection (alias for /connections)",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/bulk-sync": {
      "post": {
        "operationId": "MarketingListingsController_bulkSync",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkSyncListingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync multiple listings (spec endpoint)",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/connections": {
      "get": {
        "operationId": "MarketingListingsController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "enum": [
                "google_business",
                "yelp",
                "facebook",
                "apple_maps",
                "bing",
                "trustpilot"
              ],
              "example": "google_business",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "connected",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ListingConnectionResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List listings provider connections",
        "tags": [
          "Marketing Listings"
        ]
      },
      "post": {
        "operationId": "MarketingListingsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateListingConnectionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingConnectionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a listings provider connection",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/connections/{id}": {
      "delete": {
        "operationId": "MarketingListingsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a listings provider connection",
        "tags": [
          "Marketing Listings"
        ]
      },
      "get": {
        "operationId": "MarketingListingsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingConnectionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retrieve a listings provider connection",
        "tags": [
          "Marketing Listings"
        ]
      },
      "patch": {
        "operationId": "MarketingListingsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateListingConnectionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingConnectionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a listings provider connection",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/connections/{id}/nap/changes": {
      "get": {
        "operationId": "MarketingListingsController_listNapChanges",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "enum": [
                "google_business",
                "yelp",
                "facebook",
                "apple_maps",
                "bing",
                "trustpilot"
              ],
              "example": "google",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "field",
            "required": false,
            "schema": {
              "enum": [
                "name",
                "phone",
                "address"
              ],
              "example": "phone",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "in_progress",
                "resolved",
                "ignored"
              ],
              "example": "pending",
              "type": "string"
            }
          },
          {
            "description": "Filter by connection identifier",
            "in": "query",
            "name": "connectionId",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/NapChangeResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List NAP change history for a connection",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/connections/{id}/provider-locations": {
      "get": {
        "operationId": "MarketingListingsController_listProviderLocations",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ProviderLocationResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List selectable provider locations for a listings connection",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/connections/{id}/select-provider-location": {
      "post": {
        "operationId": "MarketingListingsController_selectProviderLocation",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectProviderLocationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingConnectionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save the selected provider location for a listings connection",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/connections/{id}/sync": {
      "post": {
        "operationId": "MarketingListingsController_triggerSync",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerListingSyncDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingConnectionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger a listings sync for the connection",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/nap/changes/{changeId}/ignore": {
      "patch": {
        "operationId": "MarketingListingsController_ignoreNapChange",
        "parameters": [
          {
            "in": "path",
            "name": "changeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNapChangeNotesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NapChangeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Ignore a NAP mismatch (no remediation needed)",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/nap/changes/{changeId}/reopen": {
      "patch": {
        "operationId": "MarketingListingsController_reopenNapChange",
        "parameters": [
          {
            "in": "path",
            "name": "changeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNapChangeNotesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NapChangeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reopen a previously resolved or ignored NAP mismatch",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/nap/changes/{changeId}/resolve": {
      "patch": {
        "operationId": "MarketingListingsController_resolveNapChange",
        "parameters": [
          {
            "in": "path",
            "name": "changeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveNapChangeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NapChangeResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Resolve a NAP mismatch after remediation",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/sync-jobs/{jobId}": {
      "get": {
        "operationId": "MarketingListingsController_getSyncJob",
        "parameters": [
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get listings sync job status (frontend polling)",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/{id}": {
      "delete": {
        "operationId": "MarketingListingsController_removeAlias",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a listing connection (alias for DELETE /connections/:id)",
        "tags": [
          "Marketing Listings"
        ]
      },
      "get": {
        "operationId": "MarketingListingsController_getListing",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get listing (frontend contract)",
        "tags": [
          "Marketing Listings"
        ]
      },
      "put": {
        "operationId": "MarketingListingsController_updateAlias",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateListingConnectionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingConnectionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a listing connection (alias for PATCH /connections/:id)",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/listings/{id}/sync": {
      "post": {
        "operationId": "MarketingListingsController_triggerSyncAlias",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerListingSyncDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListingConnectionResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger a sync for a listing (alias for POST /connections/:id/sync)",
        "tags": [
          "Marketing Listings"
        ]
      }
    },
    "/v1/marketing/notifications": {
      "get": {
        "operationId": "MarketingNotificationsController_get",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingNotificationPreferencesDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get marketing notification preferences",
        "tags": [
          "Marketing Notifications"
        ]
      },
      "put": {
        "operationId": "MarketingNotificationsController_update",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMarketingNotificationPreferencesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingNotificationPreferencesDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update marketing notification preferences",
        "tags": [
          "Marketing Notifications"
        ]
      }
    },
    "/v1/marketing/oauth/ads/callback": {
      "get": {
        "operationId": "MarketingOAuthController_adsCallback",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "raw",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "OAuth callback for advertising providers",
        "tags": [
          "Marketing OAuth"
        ]
      }
    },
    "/v1/marketing/oauth/ads/{provider}/initiate": {
      "get": {
        "operationId": "MarketingOAuthController_initiateAds",
        "parameters": [
          {
            "in": "query",
            "name": "externalAccountId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "redirectUri",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate OAuth flow for an advertising provider",
        "tags": [
          "Marketing OAuth"
        ]
      },
      "post": {
        "operationId": "MarketingOAuthController_initiateAdsPost",
        "parameters": [
          {
            "in": "query",
            "name": "externalAccountId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "redirectUri",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate OAuth flow for an advertising provider (POST alias)",
        "tags": [
          "Marketing OAuth"
        ]
      }
    },
    "/v1/marketing/oauth/listing/callback": {
      "get": {
        "operationId": "MarketingOAuthController_listingCallback",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "raw",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "OAuth callback for listings providers",
        "tags": [
          "Marketing OAuth"
        ]
      }
    },
    "/v1/marketing/oauth/listing/{provider}/initiate": {
      "get": {
        "operationId": "MarketingOAuthController_initiateListing",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate OAuth flow for a listings provider",
        "tags": [
          "Marketing OAuth"
        ]
      },
      "post": {
        "operationId": "MarketingOAuthController_initiateListingPost",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate OAuth flow for a listings provider (POST alias)",
        "tags": [
          "Marketing OAuth"
        ]
      }
    },
    "/v1/marketing/onboarding": {
      "post": {
        "operationId": "MarketingOnboardingController_save",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketingOnboardingConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save marketing onboarding configuration",
        "tags": [
          "Marketing Onboarding"
        ]
      }
    },
    "/v1/marketing/reporting/overview": {
      "get": {
        "operationId": "MarketingReportingController_getOverview",
        "parameters": [
          {
            "description": "Filter results by channel",
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "enum": [
                "listings",
                "ads",
                "reviews",
                "website",
                "social"
              ],
              "example": "listings",
              "type": "string"
            }
          },
          {
            "description": "Location identifier to filter the results",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Start date for the reporting range (inclusive)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-01-01",
              "type": "string"
            }
          },
          {
            "description": "End date for the reporting range (inclusive)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-01-31",
              "type": "string"
            }
          },
          {
            "description": "Granularity for the timeseries data",
            "in": "query",
            "name": "granularity",
            "required": false,
            "schema": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "example": "daily",
              "type": "string"
            }
          },
          {
            "description": "Return only summary card metrics; defaults to false",
            "in": "query",
            "name": "summaryOnly",
            "required": false,
            "schema": {
              "example": false,
              "type": "boolean"
            }
          },
          {
            "description": "Return only timeseries datapoints; defaults to false",
            "in": "query",
            "name": "timeseriesOnly",
            "required": false,
            "schema": {
              "example": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingDashboardResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get combined marketing dashboard overview",
        "tags": [
          "Marketing Reporting"
        ]
      }
    },
    "/v1/marketing/reviews": {
      "get": {
        "operationId": "MarketingReviewsFrontendController_list",
        "parameters": [
          {
            "description": "Page number (1-indexed)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "description": "Page size",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "description": "Alias for provider (frontend uses source)",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "example": "google",
              "type": "string"
            }
          },
          {
            "description": "Alias for rating filter (exact match).",
            "in": "query",
            "name": "rating",
            "required": false,
            "schema": {
              "example": 5,
              "maximum": 5,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Alias for status (best-effort).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "responded",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "enum": [
                "google_business",
                "yelp",
                "facebook",
                "apple_maps",
                "bing",
                "trustpilot"
              ],
              "example": "google",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sentiment",
            "required": false,
            "schema": {
              "enum": [
                "positive",
                "neutral",
                "negative"
              ],
              "example": "negative",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "minRating",
            "required": false,
            "schema": {
              "example": 5,
              "maximum": 5,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "maxRating",
            "required": false,
            "schema": {
              "example": 2,
              "maximum": 5,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "hasReply",
            "required": false,
            "schema": {
              "example": true,
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "example": "slow response time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-01-01",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-01-31",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "take",
            "required": false,
            "schema": {
              "default": 50,
              "example": 25,
              "maximum": 200,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "example": 0,
              "minimum": 0,
              "type": "number"
            }
          },
          {
            "description": "Filter by specific listing connection IDs",
            "in": "query",
            "name": "connectionIds",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List reviews (frontend contract wrapper)",
        "tags": [
          "Marketing Reviews (Frontend Contract)"
        ]
      }
    },
    "/v1/marketing/reviews/connections/{connectionId}/ingest": {
      "post": {
        "operationId": "ReviewRequestsController_triggerConnectionIngestion",
        "parameters": [
          {
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerReviewIngestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger review ingestion for a specific listing connection",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/ingest": {
      "post": {
        "operationId": "ReviewRequestsController_triggerIngestion",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerReviewIngestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "enqueued": 1
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger review ingestion for all or specific listing connections",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/metrics": {
      "get": {
        "operationId": "ReviewRequestsController_getMetrics",
        "parameters": [
          {
            "description": "Page number (1-indexed)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "description": "Page size",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "description": "Alias for provider (frontend uses source)",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "example": "google",
              "type": "string"
            }
          },
          {
            "description": "Alias for rating filter (exact match).",
            "in": "query",
            "name": "rating",
            "required": false,
            "schema": {
              "example": 5,
              "maximum": 5,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Alias for status (best-effort).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "responded",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "enum": [
                "google_business",
                "yelp",
                "facebook",
                "apple_maps",
                "bing",
                "trustpilot"
              ],
              "example": "google",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sentiment",
            "required": false,
            "schema": {
              "enum": [
                "positive",
                "neutral",
                "negative"
              ],
              "example": "negative",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "minRating",
            "required": false,
            "schema": {
              "example": 5,
              "maximum": 5,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "maxRating",
            "required": false,
            "schema": {
              "example": 2,
              "maximum": 5,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "hasReply",
            "required": false,
            "schema": {
              "example": true,
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "example": "slow response time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-01-01",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-01-31",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "take",
            "required": false,
            "schema": {
              "default": 50,
              "example": 25,
              "maximum": 200,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "example": 0,
              "minimum": 0,
              "type": "number"
            }
          },
          {
            "description": "Filter by specific listing connection IDs",
            "in": "query",
            "name": "connectionIds",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewMetricsDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch aggregate metrics for marketing reviews",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/r/{token}": {
      "get": {
        "operationId": "ReviewRequestsPublicController_resolveToken",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirected to review provider"
          }
        },
        "summary": "Resolve review link token and redirect",
        "tags": [
          "Marketing Reviews Public"
        ]
      }
    },
    "/v1/marketing/reviews/request": {
      "post": {
        "operationId": "ReviewRequestsController_createSpecRequest",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Prevents duplicate review requests",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReviewRequestSpecDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Review request created"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a review request (spec endpoint)",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/requests": {
      "get": {
        "operationId": "ReviewRequestsController_listRequests",
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "description": "Supports both internal statuses and Marketing Suite spec statuses",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "queued",
                "sending",
                "sent",
                "failed",
                "pending",
                "sent",
                "opened",
                "clicked",
                "reviewed",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by contact identifier",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by location identifier",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by appointment identifier",
            "in": "query",
            "name": "appointmentId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by job identifier",
            "in": "query",
            "name": "jobId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-01-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-01-31T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "description": "Search contact name, email, or phone",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "take",
            "required": false,
            "schema": {
              "default": 50,
              "example": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "example": 0,
              "minimum": 0,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "createdAt",
              "enum": [
                "createdAt",
                "sendAfter",
                "sentAt"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only include requests that are scheduled to send in the future",
            "in": "query",
            "name": "includeScheduledOnly",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReviewRequestResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List marketing review requests",
        "tags": [
          "Marketing Reviews"
        ]
      },
      "post": {
        "operationId": "ReviewRequestsController_createManualRequest",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReviewRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CreateReviewRequestResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create manual review request",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/requests/{requestId}": {
      "get": {
        "operationId": "ReviewRequestsController_findRequest",
        "parameters": [
          {
            "in": "path",
            "name": "requestId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewRequestResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retrieve a single review request by identifier",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/requests/{requestId}/click": {
      "get": {
        "operationId": "ReviewRequestsPublicController_handleClick",
        "parameters": [
          {
            "in": "path",
            "name": "requestId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "redirect",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirected to review provider"
          }
        },
        "summary": "Track click and redirect to review provider",
        "tags": [
          "Marketing Reviews Public"
        ]
      }
    },
    "/v1/marketing/reviews/requests/{requestId}/process": {
      "post": {
        "operationId": "ReviewRequestsController_processRequestNow",
        "parameters": [
          {
            "in": "path",
            "name": "requestId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewRequestResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Process a queued review request immediately",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/settings": {
      "get": {
        "operationId": "ReviewRequestsController_getSettings",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewSettingsDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get review request settings for organization or location",
        "tags": [
          "Marketing Reviews"
        ]
      },
      "patch": {
        "operationId": "ReviewRequestsController_patchSettings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReviewSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewSettingsDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Partially update review request settings",
        "tags": [
          "Marketing Reviews"
        ]
      },
      "put": {
        "operationId": "ReviewRequestsController_updateSettings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReviewSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewSettingsDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update review request settings",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/summary": {
      "get": {
        "operationId": "MarketingReviewsFrontendController_summary",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reviews summary (frontend contract)",
        "tags": [
          "Marketing Reviews (Frontend Contract)"
        ]
      }
    },
    "/v1/marketing/reviews/{id}": {
      "get": {
        "operationId": "MarketingReviewsFrontendController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get review (frontend contract)",
        "tags": [
          "Marketing Reviews (Frontend Contract)"
        ]
      }
    },
    "/v1/marketing/reviews/{id}/respond": {
      "post": {
        "operationId": "MarketingReviewsFrontendController_respond",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Respond to a review (frontend contract alias)",
        "tags": [
          "Marketing Reviews (Frontend Contract)"
        ]
      }
    },
    "/v1/marketing/reviews/{reviewId}": {
      "get": {
        "operationId": "ReviewRequestsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retrieve a single review by identifier",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/{reviewId}/ai-reply": {
      "post": {
        "operationId": "ReviewRequestsController_generateAiReply",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateReviewReplyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate an AI-powered reply suggestion for a review",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/reviews/{reviewId}/reply": {
      "patch": {
        "operationId": "ReviewRequestsController_updateReply",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReviewReplyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update or add a reply to a review",
        "tags": [
          "Marketing Reviews"
        ]
      }
    },
    "/v1/marketing/summary": {
      "get": {
        "operationId": "MarketingSummaryController_getSummary",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Card-level marketing counts for the marketing home",
        "tags": [
          "Marketing Summary"
        ]
      }
    },
    "/v1/mcp": {
      "delete": {
        "operationId": "McpGatewayController_terminateSession",
        "parameters": [
          {
            "description": "Idempotency key for POST/PATCH operations",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Request ID for tracing",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Tenant ID",
            "in": "header",
            "name": "X-Tenant-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "mcp-session-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Terminate MCP session (Streamable HTTP)",
        "tags": [
          "mcp"
        ]
      },
      "get": {
        "operationId": "McpGatewayController_heartbeat",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key for POST/PATCH operations",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "Request ID for tracing",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "description": "Tenant ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "mcp"
        ]
      },
      "head": {
        "operationId": "McpGatewayController_heartbeatHead",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key for POST/PATCH operations",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "Request ID for tracing",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "description": "Tenant ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "mcp"
        ]
      },
      "post": {
        "operationId": "McpGatewayController_handleMcpProtocol",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key for POST/PATCH operations",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "Request ID for tracing",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "description": "Tenant ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-request-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "mcp-session-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MCP protocol message handled"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Handle MCP protocol messages (JSON-RPC 2.0) via Streamable HTTP transport",
        "tags": [
          "mcp"
        ]
      }
    },
    "/v1/mcp/auth": {
      "post": {
        "operationId": "McpGatewayController_mcpAuth",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key for POST/PATCH operations",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "Request ID for tracing",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "description": "Tenant ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access token generated"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "MCP authentication endpoint (generates access token from credentials)",
        "tags": [
          "mcp"
        ]
      }
    },
    "/v1/mcp/oauth2/authorize": {
      "get": {
        "operationId": "OAuth2Controller_authorize",
        "parameters": [
          {
            "description": "Must be \"code\"",
            "in": "query",
            "name": "response_type",
            "required": true,
            "schema": {
              "example": "code",
              "type": "string"
            }
          },
          {
            "description": "OAuth2 client ID",
            "in": "query",
            "name": "client_id",
            "required": true,
            "schema": {
              "example": "cmhw6k04i001j3m0rp2icr3ax",
              "type": "string"
            }
          },
          {
            "description": "Redirect URI after authorization",
            "in": "query",
            "name": "redirect_uri",
            "required": true,
            "schema": {
              "example": "https://claude.ai/api/mcp/auth_callback",
              "type": "string"
            }
          },
          {
            "description": "PKCE code challenge",
            "in": "query",
            "name": "code_challenge",
            "required": true,
            "schema": {
              "example": "vx4GjymQGsEMSFC-3aElC4cxbOJQckLPApSU2rPE-dI",
              "type": "string"
            }
          },
          {
            "description": "PKCE method (S256 or plain)",
            "in": "query",
            "name": "code_challenge_method",
            "required": true,
            "schema": {
              "example": "S256",
              "type": "string"
            }
          },
          {
            "description": "State parameter for CSRF protection",
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "example": "0rodEZFQWn0OUQCIjfVgPh4_6u85JpphePeG8MJw5VQ",
              "type": "string"
            }
          },
          {
            "description": "Requested scopes",
            "in": "query",
            "name": "scope",
            "required": false,
            "schema": {
              "example": "claudeai",
              "type": "string"
            }
          },
          {
            "description": "Resource indicator (RFC 8707) for the MCP endpoint",
            "in": "query",
            "name": "resource",
            "required": false,
            "schema": {
              "example": "https://process.serviceagent.ai/v1/mcp",
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to client with authorization code"
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Invalid client"
          }
        },
        "summary": "OAuth2 authorization endpoint for authorization code flow",
        "tags": [
          "mcp-oauth2"
        ]
      }
    },
    "/v1/mcp/oauth2/token": {
      "post": {
        "operationId": "OAuth2Controller_token",
        "parameters": [
          {
            "in": "header",
            "name": "content-type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "application/x-www-form-urlencoded",
            "in": "header",
            "name": "Content-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponseDto"
                }
              }
            },
            "description": "Token issued successfully"
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Invalid client credentials"
          }
        },
        "summary": "OAuth2 token endpoint",
        "tags": [
          "mcp-oauth2"
        ]
      }
    },
    "/v1/mcp/openapi.json": {
      "delete": {
        "operationId": "McpOpenApiController_getOpenApiSchema_delete",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI schema"
          }
        },
        "summary": "Get OpenAPI schema for MCP endpoints (for OpenAI custom actions)",
        "tags": [
          "mcp"
        ]
      },
      "get": {
        "operationId": "McpOpenApiController_getOpenApiSchema_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI schema"
          }
        },
        "summary": "Get OpenAPI schema for MCP endpoints (for OpenAI custom actions)",
        "tags": [
          "mcp"
        ]
      },
      "head": {
        "operationId": "McpOpenApiController_getOpenApiSchema_head",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI schema"
          }
        },
        "summary": "Get OpenAPI schema for MCP endpoints (for OpenAI custom actions)",
        "tags": [
          "mcp"
        ]
      },
      "options": {
        "operationId": "McpOpenApiController_getOpenApiSchema_options",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI schema"
          }
        },
        "summary": "Get OpenAPI schema for MCP endpoints (for OpenAI custom actions)",
        "tags": [
          "mcp"
        ]
      },
      "patch": {
        "operationId": "McpOpenApiController_getOpenApiSchema_patch",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI schema"
          }
        },
        "summary": "Get OpenAPI schema for MCP endpoints (for OpenAI custom actions)",
        "tags": [
          "mcp"
        ]
      },
      "post": {
        "operationId": "McpOpenApiController_getOpenApiSchema_post",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI schema"
          }
        },
        "summary": "Get OpenAPI schema for MCP endpoints (for OpenAI custom actions)",
        "tags": [
          "mcp"
        ]
      },
      "put": {
        "operationId": "McpOpenApiController_getOpenApiSchema_put",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI schema"
          }
        },
        "summary": "Get OpenAPI schema for MCP endpoints (for OpenAI custom actions)",
        "tags": [
          "mcp"
        ]
      },
      "search": {
        "operationId": "McpOpenApiController_getOpenApiSchema_search",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OpenAPI schema"
          }
        },
        "summary": "Get OpenAPI schema for MCP endpoints (for OpenAI custom actions)",
        "tags": [
          "mcp"
        ]
      }
    },
    "/v1/mcp/tools": {
      "post": {
        "operationId": "McpGatewayController_executeTool",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key for POST/PATCH operations",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "Request ID for tracing",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "description": "Tenant ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-request-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpToolRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResponseDto"
                }
              }
            },
            "description": "Tool executed successfully"
          },
          "400": {
            "description": "Invalid tool request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient scope"
          },
          "429": {
            "description": "Rate limited"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute MCP tool",
        "tags": [
          "mcp"
        ]
      }
    },
    "/v1/mcp/tools/list": {
      "post": {
        "operationId": "McpGatewayController_listTools",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key for POST/PATCH operations",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Request-Id",
            "in": "header",
            "description": "Request ID for tracing",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "description": "Tenant ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tools listed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available MCP tools",
        "tags": [
          "mcp"
        ]
      }
    },
    "/v1/mcp/webhooks/callback-outcome": {
      "post": {
        "operationId": "WebhooksController_updateCallbackOutcome",
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Outcome updated successfully"
          }
        },
        "summary": "Update callback outcome",
        "tags": [
          "mcp-webhooks"
        ]
      }
    },
    "/v1/mcp/webhooks/missed-call-recovery": {
      "post": {
        "operationId": "WebhooksController_processMissedCallRecovery",
        "parameters": [
          {
            "in": "header",
            "name": "x-tenant-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch processed successfully"
          }
        },
        "summary": "Process missed call recovery batch",
        "tags": [
          "mcp-webhooks"
        ]
      }
    },
    "/v1/mcp/webhooks/stripe": {
      "post": {
        "operationId": "WebhooksController_handleStripeWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "stripe-signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Stripe webhook signature",
            "in": "header",
            "name": "Stripe-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle Stripe webhooks",
        "tags": [
          "mcp-webhooks"
        ]
      }
    },
    "/v1/mcp/webhooks/voiceagent": {
      "post": {
        "operationId": "WebhooksController_handleRetellWebhook",
        "parameters": [
          {
            "in": "header",
            "name": "x-voiceagent-signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Retell webhook signature",
            "in": "header",
            "name": "X-Retell-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle Retell AI webhooks",
        "tags": [
          "mcp-webhooks"
        ]
      }
    },
    "/v1/message-threads": {
      "get": {
        "operationId": "MessageThreadsController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "enum": [
                "SMS",
                "EMAIL",
                "WHATSAPP",
                "TELEGRAM",
                "WIDGET",
                "CALL"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "unreadOnly",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ticketId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "assignedToId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "starred",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "referenceType",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "referenceId",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message threads retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all message threads",
        "tags": [
          "inbox-message-threads"
        ]
      },
      "post": {
        "operationId": "MessageThreadsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMessageThreadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Message thread created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new message thread",
        "tags": [
          "inbox-message-threads"
        ]
      }
    },
    "/v1/message-threads/{id}": {
      "delete": {
        "operationId": "MessageThreadsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message thread closed successfully"
          },
          "404": {
            "description": "Message thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Close a message thread",
        "tags": [
          "inbox-message-threads"
        ]
      },
      "get": {
        "operationId": "MessageThreadsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message thread retrieved successfully"
          },
          "404": {
            "description": "Message thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a message thread by ID",
        "tags": [
          "inbox-message-threads"
        ]
      },
      "patch": {
        "operationId": "MessageThreadsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMessageThreadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Message thread updated successfully"
          },
          "404": {
            "description": "Message thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a message thread",
        "tags": [
          "inbox-message-threads"
        ]
      }
    },
    "/v1/message-threads/{id}/archive": {
      "post": {
        "operationId": "MessageThreadsController_archive",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message thread archived successfully"
          },
          "404": {
            "description": "Message thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Archive a message thread",
        "tags": [
          "inbox-message-threads"
        ]
      }
    },
    "/v1/message-threads/{id}/comments": {
      "get": {
        "operationId": "MessageThreadsController_getComments",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comments retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get comments for a thread",
        "tags": [
          "inbox-message-threads"
        ]
      },
      "post": {
        "operationId": "MessageThreadsController_addComment",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMessageCommentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Comment created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a new comment to a thread",
        "tags": [
          "inbox-message-threads"
        ]
      }
    },
    "/v1/message-threads/{id}/mark-read": {
      "post": {
        "operationId": "MessageThreadsController_markRead",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a message thread as read for the current user",
        "tags": [
          "inbox-message-threads"
        ]
      }
    },
    "/v1/message-threads/{id}/messages": {
      "get": {
        "operationId": "MessageThreadsController_getMessages",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Thread messages retrieved successfully"
          },
          "404": {
            "description": "Message thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get messages for a specific thread",
        "tags": [
          "inbox-message-threads"
        ]
      }
    },
    "/v1/message-threads/{threadId}/comments/{commentId}": {
      "delete": {
        "operationId": "MessageThreadsController_deleteComment",
        "parameters": [
          {
            "in": "path",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "commentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comment deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a thread comment",
        "tags": [
          "inbox-message-threads"
        ]
      }
    },
    "/v1/messages": {
      "get": {
        "operationId": "MessagesController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "threadId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Messages retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all messages",
        "tags": [
          "inbox-messages"
        ]
      },
      "post": {
        "operationId": "MessagesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Message created successfully"
          },
          "404": {
            "description": "Message thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new message",
        "tags": [
          "inbox-messages"
        ]
      }
    },
    "/v1/messages/scheduled": {
      "get": {
        "operationId": "MessagesController_listScheduled",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "sent",
                "cancelled"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled messages retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List scheduled messages",
        "tags": [
          "inbox-messages"
        ]
      }
    },
    "/v1/messages/scheduled/{id}": {
      "delete": {
        "operationId": "MessagesController_cancelScheduled",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Scheduled message cancelled"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel scheduled message",
        "tags": [
          "inbox-messages"
        ]
      },
      "get": {
        "operationId": "MessagesController_getScheduled",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled message retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get scheduled message by ID",
        "tags": [
          "inbox-messages"
        ]
      },
      "patch": {
        "operationId": "MessagesController_updateScheduled",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduledMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Scheduled message updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update scheduled message",
        "tags": [
          "inbox-messages"
        ]
      }
    },
    "/v1/messages/send": {
      "post": {
        "operationId": "MessagesController_sendMessage",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Message sent successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a new message",
        "tags": [
          "inbox-messages"
        ]
      }
    },
    "/v1/messages/thread/{threadId}": {
      "get": {
        "operationId": "MessagesController_findByThread",
        "parameters": [
          {
            "in": "path",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Thread messages retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get messages for a specific thread",
        "tags": [
          "inbox-messages"
        ]
      }
    },
    "/v1/messages/{id}": {
      "delete": {
        "operationId": "MessagesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message deleted successfully"
          },
          "404": {
            "description": "Message not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a message",
        "tags": [
          "inbox-messages"
        ]
      },
      "get": {
        "operationId": "MessagesController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message retrieved successfully"
          },
          "404": {
            "description": "Message not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a message by ID",
        "tags": [
          "inbox-messages"
        ]
      },
      "patch": {
        "operationId": "MessagesController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Message updated successfully"
          },
          "404": {
            "description": "Message not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a message",
        "tags": [
          "inbox-messages"
        ]
      }
    },
    "/v1/messaging/compliance/a2p/end-user-types": {
      "get": {
        "operationId": "MessagingComplianceController_listEndUserTypes",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Twilio TrustHub end-user types + required fields for this org shard",
        "tags": [
          "messaging/compliance"
        ]
      }
    },
    "/v1/messaging/compliance/a2p/policies": {
      "get": {
        "operationId": "MessagingComplianceController_listPolicies",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Twilio TrustHub policies for this org shard",
        "tags": [
          "messaging/compliance"
        ]
      }
    },
    "/v1/messaging/compliance/a2p/status": {
      "get": {
        "operationId": "MessagingComplianceController_status",
        "parameters": [
          {
            "in": "query",
            "name": "refresh",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get stored A2P brand/campaign status (optionally refresh from Twilio)",
        "tags": [
          "messaging/compliance"
        ]
      }
    },
    "/v1/messaging/compliance/a2p/submit-brand": {
      "post": {
        "operationId": "MessagingComplianceController_submitBrand",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsA2pSubmitBrandDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create TrustHub bundles + submit Brand Registration (A2P 10DLC) to Twilio",
        "tags": [
          "messaging/compliance"
        ]
      }
    },
    "/v1/messaging/compliance/a2p/submit-campaign": {
      "post": {
        "operationId": "MessagingComplianceController_submitCampaign",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsA2pSubmitCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Messaging Service + submit USA2P campaign to Twilio for this org",
        "tags": [
          "messaging/compliance"
        ]
      }
    },
    "/v1/messaging/compliance/prefill": {
      "get": {
        "description": "Returns best-effort org/contact/address data from existing account records, plus campaign templates and sample messages to speed up approval.",
        "operationId": "MessagingComplianceController_getPrefill",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsCompliancePrefillResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get suggested 10DLC (A2P) registration prefill + templates for the current org",
        "tags": [
          "messaging/compliance"
        ]
      }
    },
    "/v1/monitoring/queues": {
      "get": {
        "operationId": "QueueMonitoringController_getAllQueues",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get status of all queues",
        "tags": [
          "monitoring"
        ]
      }
    },
    "/v1/monitoring/queues/{queueName}": {
      "get": {
        "operationId": "QueueMonitoringController_getQueueStatus",
        "parameters": [
          {
            "in": "path",
            "name": "queueName",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get detailed status of a specific queue",
        "tags": [
          "monitoring"
        ]
      }
    },
    "/v1/monitoring/queues/{queueName}/clean": {
      "post": {
        "operationId": "QueueMonitoringController_cleanQueue",
        "parameters": [
          {
            "in": "path",
            "name": "queueName",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Clean completed and failed jobs",
        "tags": [
          "monitoring"
        ]
      }
    },
    "/v1/monitoring/queues/{queueName}/failed": {
      "get": {
        "operationId": "QueueMonitoringController_getFailedJobs",
        "parameters": [
          {
            "in": "path",
            "name": "queueName",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get failed jobs",
        "tags": [
          "monitoring"
        ]
      }
    },
    "/v1/monitoring/queues/{queueName}/pause": {
      "post": {
        "operationId": "QueueMonitoringController_pauseQueue",
        "parameters": [
          {
            "in": "path",
            "name": "queueName",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pause queue processing",
        "tags": [
          "monitoring"
        ]
      }
    },
    "/v1/monitoring/queues/{queueName}/resume": {
      "post": {
        "operationId": "QueueMonitoringController_resumeQueue",
        "parameters": [
          {
            "in": "path",
            "name": "queueName",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Resume queue processing",
        "tags": [
          "monitoring"
        ]
      }
    },
    "/v1/multi-account/agency": {
      "post": {
        "operationId": "MultiAccountDashboardController_createAgency",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgencyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "createdAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Agency created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new agency organization",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/agency/{agencyId}/clients": {
      "post": {
        "operationId": "MultiAccountDashboardController_createClient",
        "parameters": [
          {
            "in": "path",
            "name": "agencyId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "clientOnboardingStatus": {
                      "type": "string"
                    },
                    "createdAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "parentOrganizationId": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Client created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new client organization under an agency",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/billing-analytics/{organizationId}": {
      "get": {
        "operationId": "MultiAccountDashboardController_getBillingAnalytics",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "childOrgs": {
                      "type": "array"
                    },
                    "currentOrg": {
                      "type": "object"
                    },
                    "generatedAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "spendingTrends": {
                      "type": "object"
                    },
                    "timeRange": {
                      "type": "string"
                    },
                    "totals": {
                      "type": "object"
                    },
                    "usagePatterns": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Billing analytics with spending trends and usage patterns"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get comprehensive billing analytics for multi-account dashboard",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/billing-summary/{organizationId}": {
      "get": {
        "operationId": "MultiAccountDashboardController_getBillingSummary",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "childOrgs": {
                      "items": {
                        "properties": {
                          "creditBalance": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "onboardingStatus": {
                            "type": "string"
                          },
                          "subscription": {
                            "nullable": true,
                            "type": "object"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "currentOrg": {
                      "properties": {
                        "creditBalance": {
                          "type": "number"
                        },
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "subscription": {
                          "nullable": true,
                          "type": "object"
                        },
                        "type": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "totals": {
                      "properties": {
                        "activeClients": {
                          "type": "number"
                        },
                        "totalClients": {
                          "type": "number"
                        },
                        "totalCreditBalance": {
                          "type": "number"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Billing summary with current org and child orgs"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get billing summary for multi-account dashboard",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/dashboard-overview": {
      "get": {
        "operationId": "MultiAccountDashboardController_getDashboardOverview",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "analytics": {
                      "properties": {
                        "activeUsers": {
                          "type": "number"
                        },
                        "monthlyGrowth": {
                          "type": "number"
                        },
                        "totalOrganizations": {
                          "type": "number"
                        },
                        "totalRevenue": {
                          "type": "number"
                        },
                        "totalUsers": {
                          "type": "number"
                        }
                      },
                      "type": "object"
                    },
                    "billing": {
                      "properties": {
                        "childOrgs": {
                          "items": {
                            "properties": {
                              "creditBalance": {
                                "type": "number"
                              },
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "onboardingStatus": {
                                "type": "string"
                              },
                              "subscription": {
                                "nullable": true,
                                "type": "object"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "currentOrg": {
                          "properties": {
                            "creditBalance": {
                              "type": "number"
                            },
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "subscription": {
                              "nullable": true,
                              "type": "object"
                            },
                            "type": {
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "totals": {
                          "properties": {
                            "activeClients": {
                              "type": "number"
                            },
                            "totalClients": {
                              "type": "number"
                            },
                            "totalCreditBalance": {
                              "type": "number"
                            }
                          },
                          "type": "object"
                        }
                      },
                      "type": "object"
                    },
                    "organizations": {
                      "items": {
                        "properties": {
                          "createdAt": {
                            "format": "date-time",
                            "nullable": true,
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "managedByAgency": {
                            "type": "boolean"
                          },
                          "name": {
                            "type": "string"
                          },
                          "onboardingStatus": {
                            "nullable": true,
                            "type": "string"
                          },
                          "parentOrganizationId": {
                            "nullable": true,
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "users": {
                      "properties": {
                        "currentOrganizationId": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Complete dashboard overview with organizations, billing, and analytics"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get comprehensive dashboard overview for multi-account management",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/hierarchy/{organizationId}": {
      "get": {
        "operationId": "MultiAccountDashboardController_getOrganizationHierarchy",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "children": {
                      "items": {
                        "properties": {
                          "activeUsers": {
                            "type": "number"
                          },
                          "clientOnboardingStatus": {
                            "type": "string"
                          },
                          "createdAt": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "creditBalance": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "userCount": {
                            "type": "number"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "current": {
                      "properties": {
                        "clientOnboardingStatus": {
                          "nullable": true,
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "managedByAgency": {
                          "type": "boolean"
                        },
                        "name": {
                          "type": "string"
                        },
                        "parentOrganizationId": {
                          "nullable": true,
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "parent": {
                      "nullable": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Organization hierarchy with parent and children"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get organization hierarchy for dashboard",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/organizations": {
      "get": {
        "operationId": "MultiAccountDashboardController_getAccessibleOrganizations",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "properties": {
                      "createdAt": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "isPrimary": {
                        "type": "boolean"
                      },
                      "managedByAgency": {
                        "type": "boolean"
                      },
                      "name": {
                        "type": "string"
                      },
                      "onboardingStatus": {
                        "nullable": true,
                        "type": "string"
                      },
                      "parentOrganizationId": {
                        "nullable": true,
                        "type": "string"
                      },
                      "role": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "AGENCY",
                          "CLIENT",
                          "STANDALONE"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "List of accessible organizations"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all accessible organizations for the user",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/spending-breakdown/{organizationId}": {
      "get": {
        "operationId": "MultiAccountDashboardController_getSpendingBreakdown",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "childOrgs": {
                      "type": "array"
                    },
                    "currentOrg": {
                      "type": "object"
                    },
                    "totals": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Spending breakdown with direct payments and usage costs"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get spending breakdown by organization",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/switch": {
      "post": {
        "operationId": "MultiAccountDashboardController_switchOrganization",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchOrganizationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "isPrimary": {
                      "type": "boolean"
                    },
                    "organizationId": {
                      "type": "string"
                    },
                    "organizationName": {
                      "type": "string"
                    },
                    "organizationType": {
                      "type": "string"
                    },
                    "userRole": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Successfully switched organization context"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Switch user context to a different organization",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/multi-account/usage-analytics/{organizationId}": {
      "get": {
        "operationId": "MultiAccountDashboardController_getUsageAnalytics",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "childOrgs": {
                      "type": "array"
                    },
                    "currentOrg": {
                      "type": "object"
                    },
                    "totals": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Usage analytics grouped by type and organization"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get usage analytics by organization",
        "tags": [
          "Multi-Account Dashboard"
        ]
      }
    },
    "/v1/notifications": {
      "get": {
        "operationId": "NotificationsController_listNotifications",
        "parameters": [
          {
            "in": "query",
            "name": "unread",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "properties": {
                        "limit": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total",
                        "page",
                        "limit",
                        "totalPages"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Notifications retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List notifications for the current user",
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/mark-all-read": {
      "post": {
        "operationId": "NotificationsController_markAllRead",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notifications marked as read successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark all current-user notifications as read",
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/preferences": {
      "get": {
        "operationId": "NotificationsController_getPreferences",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Notification preferences fetched successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get user notification preferences",
        "tags": [
          "notifications"
        ]
      },
      "put": {
        "operationId": "NotificationsController_updatePreferences",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNotificationPreferencesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Notification preferences updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update user notification preferences",
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/notifications/test": {
      "post": {
        "operationId": "NotificationsController_sendTestNotification",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestNotificationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Test notification sent successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a test notification to current user",
        "tags": [
          "notifications"
        ]
      }
    },
    "/v1/oauth2/register": {
      "post": {
        "operationId": "OAuth2RegistrationController_registerClient",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterClientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Client registered successfully"
          },
          "400": {
            "description": "Invalid registration request"
          },
          "401": {
            "description": "Invalid initial access token"
          }
        },
        "summary": "RFC 7591 Dynamic Client Registration endpoint",
        "tags": [
          "oauth2-registration"
        ]
      }
    },
    "/v1/oauth2/register/{clientId}": {
      "post": {
        "operationId": "OAuth2RegistrationController_updateClient",
        "parameters": [
          {
            "in": "path",
            "name": "clientId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterClientDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Update registered OAuth client",
        "tags": [
          "oauth2-registration"
        ]
      }
    },
    "/v1/onboarding/activation": {
      "get": {
        "operationId": "OnboardingController_getActivation",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivationStatusDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Business OS activation status (milestones + blockers)",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/activation/refresh": {
      "post": {
        "operationId": "OnboardingController_refreshActivation",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivationStatusDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Refresh onboarding checkboxes from real activation state (authoritative)",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/complete": {
      "post": {
        "operationId": "OnboardingController_completeOnboarding",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteOnboardingDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Onboarding marked as complete"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Complete onboarding by selecting services",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/magic": {
      "post": {
        "operationId": "MagicOnboardingController_startMagic",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartMagicDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start magic onboarding — auto-configures entire workspace from website URL",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/agent/auto-persona": {
      "post": {
        "operationId": "MagicOnboardingController_autoConfigureAgent",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Auto-configure AI agent persona from brand intelligence",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/audit/score": {
      "get": {
        "operationId": "MagicOnboardingController_getAuditScore",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get business audit score with quick wins",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/brand": {
      "get": {
        "operationId": "MagicOnboardingController_getBrand",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get cached brand intelligence",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/brand-extract": {
      "post": {
        "operationId": "MagicOnboardingController_extractBrand",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartMagicDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Extract brand intelligence from website (standalone)",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/calendar/auto-configure": {
      "post": {
        "operationId": "MagicOnboardingController_autoConfigureCalendar",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Auto-configure calendar services from scraped data",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/compliance/enhanced-prefill": {
      "get": {
        "operationId": "MagicOnboardingController_enhancedPrefill",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Enhanced 10DLC prefill with brand intelligence",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/kb/auto-seed": {
      "post": {
        "operationId": "MagicOnboardingController_autoSeedKb",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartMagicDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Auto-seed knowledge base from website crawl",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/telemetry": {
      "get": {
        "operationId": "MagicOnboardingController_getTelemetry",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get magic onboarding telemetry summary",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/widget/auto-configure": {
      "post": {
        "operationId": "MagicOnboardingController_autoConfigureWidget",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Auto-configure chat widget from brand intelligence",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/{jobId}/results": {
      "get": {
        "operationId": "MagicOnboardingController_getMagicResults",
        "parameters": [
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get magic onboarding results",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/{jobId}/retry/{phase}": {
      "post": {
        "operationId": "MagicOnboardingController_retryPhase",
        "parameters": [
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "phase",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry a single phase for an existing magic onboarding run",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/magic/{jobId}/status": {
      "get": {
        "operationId": "MagicOnboardingController_streamMagicStatus",
        "parameters": [
          {
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Stream magic onboarding progress via SSE",
        "tags": [
          "magic-onboarding"
        ]
      }
    },
    "/v1/onboarding/phase1/accept-draft": {
      "post": {
        "description": "Applies the current onboarding draft to core organization setup (profile + services), and updates onboarding progress.",
        "operationId": "OnboardingController_acceptPhase1Draft",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingPhase1AcceptDraftDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Draft accepted and applied"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Phase 1: One-click accept onboarding draft",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/phase1/chat": {
      "post": {
        "description": "Processes one Emma onboarding chat turn, updates draft fields from natural language or structured patch, and returns next best onboarding question.",
        "operationId": "OnboardingController_chatPhase1",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingPhase1ChatDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Chat turn processed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Phase 1: Emma onboarding chat turn",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/phase1/draft": {
      "get": {
        "description": "Returns the current Phase 1 onboarding draft, confidence map, pending clarification questions, and readiness to accept.",
        "operationId": "OnboardingController_getPhase1Draft",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Phase 1 draft returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Phase 1: Get onboarding draft + confidence questions",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/phase1/ingest-url": {
      "post": {
        "description": "Ingests website/GBP URLs, extracts business data, merges into onboarding draft, and returns confidence-based follow-up questions.",
        "operationId": "OnboardingController_ingestPhase1Urls",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingPhase1IngestUrlDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "URL ingestion completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Phase 1: Ingest URL(s) into onboarding draft",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/progress": {
      "delete": {
        "operationId": "OnboardingController_deleteOnboardingProgress",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Onboarding progress reset successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reset onboarding progress",
        "tags": [
          "onboarding"
        ]
      },
      "get": {
        "operationId": "OnboardingController_getOnboardingProgress",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Onboarding progress retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get onboarding progress",
        "tags": [
          "onboarding"
        ]
      },
      "patch": {
        "operationId": "OnboardingController_updateOnboardingProgress",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOnboardingProgressDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Onboarding progress updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update onboarding progress fields",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/progress/phase/{phase}/complete": {
      "post": {
        "operationId": "OnboardingController_completeOnboardingPhase",
        "parameters": [
          {
            "in": "path",
            "name": "phase",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Onboarding phase completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark onboarding phase as complete",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/reset": {
      "post": {
        "operationId": "OnboardingController_resetOnboarding",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Onboarding reset successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reset onboarding progress",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/scrape-gbp": {
      "post": {
        "operationId": "OnboardingController_scrapeGoogleBusinessProfile",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrapeGbpDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Google Business Profile scraped successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Scrape Google Business Profile for onboarding data",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/scrape-website": {
      "post": {
        "operationId": "OnboardingController_scrapeWebsite",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrapeWebsiteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Website scraped successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Scrape a business website for onboarding data",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/spec": {
      "get": {
        "operationId": "OnboardingController_getOnboardingSpec",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Onboarding specification retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get canonical onboarding checklist specification",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/status": {
      "get": {
        "description": "Returns the current onboarding state and any outstanding setup tasks for the organization.",
        "operationId": "CustomerOnboardingController_getOnboardingStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Onboarding status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer onboarding status",
        "tags": [
          "customer-onboarding"
        ]
      },
      "post": {
        "description": "Allows manual override of onboarding status to align with external progress.",
        "operationId": "CustomerOnboardingController_updateOnboardingStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Onboarding status updated successfully"
          },
          "400": {
            "description": "Invalid status payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update customer onboarding status",
        "tags": [
          "customer-onboarding"
        ]
      }
    },
    "/v1/onboarding/steps/{stepId}/complete": {
      "post": {
        "operationId": "OnboardingController_completeOnboardingStep",
        "parameters": [
          {
            "in": "path",
            "name": "stepId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Onboarding step completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Complete an onboarding step",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/steps/{stepId}/skip": {
      "post": {
        "operationId": "OnboardingController_skipOnboardingStep",
        "parameters": [
          {
            "in": "path",
            "name": "stepId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Onboarding step skipped successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Skip an onboarding step",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/onboarding/voiceagent/delete": {
      "post": {
        "description": "Removes the provisioned voice agent, associated phone numbers, and linked AI assets.",
        "operationId": "CustomerOnboardingController_deleteVoiceAgent",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Voice agent deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete voice agent and cleanup",
        "tags": [
          "customer-onboarding"
        ]
      }
    },
    "/v1/onboarding/welcome": {
      "get": {
        "operationId": "OnboardingController_getWelcomeInfo",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Welcome information retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get welcome information for new organization",
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/organization": {
      "get": {
        "operationId": "OrganizationController_getOrganization",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Organization details retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get organization details",
        "tags": [
          "organization"
        ]
      },
      "patch": {
        "operationId": "OrganizationController_updateOrganization",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Organization updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update organization settings",
        "tags": [
          "organization"
        ]
      }
    },
    "/v1/organization/terminology": {
      "patch": {
        "operationId": "OrganizationController_updateTerminology",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTerminologyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Terminology updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update custom terminology",
        "tags": [
          "organization"
        ]
      }
    },
    "/v1/organizations": {
      "get": {
        "operationId": "OrganizationsController_findAll",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OrganizationResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Organizations retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all organizations for the current user",
        "tags": [
          "Organizations"
        ]
      },
      "post": {
        "operationId": "OrganizationsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponseDto"
                }
              }
            },
            "description": "Organization created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/me": {
      "get": {
        "operationId": "OrganizationsController_getMe",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Organization details retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current user's organization details",
        "tags": [
          "Organizations"
        ]
      },
      "patch": {
        "operationId": "OrganizationsController_updateMe",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Organization updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update current user's organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/me/data-residency": {
      "get": {
        "description": "Returns the active tier plus the resolved per-subsystem regions (LLM, STT, TTS, recording bucket, vector store). Env overrides applied.",
        "operationId": "DataResidencyController_getResidency",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Resolved residency config"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Read the caller organization's current data-residency config",
        "tags": [
          "data-residency"
        ]
      },
      "put": {
        "description": "Flips the tier for all *new* data written after this call. Existing recordings, embeddings, and call rows are NOT migrated automatically — that is a separate operator-driven job. Owner role required.",
        "operationId": "DataResidencyController_updateResidency",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Residency updated"
          },
          "400": {
            "description": "Invalid tier or missing acknowledgement"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update the caller organization's data-residency tier",
        "tags": [
          "data-residency"
        ]
      }
    },
    "/v1/organizations/me/data-residency/audit": {
      "get": {
        "description": "For each subsystem (STT, TTS, LLM, recording, vector) returns what the tenant is actually configured to use given the tier allowlist + deployed env. Powers the admin UI \"is this tenant truly EU-compliant?\" check.",
        "operationId": "DataResidencyController_getAudit",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Audit payload"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Per-subsystem effective routing audit",
        "tags": [
          "data-residency"
        ]
      }
    },
    "/v1/organizations/me/profile": {
      "get": {
        "operationId": "OrganizationsController_getMeProfile",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Organization profile retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current organization profile for instant-site autofill",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/users": {
      "get": {
        "operationId": "OrganizationsController_getUsers",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Users retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all users in the current user's organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}": {
      "delete": {
        "operationId": "OrganizationsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an organization",
        "tags": [
          "Organizations"
        ]
      },
      "get": {
        "operationId": "OrganizationsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponseDto"
                }
              }
            },
            "description": "Organization retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a specific organization by ID",
        "tags": [
          "Organizations"
        ]
      },
      "patch": {
        "operationId": "OrganizationsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponseDto"
                }
              }
            },
            "description": "Organization updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}/industry-content": {
      "get": {
        "operationId": "OrganizationsController_getIndustryContent",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Industry content retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all industry-specific content for organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}/mcp/config": {
      "get": {
        "operationId": "OrganizationsController_getMCPConfig",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MCP configuration retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get MCP configuration for organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}/mcp/enable": {
      "post": {
        "operationId": "OrganizationsController_enableMCP",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MCP enabled successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Enable MCP for organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}/mcp/logs": {
      "get": {
        "operationId": "OrganizationsController_getMCPLogs",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of logs to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MCP logs retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get MCP usage logs for organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}/mcp/test": {
      "post": {
        "operationId": "OrganizationsController_testMCP",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "MCP test completed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test MCP tools for organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}/members": {
      "get": {
        "operationId": "OrganizationsController_getMembers",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Members retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get organization members",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}/settings": {
      "get": {
        "operationId": "OrganizationsController_getSettings",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Settings retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get organization settings",
        "tags": [
          "Organizations"
        ]
      },
      "patch": {
        "operationId": "OrganizationsController_updateSettings",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponseDto"
                }
              }
            },
            "description": "Settings updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update organization settings",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{id}/switch": {
      "post": {
        "operationId": "OrganizationsController_switchOrganization",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization switched successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Switch to a different organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/organizations/{orgId}/workflow-settings": {
      "get": {
        "operationId": "OrganizationsController_getWorkflowSettings",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowSettingsDto"
                }
              }
            },
            "description": "Workflow settings retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow template settings for organization",
        "tags": [
          "Organizations"
        ]
      },
      "put": {
        "operationId": "OrganizationsController_updateWorkflowSettings",
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowSettingsDto"
                }
              }
            },
            "description": "Workflow settings updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update workflow template settings for organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/v1/payments/analytics": {
      "get": {
        "operationId": "PaymentsController_getPaymentAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get payment analytics",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/analytics/forecast": {
      "get": {
        "operationId": "PaymentsController_getRevenueForecast",
        "parameters": [
          {
            "in": "query",
            "name": "months",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Forecast retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get revenue forecast",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/analytics/trends": {
      "get": {
        "operationId": "PaymentsController_getInvoiceTrends",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trends retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice trends",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/account": {
      "delete": {
        "operationId": "PaymentsController_disconnectConnectAccount",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Connect account disconnected successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Disconnect Stripe Connect account",
        "tags": [
          "payments"
        ]
      },
      "get": {
        "operationId": "PaymentsController_getConnectAccount",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Account retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Stripe Connect account for organization",
        "tags": [
          "payments"
        ]
      },
      "post": {
        "operationId": "PaymentsController_createConnectAccount",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnectAccountDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Connect account created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Stripe Connect account",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/account-link": {
      "post": {
        "operationId": "PaymentsController_createAccountLinkLegacy",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Account link created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Stripe Connect account link (legacy route)",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/account-status": {
      "get": {
        "operationId": "PaymentsController_getConnectAccountStatusAlias",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Stripe Connect account status (wiring guide route)",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/account/link": {
      "post": {
        "operationId": "PaymentsController_createAccountLink",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Account link created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Stripe Connect account link",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/account/status": {
      "get": {
        "operationId": "PaymentsController_getConnectAccountStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Account status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Stripe Connect account status for current organization",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/account/{accountId}({0}.+)": {
      "get": {
        "operationId": "PaymentsController_getAccountStatus",
        "parameters": [
          {
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Stripe Connect account status",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/balance": {
      "get": {
        "operationId": "PaymentsController_getConnectedBalance",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Balance retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get connected account balance",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/create-account": {
      "post": {
        "operationId": "PaymentsController_createConnectAccountAlias",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnectAccountDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Stripe Connect account (wiring guide route)",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/create-account-link": {
      "post": {
        "operationId": "PaymentsController_createAccountLinkAlias",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Stripe Connect account link (wiring guide route)",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/create-payment-link": {
      "post": {
        "operationId": "PaymentsController_createConnectPaymentLinkAlias",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a payment link for a customer (wiring guide route)",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/payment-links": {
      "post": {
        "operationId": "PaymentsController_createConnectPaymentLink",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Payment link created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create payment link routed through connected account",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/connect/payouts": {
      "get": {
        "operationId": "PaymentsController_listPayouts",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payouts listed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List payouts for connected account",
        "tags": [
          "payments"
        ]
      },
      "post": {
        "operationId": "PaymentsController_createPayout",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePayoutDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Payout created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a payout to the connected account",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/auto-reload": {
      "post": {
        "operationId": "PaymentsController_configureAutoReload",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Auto-reload configured successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Configure auto-reload settings",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/balance": {
      "get": {
        "operationId": "PaymentsController_getCreditBalance",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credit balance retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Alias: get credit balance",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/check-balance": {
      "post": {
        "operationId": "PaymentsController_checkCreditBalance",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckCreditBalanceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Credit balance check completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check if organization has enough credits for an action",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/check-reload": {
      "post": {
        "operationId": "PaymentsController_checkAutoReload",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Auto-reload check completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check and process auto-reload if needed",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/checkout": {
      "post": {
        "operationId": "PaymentsController_checkoutCredits",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseCreditsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Checkout session created for credit purchase"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create credit checkout session (alias route)",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/packages": {
      "get": {
        "operationId": "PaymentsController_getCreditPackages",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credit packages retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get available credit packages",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/purchase": {
      "post": {
        "operationId": "PaymentsController_purchaseCredits",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseCreditsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Payment intent created for credit purchase"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Purchase credits",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/transactions": {
      "get": {
        "operationId": "PaymentsController_getCreditTransactions",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get credit transaction history (paged)",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/credits/wallet": {
      "get": {
        "operationId": "PaymentsController_getCreditWallet",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credit wallet retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get credit wallet balance and summary",
        "tags": [
          "payments"
        ]
      },
      "options": {
        "operationId": "PaymentsController_handleCreditsWalletOptions",
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/customers": {
      "post": {
        "operationId": "PaymentsController_createCustomer",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Customer created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Stripe customer",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/customers/{id}": {
      "get": {
        "operationId": "PaymentsController_getCustomer",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Customer retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Stripe customer",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoice-preview": {
      "get": {
        "operationId": "PaymentsController_getInvoicePreview",
        "parameters": [
          {
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preview data retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice preview with sample data",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoice-templates": {
      "get": {
        "operationId": "PaymentsController_getInvoiceTemplates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Templates retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get available invoice templates",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices": {
      "get": {
        "operationId": "PaymentsController_getInvoices",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoices retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all invoices",
        "tags": [
          "payments"
        ]
      },
      "post": {
        "operationId": "PaymentsController_createInvoice",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Invoice created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create invoice",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/branding": {
      "get": {
        "operationId": "PaymentsController_getInvoiceBranding",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Branding settings retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice branding settings",
        "tags": [
          "payments"
        ]
      },
      "patch": {
        "operationId": "PaymentsController_updateInvoiceBranding",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceBrandingDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Branding settings updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update invoice branding settings",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/builder": {
      "post": {
        "operationId": "PaymentsController_createInvoiceBuilder",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Invoice created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create invoice using builder (free feature)",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}": {
      "delete": {
        "operationId": "PaymentsController_deleteInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete invoice",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}({0}.+)": {
      "get": {
        "operationId": "PaymentsController_getInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice retrieved successfully"
          },
          "404": {
            "description": "Invoice not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice by ID",
        "tags": [
          "payments"
        ]
      },
      "patch": {
        "operationId": "PaymentsController_updateInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Invoice updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update invoice",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}/finalize": {
      "post": {
        "operationId": "PaymentsController_finalizeInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice finalized successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Finalize invoice",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}/mark-paid": {
      "post": {
        "operationId": "PaymentsController_markInvoicePaid",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice marked as paid successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Manually mark invoice as paid",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}/payment-link": {
      "post": {
        "operationId": "PaymentsController_generatePaymentLink",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment link generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate payment link for invoice",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}/payment-status": {
      "get": {
        "operationId": "PaymentsController_getInvoicePaymentStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice payment status",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}/pdf": {
      "get": {
        "operationId": "PaymentsController_generateInvoicePdf",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate invoice PDF",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}/send": {
      "post": {
        "operationId": "PaymentsController_sendInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice sent successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send invoice",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/invoices/{id}/send-email": {
      "post": {
        "operationId": "PaymentsController_sendInvoiceEmail",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice email sent successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send invoice via email",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/payment-links": {
      "post": {
        "operationId": "PaymentsController_createPaymentLink",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Payment link created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create payment link",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/payment-methods": {
      "get": {
        "operationId": "PaymentsController_listPaymentMethods",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Payment methods retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List saved payment methods for auto-reload",
        "tags": [
          "payments"
        ]
      },
      "post": {
        "operationId": "PaymentsController_savePaymentMethod",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentMethodDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Payment method saved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save payment method for auto-reload",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/payment-methods/setup-intent": {
      "post": {
        "operationId": "PaymentsController_createSetupIntent",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Setup intent created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create setup intent for saving payment method",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/payment-methods/{id}/default": {
      "post": {
        "operationId": "PaymentsController_setDefaultPaymentMethod",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Default payment method updated"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a payment method as default for auto-reload",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/refunds": {
      "post": {
        "operationId": "PaymentsController_createRefund",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Refund created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create refund",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/subscriptions": {
      "delete": {
        "operationId": "PaymentsController_cancelSubscription",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Subscription cancelled successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel subscription",
        "tags": [
          "payments"
        ]
      },
      "post": {
        "operationId": "PaymentsController_createSubscription",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Subscription created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create subscription",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/subscriptions/billing-portal": {
      "post": {
        "operationId": "PaymentsController_getBillingPortalUrl",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Billing portal URL generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get billing portal URL",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/subscriptions/current": {
      "get": {
        "operationId": "PaymentsController_getCurrentSubscription",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Current subscription retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current subscription",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/subscriptions/plans": {
      "get": {
        "operationId": "PaymentsController_getSubscriptionPlans",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Subscription plans retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get available subscription plans",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/subscriptions/usage": {
      "get": {
        "operationId": "PaymentsController_getSubscriptionUsage",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription usage retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get subscription usage analytics",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/subscriptions/{planId}": {
      "put": {
        "operationId": "PaymentsController_updateSubscription",
        "parameters": [
          {
            "in": "path",
            "name": "planId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update subscription plan",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/upload/logo": {
      "post": {
        "operationId": "PaymentsController_uploadLogo",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Logo uploaded successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload logo for invoice branding",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/webhook": {
      "post": {
        "operationId": "PaymentsController_handleWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle Stripe Connect webhooks",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/webhooks/credits/purchase": {
      "post": {
        "operationId": "PaymentsController_handleCreditPurchaseWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credit purchase processed"
          }
        },
        "summary": "Handle credit purchase payment confirmation",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/payments/webhooks/stripe": {
      "post": {
        "operationId": "PaymentsController_handleStripeWebhook",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle Stripe webhooks",
        "tags": [
          "payments"
        ]
      }
    },
    "/v1/phone-numbers": {
      "get": {
        "operationId": "PhoneNumbersAliasController_listPurchased",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List purchased voice phone numbers (alias)",
        "tags": [
          "phone-numbers"
        ]
      },
      "post": {
        "operationId": "PhoneNumbersAliasController_procure",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcurePhoneNumberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Purchase a phone number (alias)",
        "tags": [
          "phone-numbers"
        ]
      }
    },
    "/v1/phone-numbers/available": {
      "get": {
        "operationId": "PhoneNumbersAliasController_listAvailable",
        "parameters": [
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "areaCode",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "match",
            "required": false,
            "schema": {
              "enum": [
                "startsWith",
                "endsWith",
                "contains"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search available phone numbers (alias)",
        "tags": [
          "phone-numbers"
        ]
      }
    },
    "/v1/phone-numbers/{id}": {
      "delete": {
        "operationId": "PhoneNumbersAliasController_release",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Release a purchased phone number (alias)",
        "tags": [
          "phone-numbers"
        ]
      }
    },
    "/v1/phone-numbers/{id}/assign": {
      "put": {
        "operationId": "PhoneNumbersAliasController_assign",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignPhoneNumberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Assign a purchased number to an agent (alias)",
        "tags": [
          "phone-numbers"
        ]
      }
    },
    "/v1/pipelines": {
      "get": {
        "description": "Returns every pipeline for the current organization. Use includeStages=true to embed stage-level deal counts and totalValue aggregates.",
        "operationId": "PipelinesController_findAll",
        "parameters": [
          {
            "description": "Set to \"true\" to include each pipeline's stages, deal counts, aggregated stage totals, and pipeline-level totalValue. Defaults to false.",
            "in": "query",
            "name": "includeStages",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pipelines retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all pipelines",
        "tags": [
          "crm-pipelines"
        ]
      },
      "post": {
        "description": "Creates a pipeline for the current organization. When no stages are supplied, a default \"New\" stage is added automatically with probability 0.",
        "operationId": "PipelinesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePipelineDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Pipeline created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new pipeline",
        "tags": [
          "crm-pipelines"
        ]
      }
    },
    "/v1/pipelines/{id}": {
      "delete": {
        "description": "Deletes a pipeline that has no deals associated with it. Pipelines containing deals must be reassigned before deletion.",
        "operationId": "PipelinesController_remove",
        "parameters": [
          {
            "description": "Pipeline identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pipeline deleted successfully"
          },
          "400": {
            "description": "Cannot delete pipeline with existing deals"
          },
          "404": {
            "description": "Pipeline not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a pipeline",
        "tags": [
          "crm-pipelines"
        ]
      },
      "get": {
        "description": "Retrieves a single pipeline, including its ordered stages, deal counts, and aggregated totalValue.",
        "operationId": "PipelinesController_findOne",
        "parameters": [
          {
            "description": "Pipeline identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pipeline retrieved successfully"
          },
          "404": {
            "description": "Pipeline not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a pipeline by ID",
        "tags": [
          "crm-pipelines"
        ]
      },
      "patch": {
        "description": "Updates pipeline attributes and optionally its default designation. Stage updates should be managed through the stages API.",
        "operationId": "PipelinesController_update",
        "parameters": [
          {
            "description": "Pipeline identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePipelineDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Pipeline updated successfully"
          },
          "404": {
            "description": "Pipeline not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a pipeline",
        "tags": [
          "crm-pipelines"
        ]
      }
    },
    "/v1/pipelines/{id}/set-default": {
      "post": {
        "description": "Marks the selected pipeline as the organization's default and automatically clears the default flag from all other pipelines.",
        "operationId": "PipelinesController_setAsDefault",
        "parameters": [
          {
            "description": "Pipeline identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pipeline set as default successfully"
          },
          "404": {
            "description": "Pipeline not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set pipeline as default",
        "tags": [
          "crm-pipelines"
        ]
      }
    },
    "/v1/pipelines/{id}/stages": {
      "get": {
        "description": "Returns the ordered stages for a pipeline including deal counts, totalValue metrics, and lightweight deal details (id, title, amount, contact names, and company name).",
        "operationId": "PipelinesController_getStages",
        "parameters": [
          {
            "description": "Pipeline identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pipeline stages retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get pipeline stages with deal counts",
        "tags": [
          "crm-pipelines"
        ]
      }
    },
    "/v1/platform/agents": {
      "get": {
        "operationId": "PlatformAgentsController_getAgents",
        "parameters": [
          {
            "in": "query",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "PlatformAgentsController_createAgent",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/agents/{id}": {
      "delete": {
        "operationId": "PlatformAgentsController_deleteAgent",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "get": {
        "operationId": "PlatformAgentsController_getAgent",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "PlatformAgentsController_updateAgent",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/agents/{id}/execute": {
      "post": {
        "operationId": "PlatformAgentsController_executeAgent",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/analytics/dashboard": {
      "get": {
        "operationId": "PlatformAnalyticsController_getDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/analytics/usage": {
      "get": {
        "operationId": "PlatformAnalyticsController_getUsageAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/auth/authenticate": {
      "post": {
        "operationId": "PlatformAuthController_authenticate",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/auth/keys": {
      "get": {
        "operationId": "PlatformAuthController_getApiKeys",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "PlatformAuthController_createApiKey",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/auth/keys/{keyId}": {
      "delete": {
        "operationId": "PlatformAuthController_revokeApiKey",
        "parameters": [
          {
            "in": "path",
            "name": "keyId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "PlatformAuthController_updateApiKey",
        "parameters": [
          {
            "in": "path",
            "name": "keyId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/billing/dashboard": {
      "get": {
        "operationId": "PlatformBillingController_getBillingDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/billing/invoice/current": {
      "get": {
        "operationId": "PlatformBillingController_getCurrentInvoice",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/billing/tiers": {
      "get": {
        "operationId": "PlatformBillingController_getAvailableTiers",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/billing/upgrade": {
      "post": {
        "operationId": "PlatformBillingController_upgradeTier",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/embeddings/batch/contacts": {
      "post": {
        "operationId": "PlatformEmbeddingsController_batchEmbedContacts",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/embeddings/batch/knowledge-base": {
      "post": {
        "operationId": "PlatformEmbeddingsController_batchEmbedKnowledgeBase",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/embeddings/generate": {
      "post": {
        "operationId": "PlatformEmbeddingsController_generateEmbedding",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/embeddings/search/contacts": {
      "post": {
        "operationId": "PlatformEmbeddingsController_searchContacts",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/embeddings/search/knowledge-base": {
      "post": {
        "operationId": "PlatformEmbeddingsController_searchKnowledgeBase",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations": {
      "get": {
        "operationId": "PlatformIntegrationsController_getIntegrations",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/active": {
      "get": {
        "operationId": "PlatformIntegrationsController_getActiveIntegrations",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/available": {
      "get": {
        "operationId": "PlatformIntegrationsController_getAvailableCRMs",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/sync-all": {
      "post": {
        "operationId": "PlatformIntegrationsController_syncAllIntegrations",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/{crmType}": {
      "delete": {
        "operationId": "PlatformIntegrationsController_deleteIntegration",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/{crmType}/connect": {
      "post": {
        "operationId": "PlatformIntegrationsController_createIntegration",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/{crmType}/contacts": {
      "get": {
        "operationId": "PlatformIntegrationsController_getContacts",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "PlatformIntegrationsController_createContact",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/{crmType}/deals": {
      "get": {
        "operationId": "PlatformIntegrationsController_getDeals",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "PlatformIntegrationsController_createDeal",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/{crmType}/status": {
      "get": {
        "operationId": "PlatformIntegrationsController_getIntegrationStatus",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/integrations/{crmType}/sync": {
      "post": {
        "operationId": "PlatformIntegrationsController_syncData",
        "parameters": [
          {
            "in": "path",
            "name": "crmType",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/workflows": {
      "get": {
        "operationId": "PlatformWorkflowsController_getWorkflows",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "PlatformWorkflowsController_createWorkflow",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/platform/workflows/{id}/execute": {
      "post": {
        "operationId": "PlatformWorkflowsController_executeWorkflow",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/portal/activity": {
      "get": {
        "operationId": "PortalController_getRecentActivity",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get recent activity",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/appointments": {
      "get": {
        "operationId": "BffController_getAppointments",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get appointments",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/appointments/slots/available": {
      "get": {
        "operationId": "BffController_getAvailableSlots",
        "parameters": [
          {
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "serviceType",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get available appointment slots",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/appointments/{id}": {
      "delete": {
        "operationId": "BffController_cancelAppointment",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel appointment",
        "tags": [
          "Customer Portal - BFF"
        ]
      },
      "get": {
        "operationId": "BffController_getAppointment",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get appointment by ID",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/auth/logout": {
      "post": {
        "operationId": "PortalController_logout",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Logout and invalidate session",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/auth/magic-link": {
      "post": {
        "operationId": "PortalController_sendMagicLink",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMagicLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Send magic link to email",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/auth/me": {
      "get": {
        "operationId": "PortalController_getCurrentUser",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current user info",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/auth/verify": {
      "post": {
        "operationId": "PortalController_verifyMagicLink",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyMagicLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Verify magic link and create session",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/dashboard": {
      "get": {
        "operationId": "BffController_getDashboard",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get dashboard overview",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/invoices": {
      "get": {
        "operationId": "BffController_getInvoices",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoices",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/invoices/{id}": {
      "get": {
        "operationId": "BffController_getInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoice by ID",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/messages": {
      "get": {
        "operationId": "BffController_getMessages",
        "parameters": [
          {
            "in": "query",
            "name": "threadId",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get messages",
        "tags": [
          "Customer Portal - BFF"
        ]
      },
      "post": {
        "operationId": "BffController_sendMessage",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send message",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/messages/threads": {
      "get": {
        "operationId": "BffController_getThreads",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get message threads",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/messages/threads/{id}": {
      "get": {
        "operationId": "BffController_getThread",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get thread by ID",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/messages/threads/{id}/read": {
      "post": {
        "operationId": "BffController_markThreadRead",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark thread as read",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/messages/unread/count": {
      "get": {
        "operationId": "BffController_getUnreadCount",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get unread message count",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/modules": {
      "get": {
        "operationId": "PortalController_getModules",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get enabled portal modules",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/notifications": {
      "get": {
        "operationId": "PortalController_getNotifications",
        "parameters": [
          {
            "in": "query",
            "name": "unreadOnly",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get notifications",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/notifications/read-all": {
      "post": {
        "operationId": "PortalController_markAllNotificationsRead",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark all notifications as read",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/notifications/{id}/read": {
      "patch": {
        "operationId": "PortalController_markNotificationRead",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark notification as read",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/payments": {
      "get": {
        "operationId": "BffController_getPayments",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get payments",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/payments/summary": {
      "get": {
        "operationId": "BffController_getPaymentSummary",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get payment summary",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/payments/{id}({0}.+)": {
      "get": {
        "operationId": "BffController_getPayment",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get payment by ID",
        "tags": [
          "Customer Portal - BFF"
        ]
      }
    },
    "/v1/portal/validate-token/{token}": {
      "get": {
        "operationId": "PortalPublicController_validateMagicLinkToken",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Magic link validated"
          }
        },
        "summary": "Validate magic link token and issue portal access token",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/{projectId}/access-context": {
      "get": {
        "operationId": "PortalPublicController_resolveAccessContext",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Portal access context resolved"
          }
        },
        "summary": "Resolve portal access context from optional token; lets frontend skip passcode when magic link is valid",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/{projectId}/status": {
      "get": {
        "operationId": "PortalPublicController_getProjectStatus",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project status returned"
          }
        },
        "summary": "Get public project status using portal access token",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/portal/{projectId}/validate-passcode": {
      "post": {
        "operationId": "PortalPublicController_validatePasscode",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateProjectPasscodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Passcode validated"
          }
        },
        "summary": "Validate shared passcode and issue portal access token",
        "tags": [
          "Customer Portal"
        ]
      }
    },
    "/v1/pricing/cancelSubscription": {
      "post": {
        "operationId": "PricingController_cancelSubscription",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel organization subscription",
        "tags": [
          "Pricing"
        ]
      }
    },
    "/v1/pricing/changePlan": {
      "post": {
        "operationId": "PricingController_changePlan",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change organization subscription plan",
        "tags": [
          "Pricing"
        ]
      }
    },
    "/v1/pricing/organization": {
      "get": {
        "operationId": "PricingController_getOrganizationPricing",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get pricing context for the current organization",
        "tags": [
          "Pricing"
        ]
      },
      "options": {
        "operationId": "PricingController_handleOrganizationOptions",
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "Pricing"
        ]
      }
    },
    "/v1/pricing/pauseSubscription": {
      "post": {
        "operationId": "PricingController_pauseSubscription",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pause organization subscription",
        "tags": [
          "Pricing"
        ]
      }
    },
    "/v1/pricing/plans": {
      "get": {
        "operationId": "PricingController_getPlans",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available platform plans and credit pricing",
        "tags": [
          "Pricing"
        ]
      }
    },
    "/v1/pricing/resumeSubscription": {
      "post": {
        "operationId": "PricingController_resumeSubscription",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Resume organization subscription",
        "tags": [
          "Pricing"
        ]
      }
    },
    "/v1/pricing/send-roi-report": {
      "post": {
        "operationId": "PricingPublicController_sendRoiReport",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRoiReportDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Send ROI analysis email to a colleague",
        "tags": [
          "Pricing"
        ]
      }
    },
    "/v1/pricing/subscribe": {
      "post": {
        "operationId": "PricingController_subscribeToPlan",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Subscribe organization to a plan (frontend pricing CTA)",
        "tags": [
          "Pricing"
        ]
      }
    },
    "/v1/pricing/tiers": {
      "get": {
        "operationId": "PricingTiersController_getPricingTiers",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Pricing tiers retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry pricing tiers",
        "tags": [
          "Pricing Tiers"
        ]
      },
      "post": {
        "operationId": "PricingTiersController_createPricingTier",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePricingTierDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Pricing tier created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create custom pricing tier",
        "tags": [
          "Pricing Tiers"
        ]
      }
    },
    "/v1/pricing/tiers/{id}": {
      "delete": {
        "operationId": "PricingTiersController_deletePricingTier",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pricing tier deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Pricing tier not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete pricing tier",
        "tags": [
          "Pricing Tiers"
        ]
      },
      "patch": {
        "operationId": "PricingTiersController_updatePricingTier",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePricingTierDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Pricing tier updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Pricing tier not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update pricing tier",
        "tags": [
          "Pricing Tiers"
        ]
      }
    },
    "/v1/project-templates": {
      "get": {
        "operationId": "ProjectTemplatesController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "isDefault",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Project templates retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all project templates",
        "tags": [
          "project-templates"
        ]
      },
      "post": {
        "operationId": "ProjectTemplatesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Project template created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new project template",
        "tags": [
          "project-templates"
        ]
      }
    },
    "/v1/project-templates/{id}": {
      "delete": {
        "operationId": "ProjectTemplatesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project template deleted successfully"
          },
          "404": {
            "description": "Project template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a project template",
        "tags": [
          "project-templates"
        ]
      },
      "get": {
        "operationId": "ProjectTemplatesController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project template retrieved successfully"
          },
          "404": {
            "description": "Project template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a project template by ID",
        "tags": [
          "project-templates"
        ]
      },
      "patch": {
        "operationId": "ProjectTemplatesController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Project template updated successfully"
          },
          "404": {
            "description": "Project template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a project template",
        "tags": [
          "project-templates"
        ]
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "ProjectsController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Alias for q",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          },
          {
            "description": "Search by project name or description",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "dealId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Projects retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all projects",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "ProjectsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Project created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/templates": {
      "get": {
        "operationId": "ProjectsController_getTemplates",
        "parameters": [
          {
            "in": "query",
            "name": "isDefault",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Project templates retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get available project templates",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}": {
      "delete": {
        "operationId": "ProjectsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project deleted successfully"
          },
          "404": {
            "description": "Project not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a project",
        "tags": [
          "projects"
        ]
      },
      "get": {
        "operationId": "ProjectsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project retrieved successfully"
          },
          "404": {
            "description": "Project not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a project by ID",
        "tags": [
          "projects"
        ]
      },
      "patch": {
        "operationId": "ProjectsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Project updated successfully"
          },
          "404": {
            "description": "Project not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/calendar-sync": {
      "get": {
        "operationId": "ProjectsController_getCalendarIntegrations",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List calendar integrations attached to project",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "ProjectsController_attachCalendarIntegration",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Attach calendar integration to project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/calendar-sync/{integrationId}": {
      "delete": {
        "operationId": "ProjectsController_detachCalendarIntegration",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Detach calendar integration from project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/calendar-sync/{integrationId}/sync": {
      "post": {
        "operationId": "ProjectsController_syncCalendarIntegration",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "integrationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger immediate calendar sync for project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/client-status": {
      "get": {
        "operationId": "ProjectsController_getClientStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Client status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get client-facing project status",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/files": {
      "get": {
        "operationId": "ProjectsController_listFiles",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project files retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List files attached to a project",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "ProjectsController_uploadFile",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "category": {
                    "description": "Optional category label for UI grouping",
                    "type": "string"
                  },
                  "file": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "File uploaded successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a file to a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/generate-passcode": {
      "post": {
        "operationId": "ProjectsController_generateProjectPasscode",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateProjectPasscodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Passcode generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate client portal passcode",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/invoices/preview": {
      "post": {
        "operationId": "ProjectsController_previewInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate invoice preview for project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/members": {
      "get": {
        "operationId": "ProjectsController_getMembers",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List project team members",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "ProjectsController_addMember",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddProjectMemberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Assign team member to project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/members/{userId}": {
      "delete": {
        "operationId": "ProjectsController_removeMember",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove team member from project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/messages": {
      "get": {
        "operationId": "ProjectsController_getMessages",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project messages retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get messages for a project",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "ProjectsController_sendMessage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Message sent successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a message to project chat",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/share/magic-link": {
      "post": {
        "operationId": "ProjectsController_shareProjectMagicLink",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareProjectMagicLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Magic link generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Share project via client magic link",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/tasks": {
      "get": {
        "description": "Convenience alias for GET /tasks?projectId=:id so the Projects UI can use a RESTful nested path.",
        "operationId": "ProjectsController_listProjectTasks",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "stage",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "ownerId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "phaseId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "priority",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List tasks for a project",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "description": "RESTful alias that forwards to TasksService.create with projectId injected from the route. The Projects UI can call this without having to set projectId in the body (KAN-55).",
        "operationId": "ProjectsController_addProjectTask",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Task created and linked to project"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a task to a project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/tasks/stages": {
      "get": {
        "operationId": "ProjectsController_getStageSummary",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get Kanban stage summary for project tasks",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/time-entries": {
      "get": {
        "operationId": "ProjectsController_getTimeEntries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "billableOnly",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List time entries for project",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{id}/time-entries/export": {
      "get": {
        "operationId": "ProjectsController_exportTimeEntries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export project time entries as CSV",
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/public/ai/knowledge/search": {
      "post": {
        "operationId": "PublicConfigController_searchKnowledge",
        "parameters": [
          {
            "description": "Widget public key for authentication",
            "in": "header",
            "name": "x-widget-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge search results"
          },
          "404": {
            "description": "Widget not found or disabled"
          }
        },
        "summary": "Search knowledge base (public widget access)",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/booking/{bookingId}": {
      "delete": {
        "operationId": "PublicBookingController_cancelBooking",
        "parameters": [
          {
            "description": "Booking ID",
            "in": "path",
            "name": "bookingId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Cancellation token",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking cancelled successfully"
          },
          "400": {
            "description": "Invalid request"
          },
          "404": {
            "description": "Booking not found"
          }
        },
        "summary": "Cancel a booking",
        "tags": [
          "public-booking"
        ]
      },
      "get": {
        "operationId": "PublicBookingController_getBookingDetails",
        "parameters": [
          {
            "description": "Booking ID",
            "in": "path",
            "name": "bookingId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Reschedule or cancellation token",
            "in": "query",
            "name": "token",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking details retrieved successfully"
          },
          "404": {
            "description": "Booking not found"
          }
        },
        "summary": "Get booking details by ID and token",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/booking/{bookingId}/reschedule": {
      "put": {
        "operationId": "PublicBookingController_rescheduleBooking",
        "parameters": [
          {
            "description": "Booking ID",
            "in": "path",
            "name": "bookingId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Reschedule token",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking rescheduled successfully"
          },
          "400": {
            "description": "Invalid request"
          },
          "404": {
            "description": "Booking not found"
          }
        },
        "summary": "Reschedule a booking",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/{bookingKey}/appointments": {
      "post": {
        "operationId": "PublicBookingController_createPublicAppointmentByBookingKey",
        "parameters": [
          {
            "description": "Calendar booking key",
            "in": "path",
            "name": "bookingKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Widget key for analytics",
            "in": "header",
            "name": "x-widget-key",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Widget session identifier",
            "in": "header",
            "name": "x-session-id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Appointment created successfully"
          }
        },
        "summary": "Create appointment via public booking (booking key)",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/{bookingKey}/slots": {
      "get": {
        "operationId": "PublicBookingController_getAvailableSlotsByBookingKey",
        "parameters": [
          {
            "description": "Calendar booking key",
            "in": "path",
            "name": "bookingKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Service offering ID",
            "in": "query",
            "name": "serviceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Date in YYYY-MM-DD format",
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Staff ID (optional)",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Client timezone (IANA name)",
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-widget-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-session-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Slot availability returned"
          }
        },
        "summary": "Get available booking slots by booking key",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/{bookingKey}/upload-photos": {
      "post": {
        "operationId": "PublicBookingController_uploadBookingPhotos",
        "parameters": [
          {
            "description": "Calendar booking key",
            "in": "path",
            "name": "bookingKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Widget session identifier",
            "in": "header",
            "name": "x-session-id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "files": {
                    "description": "Up to 5 image files",
                    "items": {
                      "format": "binary",
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "files"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Photos uploaded successfully"
          }
        },
        "summary": "Upload booking photos through Filestack (backend proxy)",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/{orgId}/appointments": {
      "post": {
        "operationId": "PublicBookingController_createPublicAppointment",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Widget key for analytics",
            "in": "header",
            "name": "x-widget-key",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Widget session identifier",
            "in": "header",
            "name": "x-session-id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Appointment created successfully"
          }
        },
        "summary": "Create appointment via public booking widget",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/{orgId}/availability/bulk": {
      "post": {
        "operationId": "PublicBookingController_getBulkAvailability",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bulk availability retrieved successfully"
          }
        },
        "summary": "Get bulk availability for calendar view",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/{orgId}/config": {
      "get": {
        "operationId": "PublicBookingController_getBookingConfig",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Booking configuration retrieved successfully"
          }
        },
        "summary": "Get services, staff, and booking settings for public widget",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/book/{orgId}/slots": {
      "get": {
        "operationId": "PublicBookingController_getAvailableSlots",
        "parameters": [
          {
            "description": "Organization ID",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Service offering ID",
            "in": "query",
            "name": "serviceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Date in YYYY-MM-DD format",
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Staff ID (optional)",
            "in": "query",
            "name": "staffId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Client timezone (IANA name)",
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-widget-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-session-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Slot availability returned"
          }
        },
        "summary": "Get available booking slots",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/calendar-configs/{bookingKey}": {
      "get": {
        "operationId": "PublicCalendarConfigsController_getByKey",
        "parameters": [
          {
            "in": "path",
            "name": "bookingKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get public calendar configuration by booking key",
        "tags": [
          "public-calendar-configs"
        ]
      }
    },
    "/v1/public/config/filestack": {
      "get": {
        "operationId": "PublicConfigController_getFilestackConfig",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Filestack configuration retrieved successfully"
          }
        },
        "summary": "Get Filestack configuration for widget uploads",
        "tags": [
          "public-booking"
        ]
      }
    },
    "/v1/public/surveys/invites/{token}": {
      "get": {
        "operationId": "PublicSurveysController_getInvite",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Fetch information needed to render a survey invitation",
        "tags": [
          "Public Surveys"
        ]
      }
    },
    "/v1/public/surveys/invites/{token}/responses": {
      "post": {
        "operationId": "PublicSurveysController_submitResponse",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSurveyResponseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Submit a survey response using the invitation token",
        "tags": [
          "Public Surveys"
        ]
      }
    },
    "/v1/public/surveys/{surveyKey}": {
      "get": {
        "operationId": "PublicSurveysController_getInviteAlias",
        "parameters": [
          {
            "in": "path",
            "name": "surveyKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Fetch invitation details (frontend alias)",
        "tags": [
          "Public Surveys"
        ]
      }
    },
    "/v1/public/surveys/{surveyKey}/respond": {
      "post": {
        "operationId": "PublicSurveysController_submitResponseAlias",
        "parameters": [
          {
            "in": "path",
            "name": "surveyKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicSurveyRespondFrontendDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "summary": "Submit a survey response (frontend alias)",
        "tags": [
          "Public Surveys"
        ]
      }
    },
    "/v1/public/widget/{widgetKey}/config": {
      "get": {
        "operationId": "WidgetPublicController_getWidgetConfig",
        "parameters": [
          {
            "description": "Widget public key",
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "organizationId": {
                          "type": "string"
                        },
                        "organizationLogo": {
                          "type": "string"
                        },
                        "organizationName": {
                          "type": "string"
                        },
                        "settings": {
                          "properties": {
                            "allowGuestBooking": {
                              "type": "boolean"
                            },
                            "displayMode": {
                              "enum": [
                                "inline",
                                "popup",
                                "fullscreen"
                              ],
                              "type": "string"
                            },
                            "locale": {
                              "type": "string"
                            },
                            "requireNotes": {
                              "type": "boolean"
                            },
                            "requirePhone": {
                              "type": "boolean"
                            },
                            "showServicePrices": {
                              "type": "boolean"
                            },
                            "showStaffPhotos": {
                              "type": "boolean"
                            },
                            "size": {
                              "enum": [
                                "small",
                                "medium",
                                "large"
                              ],
                              "type": "string"
                            },
                            "successMessage": {
                              "type": "string"
                            },
                            "theme": {
                              "properties": {
                                "backgroundColor": {
                                  "type": "string"
                                },
                                "borderRadius": {
                                  "type": "string"
                                },
                                "fontFamily": {
                                  "type": "string"
                                },
                                "primaryColor": {
                                  "type": "string"
                                },
                                "secondaryColor": {
                                  "type": "string"
                                },
                                "textColor": {
                                  "type": "string"
                                }
                              },
                              "type": "object"
                            },
                            "timezone": {
                              "type": "string"
                            },
                            "welcomeMessage": {
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "widgetKey": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Widget configuration retrieved"
          },
          "404": {
            "description": "Widget not found or disabled"
          }
        },
        "summary": "Get widget configuration for embedding",
        "tags": [
          "widget-public"
        ]
      }
    },
    "/v1/public/widget/{widgetKey}/locations": {
      "get": {
        "operationId": "WidgetPublicController_getLocations",
        "parameters": [
          {
            "description": "Widget public key",
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "List active locations for this widget (maps/location picker)",
        "tags": [
          "widget-public"
        ]
      }
    },
    "/v1/public/widget/{widgetKey}/locations/nearby": {
      "get": {
        "operationId": "WidgetPublicController_getNearbyLocations",
        "parameters": [
          {
            "description": "Widget public key",
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Latitude",
            "in": "query",
            "name": "lat",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Longitude",
            "in": "query",
            "name": "lng",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max locations to return (default 3, max 20)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get nearest locations to a lat/lng (for map + automatic routing)",
        "tags": [
          "widget-public"
        ]
      }
    },
    "/v1/public/widget/{widgetKey}/track": {
      "post": {
        "operationId": "WidgetPublicController_trackAnalytics",
        "parameters": [
          {
            "description": "Widget public key",
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Session ID for tracking",
            "in": "header",
            "name": "x-session-id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "tracked": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Analytics event tracked"
          }
        },
        "summary": "Track widget analytics events",
        "tags": [
          "widget-public"
        ]
      }
    },
    "/v1/realtime/session": {
      "post": {
        "description": "Returns a short-lived token and websocket URL for connecting to the Socket.IO realtime gateway. The client should use socket.io-client to connect to the returned websocketUrl with auth: { token, orgId }.",
        "operationId": "RealtimeSessionController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RealtimeSessionRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Session created successfully"
          },
          "400": {
            "description": "Invalid request"
          },
          "404": {
            "description": "Agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a realtime session token",
        "tags": [
          "realtime"
        ]
      }
    },
    "/v1/realtime/status": {
      "get": {
        "description": "Returns Socket.IO connection settings so the frontend can enter silent degraded mode instead of repeatedly reconnecting with an invalid configuration.",
        "operationId": "RealtimeSessionController_status",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Realtime status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get realtime availability and client connection guidance",
        "tags": [
          "realtime"
        ]
      }
    },
    "/v1/referral-programs/{programId}/links": {
      "get": {
        "operationId": "ReferralProgramsController_getReferralLink",
        "parameters": [
          {
            "in": "query",
            "name": "organizationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "programId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get referral link for a contact in a specific program",
        "tags": [
          "Referral Programs"
        ]
      }
    },
    "/v1/referrals/by-advocate/{contactId}": {
      "get": {
        "operationId": "ReferralsController_byAdvocate",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List referrals by advocate (spec)",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/v1/referrals/convert": {
      "post": {
        "operationId": "ReferralsController_convert",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvertReferralDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Convert referral (spec)",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/v1/referrals/generate-link": {
      "post": {
        "operationId": "ReferralsController_generateLink",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateReferralLinkDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate referral link (spec)",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/v1/referrals/link/{programId}/{contactId}": {
      "get": {
        "operationId": "ReferralsController_getReferralLink",
        "parameters": [
          {
            "in": "path",
            "name": "programId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get or create a referral link for a contact",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/v1/referrals/loyalty/{contactId}": {
      "get": {
        "operationId": "ReferralsController_getLoyalty",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get loyalty tier summary for a contact",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/v1/referrals/programs": {
      "get": {
        "operationId": "ReferralsProgramsAdminController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List referral programs",
        "tags": [
          "referrals-programs"
        ]
      },
      "post": {
        "operationId": "ReferralsProgramsAdminController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferralProgramDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create referral program",
        "tags": [
          "referrals-programs"
        ]
      }
    },
    "/v1/referrals/programs/{id}": {
      "delete": {
        "operationId": "ReferralsProgramsAdminController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete referral program",
        "tags": [
          "referrals-programs"
        ]
      },
      "get": {
        "operationId": "ReferralsProgramsAdminController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get referral program",
        "tags": [
          "referrals-programs"
        ]
      },
      "patch": {
        "operationId": "ReferralsProgramsAdminController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReferralProgramDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update referral program",
        "tags": [
          "referrals-programs"
        ]
      }
    },
    "/v1/referrals/redeem": {
      "post": {
        "operationId": "ReferralsController_redeem",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedeemReferralDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Redeem referral credits for a contact",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/v1/referrals/stats/{linkId}": {
      "get": {
        "operationId": "ReferralsController_getStats",
        "parameters": [
          {
            "in": "path",
            "name": "linkId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get performance stats for a referral link",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/v1/referrals/wallet/{contactId}": {
      "get": {
        "operationId": "ReferralsController_getWallet",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get referral wallet details for a contact",
        "tags": [
          "Referrals"
        ]
      }
    },
    "/v1/reports/custom": {
      "get": {
        "operationId": "CustomReportsController_getCustomReports",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Custom reports retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List custom reports",
        "tags": [
          "Custom Reports"
        ]
      },
      "post": {
        "operationId": "CustomReportsController_createCustomReport",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCustomReportDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Custom report created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create custom report",
        "tags": [
          "Custom Reports"
        ]
      }
    },
    "/v1/reports/custom/{id}": {
      "get": {
        "operationId": "CustomReportsController_getCustomReport",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom report retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Custom report not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get custom report",
        "tags": [
          "Custom Reports"
        ]
      }
    },
    "/v1/reports/custom/{id}/export": {
      "get": {
        "operationId": "CustomReportsController_exportCustomReport",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report exported successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Custom report not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Export custom report",
        "tags": [
          "Custom Reports"
        ]
      }
    },
    "/v1/resources": {
      "get": {
        "operationId": "ResourcesController_list",
        "parameters": [
          {
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List resources",
        "tags": [
          "resources"
        ]
      },
      "post": {
        "operationId": "ResourcesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateResourceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a resource",
        "tags": [
          "resources"
        ]
      }
    },
    "/v1/resources/{id}": {
      "delete": {
        "operationId": "ResourcesController_archive",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Archive (deactivate) a resource",
        "tags": [
          "resources"
        ]
      },
      "get": {
        "operationId": "ResourcesController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a resource by id",
        "tags": [
          "resources"
        ]
      },
      "patch": {
        "operationId": "ResourcesController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateResourceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a resource",
        "tags": [
          "resources"
        ]
      }
    },
    "/v1/reviews": {
      "get": {
        "operationId": "ReviewsController_list",
        "parameters": [
          {
            "description": "Page number (1-indexed)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "description": "Page size",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 200,
              "type": "number"
            }
          },
          {
            "description": "Filter by workflow status",
            "in": "query",
            "name": "workflowStatus",
            "required": false,
            "schema": {
              "enum": [
                "new",
                "needs_response",
                "responded",
                "resolved"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by assignee user id",
            "in": "query",
            "name": "assignedToId",
            "required": false,
            "schema": {
              "example": "usr_123",
              "type": "string"
            }
          },
          {
            "description": "Filter by review source/provider",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "example": "google",
              "type": "string"
            }
          },
          {
            "description": "Filter by location id",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "example": "loc_123",
              "type": "string"
            }
          },
          {
            "description": "Exact star rating (1-5)",
            "in": "query",
            "name": "rating",
            "required": false,
            "schema": {
              "example": 5,
              "type": "number"
            }
          },
          {
            "description": "Full-text search on author/title/body",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "example": "late",
              "type": "string"
            }
          },
          {
            "description": "Filter by specific listing connection IDs (comma separated or repeated query params)",
            "in": "query",
            "name": "connectionIds",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "example": {
                    "data": [],
                    "pagination": {
                      "limit": 25,
                      "page": 1,
                      "pages": 1,
                      "total": 0
                    }
                  }
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List reviews for the Reviews Inbox",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/counts": {
      "get": {
        "operationId": "ReviewsController_counts",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get review inbox counts for badges/filters",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/import": {
      "post": {
        "operationId": "ReviewsController_import",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportReviewsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Import reviews from external sources (e.g., Trustpilot/Clutch) via API",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/ingest": {
      "post": {
        "operationId": "ReviewsController_triggerIngestion",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerReviewIngestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger review ingestion for all or specific listing connections",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/metrics/summary": {
      "get": {
        "operationId": "ReviewsController_metrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get basic aggregate metrics for the Reviews dashboard (proxy)",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/providers": {
      "get": {
        "operationId": "ReviewsController_listProviders",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReviewProviderDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List supported review providers/sources and their capabilities",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/request-settings": {
      "get": {
        "operationId": "ReviewsController_getRequestSettings",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewSettingsDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get review request settings for organization or location",
        "tags": [
          "Reviews"
        ]
      },
      "put": {
        "operationId": "ReviewsController_updateRequestSettings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReviewSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewSettingsDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update review request settings",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/requests": {
      "get": {
        "operationId": "ReviewsController_listReviewRequests",
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "description": "Supports both internal statuses and Marketing Suite spec statuses",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "queued",
                "sending",
                "sent",
                "failed",
                "pending",
                "sent",
                "opened",
                "clicked",
                "reviewed",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by contact identifier",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by location identifier",
            "in": "query",
            "name": "locationId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by appointment identifier",
            "in": "query",
            "name": "appointmentId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by job identifier",
            "in": "query",
            "name": "jobId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-01-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-01-31T23:59:59.999Z",
              "type": "string"
            }
          },
          {
            "description": "Search contact name, email, or phone",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "take",
            "required": false,
            "schema": {
              "default": 50,
              "example": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "skip",
            "required": false,
            "schema": {
              "example": 0,
              "minimum": 0,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "createdAt",
              "enum": [
                "createdAt",
                "sendAfter",
                "sentAt"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only include requests that are scheduled to send in the future",
            "in": "query",
            "name": "includeScheduledOnly",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReviewRequestResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List review requests",
        "tags": [
          "Reviews"
        ]
      },
      "post": {
        "operationId": "ReviewsController_createReviewRequest",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReviewRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CreateReviewRequestResponseDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create manual review request(s)",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/{reviewId}": {
      "get": {
        "operationId": "ReviewsController_getOne",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewInboxItemDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a single review (Inbox detail)",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/{reviewId}/comments": {
      "get": {
        "operationId": "ReviewsController_listComments",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReviewCommentDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List internal comments/notes for a review",
        "tags": [
          "Reviews"
        ]
      },
      "post": {
        "operationId": "ReviewsController_addComment",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReviewCommentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewCommentDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add an internal comment/note to a review",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/{reviewId}/reply": {
      "patch": {
        "operationId": "ReviewsController_updateReply",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReviewReplyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save a reply to a review (and mark responded). Publishing is provider-dependent.",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/{reviewId}/reply-draft": {
      "post": {
        "operationId": "ReviewsController_generateReplyDraft",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateReviewReplyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate an AI reply draft for a review (manual or publish flow)",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/{reviewId}/view": {
      "post": {
        "operationId": "ReviewsController_markViewed",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a review as viewed (org-level, MVP)",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reviews/{reviewId}/workflow": {
      "patch": {
        "operationId": "ReviewsController_updateWorkflow",
        "parameters": [
          {
            "in": "path",
            "name": "reviewId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReviewWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewInboxItemDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update review workflow fields (status/assignee)",
        "tags": [
          "Reviews"
        ]
      }
    },
    "/v1/reward-ledger/{contactId}": {
      "get": {
        "operationId": "RewardLedgerController_getLedger",
        "parameters": [
          {
            "in": "query",
            "name": "organizationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Get reward ledger/wallet for a contact",
        "tags": [
          "Reward Ledger"
        ]
      }
    },
    "/v1/sandbox/environments": {
      "delete": {
        "operationId": "SandboxEnvironmentsController_deleteSandbox",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "get": {
        "operationId": "SandboxEnvironmentsController_getSandbox",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "post": {
        "operationId": "SandboxEnvironmentsController_createSandbox",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      },
      "put": {
        "operationId": "SandboxEnvironmentsController_updateSandbox",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/environments/errors": {
      "get": {
        "operationId": "SandboxEnvironmentsController_getErrors",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/environments/metrics": {
      "get": {
        "operationId": "SandboxEnvironmentsController_getMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/environments/reset": {
      "post": {
        "operationId": "SandboxEnvironmentsController_resetSandbox",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/environments/trends": {
      "get": {
        "operationId": "SandboxEnvironmentsController_getTrends",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/environments/usage": {
      "get": {
        "operationId": "SandboxEnvironmentsController_getUsage",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/execute": {
      "post": {
        "operationId": "SandboxExecutionController_execute",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/execute/agent": {
      "post": {
        "operationId": "SandboxExecutionController_executeAgent",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/execute/api-call": {
      "post": {
        "operationId": "SandboxExecutionController_executeApiCall",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/execute/embedding": {
      "post": {
        "operationId": "SandboxExecutionController_executeEmbedding",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/execute/integration-sync": {
      "post": {
        "operationId": "SandboxExecutionController_executeIntegrationSync",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/health": {
      "get": {
        "operationId": "SandboxController_getSandboxHealth",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/sandbox/system/stats": {
      "get": {
        "operationId": "SandboxController_getSystemStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/v1/service-offerings": {
      "get": {
        "operationId": "ServiceOfferingsController_findAll",
        "parameters": [
          {
            "description": "Optional includes, e.g. aiMetadata",
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Service offerings retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all service offerings",
        "tags": [
          "calendar-service-offerings"
        ]
      },
      "post": {
        "operationId": "ServiceOfferingsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceOfferingDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Service offering created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new service offering",
        "tags": [
          "calendar-service-offerings"
        ]
      }
    },
    "/v1/service-offerings/{id}": {
      "delete": {
        "operationId": "ServiceOfferingsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Service offering deactivated successfully"
          },
          "404": {
            "description": "Service offering not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a service offering",
        "tags": [
          "calendar-service-offerings"
        ]
      },
      "get": {
        "operationId": "ServiceOfferingsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Service offering retrieved successfully"
          },
          "404": {
            "description": "Service offering not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a service offering by ID",
        "tags": [
          "calendar-service-offerings"
        ]
      },
      "patch": {
        "operationId": "ServiceOfferingsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceOfferingDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Service offering updated successfully"
          },
          "404": {
            "description": "Service offering not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a service offering",
        "tags": [
          "calendar-service-offerings"
        ]
      }
    },
    "/v1/service-offerings/{id}/ai-metadata": {
      "patch": {
        "operationId": "ServiceOfferingsController_updateAiMetadata",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateServiceOfferingAiMetadataDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "AI metadata updated successfully"
          },
          "404": {
            "description": "Service offering not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update AI metadata for a service offering",
        "tags": [
          "calendar-service-offerings"
        ]
      }
    },
    "/v1/settings/api-keys": {
      "get": {
        "operationId": "SettingsController_getApiKeys",
        "parameters": [],
        "responses": {
          "200": {
            "description": "API keys retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all API keys",
        "tags": [
          "Settings"
        ]
      },
      "post": {
        "operationId": "SettingsController_createApiKey",
        "parameters": [],
        "responses": {
          "201": {
            "description": "API key created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new API key",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/api-keys/{id}": {
      "delete": {
        "description": "Revokes an API key for the organization.",
        "operationId": "SettingsController_deleteApiKey",
        "parameters": [
          {
            "description": "API key identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          },
          "404": {
            "description": "API key not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an API key",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/audit-logs": {
      "get": {
        "operationId": "SettingsController_getAuditLogs",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Audit logs retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get audit logs",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/custom-fields": {
      "get": {
        "operationId": "SettingsController_getCustomFields",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Custom fields retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all custom fields",
        "tags": [
          "Settings"
        ]
      },
      "post": {
        "operationId": "SettingsController_createCustomField",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Custom field created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new custom field",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/custom-fields/{id}": {
      "delete": {
        "description": "Deletes a custom field definition and associated values.",
        "operationId": "SettingsController_deleteCustomField",
        "parameters": [
          {
            "description": "Custom field identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom field deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          },
          "404": {
            "description": "Custom field not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a custom field",
        "tags": [
          "Settings"
        ]
      },
      "patch": {
        "description": "Updates definition metadata for a custom field such as label or options.",
        "operationId": "SettingsController_updateCustomField",
        "parameters": [
          {
            "description": "Custom field identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom field updated successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          },
          "404": {
            "description": "Custom field not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a custom field",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/integrations": {
      "get": {
        "operationId": "SettingsController_getIntegrations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Integrations retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available integrations",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/integrations/{type}/connect": {
      "post": {
        "description": "Connects an external integration (e.g., calendar, CRM) for the organization.",
        "operationId": "SettingsController_connectIntegration",
        "parameters": [
          {
            "description": "Integration type identifier",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectIntegrationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Integration connected successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Connect an integration",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/messaging": {
      "get": {
        "operationId": "SettingsController_getMessaging",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get organization messaging settings (quiet hours + throttles)",
        "tags": [
          "Settings"
        ]
      },
      "patch": {
        "operationId": "SettingsController_updateMessaging",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMessagingSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update organization messaging settings (quiet hours + throttles)",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/notifications": {
      "get": {
        "operationId": "SettingsController_getNotifications",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Notification settings retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get notification settings",
        "tags": [
          "Settings"
        ]
      },
      "patch": {
        "operationId": "SettingsController_updateNotifications",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNotificationsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Notification settings updated successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update notification settings",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/onboarding": {
      "get": {
        "operationId": "SettingsController_getOnboardingProgress",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Onboarding progress retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get onboarding progress for the current user",
        "tags": [
          "Settings"
        ]
      },
      "patch": {
        "operationId": "SettingsController_updateOnboarding",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOnboardingProgressDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Onboarding progress updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update onboarding step completion states",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/onboarding/complete-phase": {
      "post": {
        "operationId": "SettingsController_completeOnboardingPhase",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteOnboardingPhaseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Onboarding phase marked as complete"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark an onboarding phase as complete",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/pipeline-stages": {
      "get": {
        "operationId": "SettingsController_getPipelineStages",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Pipeline stages retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all pipeline stages",
        "tags": [
          "Settings"
        ]
      },
      "post": {
        "operationId": "SettingsController_createPipelineStage",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Pipeline stage created successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new pipeline stage",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/pipeline-stages/{id}": {
      "delete": {
        "description": "Removes a pipeline stage after ensuring no dependent records are impacted.",
        "operationId": "SettingsController_deletePipelineStage",
        "parameters": [
          {
            "description": "Pipeline stage identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pipeline stage deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          },
          "404": {
            "description": "Pipeline stage not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a pipeline stage",
        "tags": [
          "Settings"
        ]
      },
      "patch": {
        "description": "Updates name, order, or color for a pipeline stage belonging to the organization.",
        "operationId": "SettingsController_updatePipelineStage",
        "parameters": [
          {
            "description": "Pipeline stage identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pipeline stage updated successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          },
          "404": {
            "description": "Pipeline stage not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a pipeline stage",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/preferences": {
      "get": {
        "operationId": "SettingsController_getPreferences",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Preferences retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get user preferences",
        "tags": [
          "Settings"
        ]
      },
      "patch": {
        "operationId": "SettingsController_updatePreferences",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePreferencesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preferences updated successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update user preferences",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/profile": {
      "get": {
        "operationId": "SettingsController_getProfile",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Profile retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get user profile",
        "tags": [
          "Settings"
        ]
      },
      "patch": {
        "operationId": "SettingsController_updateProfile",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Profile updated successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update user profile",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/settings/workflow": {
      "get": {
        "operationId": "SettingsController_getWorkflow",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowSettingsDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow defaults used by workflow templates and sends",
        "tags": [
          "Settings"
        ]
      },
      "patch": {
        "operationId": "SettingsController_updateWorkflow",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkflowSettingsDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update workflow defaults used by workflow templates and sends",
        "tags": [
          "Settings"
        ]
      }
    },
    "/v1/sms-templates": {
      "get": {
        "operationId": "SmsTemplatesApiController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List templates (marketing)",
        "tags": [
          "SMS Templates (Marketing)"
        ]
      },
      "post": {
        "operationId": "SmsTemplatesApiController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSmsTemplateApiDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create template (marketing)",
        "tags": [
          "SMS Templates (Marketing)"
        ]
      }
    },
    "/v1/sms-templates/industry/{industry}": {
      "get": {
        "operationId": "SMSTemplatesController_getIndustryTemplates",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SMS templates retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get SMS templates for an industry",
        "tags": [
          "sms-templates"
        ]
      }
    },
    "/v1/sms-templates/industry/{industry}/category/{category}": {
      "get": {
        "operationId": "SMSTemplatesController_getTemplatesByCategory",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SMS templates retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get SMS templates by industry and category",
        "tags": [
          "sms-templates"
        ]
      }
    },
    "/v1/sms-templates/{id}": {
      "delete": {
        "operationId": "SmsTemplatesApiController_delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete template (marketing)",
        "tags": [
          "SMS Templates (Marketing)"
        ]
      },
      "get": {
        "operationId": "SmsTemplatesApiController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get template (marketing)",
        "tags": [
          "SMS Templates (Marketing)"
        ]
      },
      "patch": {
        "operationId": "SmsTemplatesApiController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSmsTemplateApiDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update template (marketing)",
        "tags": [
          "SMS Templates (Marketing)"
        ]
      }
    },
    "/v1/sms/brand": {
      "get": {
        "operationId": "SmsComplianceUnifiedController_brand",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current brand registration (if any)",
        "tags": [
          "sms"
        ]
      },
      "post": {
        "operationId": "SmsComplianceUnifiedController_submitBrand",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSmsBrandDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create & submit brand registration (wizard-friendly)",
        "tags": [
          "sms"
        ]
      }
    },
    "/v1/sms/campaigns": {
      "get": {
        "operationId": "SmsComplianceUnifiedController_campaigns",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List SMS A2P campaigns for the org",
        "tags": [
          "sms"
        ]
      },
      "post": {
        "operationId": "SmsComplianceUnifiedController_createCampaign",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSmsCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create & submit a USA2P campaign (wizard-friendly)",
        "tags": [
          "sms"
        ]
      }
    },
    "/v1/sms/campaigns/{id}": {
      "delete": {
        "operationId": "SmsComplianceUnifiedController_deleteCampaign",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a campaign registration (best-effort Twilio service cleanup)",
        "tags": [
          "sms"
        ]
      },
      "put": {
        "operationId": "SmsComplianceUnifiedController_updateCampaign",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an existing campaign (best-effort Twilio update)",
        "tags": [
          "sms"
        ]
      }
    },
    "/v1/sms/numbers": {
      "get": {
        "operationId": "SmsComplianceUnifiedController_numbers",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List org phone numbers + whether they are attached to an approved messaging service",
        "tags": [
          "sms"
        ]
      }
    },
    "/v1/sms/numbers/attach": {
      "post": {
        "operationId": "SmsComplianceUnifiedController_attach",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachSmsNumberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Attach an org-owned phone number to an APPROVED messaging service (campaign)",
        "tags": [
          "sms"
        ]
      }
    },
    "/v1/sms/numbers/detach": {
      "post": {
        "operationId": "SmsComplianceUnifiedController_detach",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DetachSmsNumberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Detach an org-owned phone number from messaging services",
        "tags": [
          "sms"
        ]
      }
    },
    "/v1/sms/opt-outs": {
      "get": {
        "operationId": "SmsOptOutsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List opted-out numbers",
        "tags": [
          "SMS Opt-Outs"
        ]
      },
      "post": {
        "operationId": "SmsOptOutsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSmsOptOutDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Manually add opt-out",
        "tags": [
          "SMS Opt-Outs"
        ]
      }
    },
    "/v1/sms/opt-outs/{phoneNumber}": {
      "delete": {
        "operationId": "SmsOptOutsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "phoneNumber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove opt-out",
        "tags": [
          "SMS Opt-Outs"
        ]
      }
    },
    "/v1/sms/prefill": {
      "get": {
        "operationId": "SmsComplianceUnifiedController_prefill",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Prefill data for SMS compliance wizard (alias of /v1/messaging/compliance/prefill)",
        "tags": [
          "sms"
        ]
      }
    },
    "/v1/sms/status": {
      "get": {
        "operationId": "SmsComplianceUnifiedController_status",
        "parameters": [
          {
            "in": "query",
            "name": "refresh",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsComplianceStatusDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Unified SMS compliance status (brand + campaigns + numbers + gating flags)",
        "tags": [
          "sms"
        ]
      }
    },
    "/v1/staff": {
      "get": {
        "operationId": "StaffController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Staff members retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all staff members",
        "tags": [
          "calendar-staff"
        ]
      },
      "post": {
        "operationId": "StaffController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateStaffDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Staff member created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new staff member",
        "tags": [
          "calendar-staff"
        ]
      }
    },
    "/v1/staff/{id}": {
      "delete": {
        "operationId": "StaffController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Staff member deactivated successfully"
          },
          "404": {
            "description": "Staff member not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a staff member",
        "tags": [
          "calendar-staff"
        ]
      },
      "get": {
        "operationId": "StaffController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Staff member retrieved successfully"
          },
          "404": {
            "description": "Staff member not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a staff member by ID",
        "tags": [
          "calendar-staff"
        ]
      },
      "patch": {
        "operationId": "StaffController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStaffDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Staff member updated successfully"
          },
          "404": {
            "description": "Staff member not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a staff member",
        "tags": [
          "calendar-staff"
        ]
      }
    },
    "/v1/staff/{id}/availability": {
      "get": {
        "operationId": "StaffController_getAvailability",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "date",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Availability retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get staff member availability for a date",
        "tags": [
          "calendar-staff"
        ]
      }
    },
    "/v1/staff/{id}/breaks": {
      "get": {
        "operationId": "StaffController_getBreaks",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get staff breaks",
        "tags": [
          "calendar-staff"
        ]
      },
      "post": {
        "operationId": "StaffController_createBreak",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBreakDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create staff break",
        "tags": [
          "calendar-staff"
        ]
      }
    },
    "/v1/staff/{id}/breaks/{breakId}": {
      "delete": {
        "operationId": "StaffController_deleteBreak",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "breakId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete staff break",
        "tags": [
          "calendar-staff"
        ]
      }
    },
    "/v1/staff/{id}/time-off": {
      "get": {
        "operationId": "StaffController_getTimeOff",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get time off requests for staff",
        "tags": [
          "calendar-staff"
        ]
      },
      "post": {
        "operationId": "StaffController_createTimeOff",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTimeOffDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create time off request",
        "tags": [
          "calendar-staff"
        ]
      }
    },
    "/v1/staff/{id}/time-off/{timeOffId}": {
      "delete": {
        "operationId": "StaffController_deleteTimeOff",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "timeOffId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete time off request",
        "tags": [
          "calendar-staff"
        ]
      },
      "patch": {
        "operationId": "StaffController_updateTimeOff",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "timeOffId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTimeOffDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update time off request",
        "tags": [
          "calendar-staff"
        ]
      }
    },
    "/v1/staff/{id}/working-hours": {
      "get": {
        "operationId": "StaffController_getWorkingHours",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get weekly working hours for staff",
        "tags": [
          "calendar-staff"
        ]
      },
      "post": {
        "operationId": "StaffController_setWorkingHours",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetWorkingHoursDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set working hours for staff",
        "tags": [
          "calendar-staff"
        ]
      }
    },
    "/v1/stats": {
      "get": {
        "operationId": "StatsController_getStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Consolidated counters retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get consolidated tenant-scoped counters for dashboard surfaces",
        "tags": [
          "stats"
        ]
      }
    },
    "/v1/stats/contacts": {
      "get": {
        "operationId": "StatsController_getContactStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Contact counters retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get contact counters for dashboard quick stats",
        "tags": [
          "stats"
        ]
      }
    },
    "/v1/stats/dashboard": {
      "get": {
        "operationId": "StatsController_getDashboardStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Dashboard counters retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get consolidated dashboard counters",
        "tags": [
          "stats"
        ]
      }
    },
    "/v1/stats/inbox": {
      "get": {
        "operationId": "StatsController_getInboxStats",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Inbox counters retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get inbox counters",
        "tags": [
          "stats"
        ]
      }
    },
    "/v1/surveys": {
      "get": {
        "operationId": "SurveysController_list",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List surveys (alias to survey templates)",
        "tags": [
          "Surveys (Frontend Contract)"
        ]
      },
      "post": {
        "operationId": "SurveysController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurveyFrontendDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create survey (template)",
        "tags": [
          "Surveys (Frontend Contract)"
        ]
      }
    },
    "/v1/surveys/campaigns": {
      "get": {
        "operationId": "SurveyCampaignsController_listCampaigns",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortOrder",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "templateId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "active",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List survey campaigns",
        "tags": [
          "Surveys - Campaigns"
        ]
      },
      "post": {
        "operationId": "SurveyCampaignsController_createCampaign",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurveyCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new survey campaign",
        "tags": [
          "Surveys - Campaigns"
        ]
      }
    },
    "/v1/surveys/campaigns/{campaignId}": {
      "get": {
        "operationId": "SurveyCampaignsController_getCampaign",
        "parameters": [
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get campaign with triggers",
        "tags": [
          "Surveys - Campaigns"
        ]
      },
      "put": {
        "operationId": "SurveyCampaignsController_updateCampaign",
        "parameters": [
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurveyCampaignDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update campaign configuration",
        "tags": [
          "Surveys - Campaigns"
        ]
      }
    },
    "/v1/surveys/campaigns/{campaignId}/triggers": {
      "post": {
        "operationId": "SurveyCampaignsController_createTrigger",
        "parameters": [
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurveyTriggerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create trigger for campaign",
        "tags": [
          "Surveys - Campaigns"
        ]
      }
    },
    "/v1/surveys/campaigns/{campaignId}/triggers/{triggerId}": {
      "put": {
        "operationId": "SurveyCampaignsController_updateTrigger",
        "parameters": [
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "triggerId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurveyTriggerDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update trigger configuration",
        "tags": [
          "Surveys - Campaigns"
        ]
      }
    },
    "/v1/surveys/invitations": {
      "get": {
        "operationId": "SurveyInvitationsController_listInvitations",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortOrder",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "templateId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "campaignId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "appointmentId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "enum": [
                "EMAIL",
                "SMS",
                "WHATSAPP",
                "CHAT_WIDGET",
                "TICKET",
                "CALL_IVR"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "QUEUED",
                "SENT",
                "DELIVERED",
                "RESPONDED",
                "BOUNCED",
                "FAILED",
                "CANCELLED"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List survey invitations",
        "tags": [
          "Surveys - Invitations"
        ]
      }
    },
    "/v1/surveys/invitations/manual": {
      "post": {
        "operationId": "SurveyInvitationsController_createManualInvitation",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateManualSurveyInvitationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a manual survey invitation",
        "tags": [
          "Surveys - Invitations"
        ]
      }
    },
    "/v1/surveys/invitations/{invitationId}": {
      "get": {
        "operationId": "SurveyInvitationsController_getInvitation",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a specific invitation",
        "tags": [
          "Surveys - Invitations"
        ]
      }
    },
    "/v1/surveys/invitations/{invitationId}/cancel": {
      "patch": {
        "operationId": "SurveyInvitationsController_cancelInvitation",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel an invitation",
        "tags": [
          "Surveys - Invitations"
        ]
      }
    },
    "/v1/surveys/invitations/{invitationId}/reschedule": {
      "patch": {
        "operationId": "SurveyInvitationsController_rescheduleInvitation",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RescheduleSurveyInvitationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reschedule a queued invitation",
        "tags": [
          "Surveys - Invitations"
        ]
      }
    },
    "/v1/surveys/invitations/{invitationId}/resend": {
      "post": {
        "operationId": "SurveyInvitationsController_resendInvitation",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Resend an invitation",
        "tags": [
          "Surveys - Invitations"
        ]
      }
    },
    "/v1/surveys/metrics/breakdown": {
      "get": {
        "operationId": "SurveyMetricsController_getBreakdown",
        "parameters": [
          {
            "in": "query",
            "name": "templateId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO string start datetime",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO string end datetime",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "enum": [
                "EMAIL",
                "SMS",
                "WHATSAPP",
                "CHAT_WIDGET",
                "TICKET",
                "CALL_IVR"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dimension",
            "required": true,
            "schema": {
              "enum": [
                "channel",
                "template"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get survey metrics breakdown by dimension",
        "tags": [
          "Surveys - Metrics"
        ]
      }
    },
    "/v1/surveys/metrics/overview": {
      "get": {
        "operationId": "SurveyMetricsController_getOverview",
        "parameters": [
          {
            "in": "query",
            "name": "templateId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO string start datetime",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO string end datetime",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "enum": [
                "EMAIL",
                "SMS",
                "WHATSAPP",
                "CHAT_WIDGET",
                "TICKET",
                "CALL_IVR"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get survey performance overview",
        "tags": [
          "Surveys - Metrics"
        ]
      }
    },
    "/v1/surveys/responses": {
      "get": {
        "operationId": "SurveyResponsesController_listResponses",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortOrder",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "templateId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "appointmentId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "minScore",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "maxScore",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "example": "2025-01-01",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "example": "2025-01-31",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List survey responses",
        "tags": [
          "Surveys - Responses"
        ]
      },
      "post": {
        "operationId": "SurveyResponsesController_createResponse",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurveyResponseDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record a response manually (e.g., admin input)",
        "tags": [
          "Surveys - Responses"
        ]
      }
    },
    "/v1/surveys/responses/{responseId}": {
      "get": {
        "operationId": "SurveyResponsesController_getResponse",
        "parameters": [
          {
            "in": "path",
            "name": "responseId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a single response",
        "tags": [
          "Surveys - Responses"
        ]
      }
    },
    "/v1/surveys/templates": {
      "get": {
        "operationId": "SurveyTemplatesController_listTemplates",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sortOrder",
            "required": false,
            "schema": {
              "default": "desc",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "scoreType",
            "required": false,
            "schema": {
              "enum": [
                "NPS",
                "CSAT",
                "CES",
                "CUSTOM"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "enum": [
                "EMAIL",
                "SMS",
                "WHATSAPP",
                "CHAT_WIDGET",
                "TICKET",
                "CALL_IVR"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveyTemplateListResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List survey templates for the organization",
        "tags": [
          "Surveys - Templates"
        ]
      },
      "post": {
        "operationId": "SurveyTemplatesController_createTemplate",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSurveyTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveyTemplateResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new survey template",
        "tags": [
          "Surveys - Templates"
        ]
      }
    },
    "/v1/surveys/templates/{templateId}": {
      "get": {
        "operationId": "SurveyTemplatesController_getTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveyTemplateResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a single survey template",
        "tags": [
          "Surveys - Templates"
        ]
      },
      "put": {
        "operationId": "SurveyTemplatesController_updateTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurveyTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveyTemplateResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an existing survey template",
        "tags": [
          "Surveys - Templates"
        ]
      }
    },
    "/v1/surveys/templates/{templateId}/duplicate": {
      "post": {
        "operationId": "SurveyTemplatesController_duplicateTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DuplicateSurveyTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveyTemplateResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Duplicate a survey template",
        "tags": [
          "Surveys - Templates"
        ]
      }
    },
    "/v1/surveys/templates/{templateId}/status": {
      "patch": {
        "operationId": "SurveyTemplatesController_updateTemplateStatus",
        "parameters": [
          {
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurveyTemplateStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveyTemplateResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Enable or disable a survey template",
        "tags": [
          "Surveys - Templates"
        ]
      }
    },
    "/v1/surveys/{id}": {
      "delete": {
        "operationId": "SurveysController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete survey (template)",
        "tags": [
          "Surveys (Frontend Contract)"
        ]
      },
      "get": {
        "operationId": "SurveysController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get survey (template) with questions",
        "tags": [
          "Surveys (Frontend Contract)"
        ]
      },
      "patch": {
        "operationId": "SurveysController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSurveyFrontendDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update survey (template)",
        "tags": [
          "Surveys (Frontend Contract)"
        ]
      }
    },
    "/v1/surveys/{id}/publish": {
      "post": {
        "operationId": "SurveysController_publish",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish survey (generate share URL + embed code)",
        "tags": [
          "Surveys (Frontend Contract)"
        ]
      }
    },
    "/v1/surveys/{id}/responses": {
      "get": {
        "operationId": "SurveysController_listResponses",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List survey responses (by template id)",
        "tags": [
          "Surveys (Frontend Contract)"
        ]
      }
    },
    "/v1/tags": {
      "get": {
        "operationId": "TagsController_list",
        "parameters": [
          {
            "description": "Filter tags by name (case-insensitive)",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort by name, usage_count, created_at (default: name)",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Tags retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List all tags for organization",
        "tags": [
          "tags"
        ]
      },
      "post": {
        "operationId": "TagsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTagDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationTagDto"
                }
              }
            },
            "description": "Tag created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create tag",
        "tags": [
          "tags"
        ]
      }
    },
    "/v1/tags/{id}": {
      "delete": {
        "operationId": "TagsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tag deleted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete tag",
        "tags": [
          "tags"
        ]
      },
      "put": {
        "operationId": "TagsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTagDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationTagDto"
                }
              }
            },
            "description": "Tag updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update tag",
        "tags": [
          "tags"
        ]
      }
    },
    "/v1/tasks": {
      "get": {
        "description": "Retrieves a paginated list of tasks for the current organization. Supports filtering by ownership, status, priority, and related CRM records.",
        "operationId": "TasksController_findAll",
        "parameters": [
          {
            "description": "Filter by task status (e.g., OPEN, COMPLETED).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by priority. Accepts values defined in the task model.",
            "in": "query",
            "name": "priority",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to tasks linked to a specific contact.",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to tasks linked to a specific company.",
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to tasks linked to a specific deal.",
            "in": "query",
            "name": "dealId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only include tasks owned by the provided teammate ID.",
            "in": "query",
            "name": "ownerId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Maximum tasks to return. Defaults to service-level pagination.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "description": "Number of records to skip before returning results.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tasks retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all tasks",
        "tags": [
          "crm-tasks"
        ]
      },
      "post": {
        "description": "Creates a CRM task assigned to a teammate or contact. Tasks can be tied to contacts, companies, or deals for follow-up.",
        "operationId": "TasksController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Task created successfully"
          },
          "400": {
            "description": "Invalid input data"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new task",
        "tags": [
          "crm-tasks"
        ]
      }
    },
    "/v1/tasks/count": {
      "get": {
        "description": "Returns a filtered count of tasks for badge/notification use cases. Combine filters to match what a user sees in list views.",
        "operationId": "TasksController_getCount",
        "parameters": [
          {
            "description": "Filter by task status (e.g., OPEN for TODOs).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by task priority (e.g., HIGH, MEDIUM, LOW).",
            "in": "query",
            "name": "priority",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to tasks related to a contact.",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to tasks related to a company.",
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to tasks related to a deal.",
            "in": "query",
            "name": "dealId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only count tasks owned by the provided teammate ID.",
            "in": "query",
            "name": "ownerId",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task count retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get task count (useful for notifications/badges)",
        "tags": [
          "crm-tasks"
        ]
      }
    },
    "/v1/tasks/{id}": {
      "delete": {
        "description": "Deletes a task permanently. Consider using status updates when historical auditing is required.",
        "operationId": "TasksController_remove",
        "parameters": [
          {
            "description": "Task identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task deleted successfully"
          },
          "404": {
            "description": "Task not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete task",
        "tags": [
          "crm-tasks"
        ]
      },
      "get": {
        "description": "Retrieves details for a single task, including related CRM entities, ensuring it belongs to the organization in context.",
        "operationId": "TasksController_findOne",
        "parameters": [
          {
            "description": "Task identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task retrieved successfully"
          },
          "404": {
            "description": "Task not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get task by ID",
        "tags": [
          "crm-tasks"
        ]
      },
      "patch": {
        "description": "Performs a partial update on a task. Use to mark completion, adjust due dates, or reassign ownership.",
        "operationId": "TasksController_update",
        "parameters": [
          {
            "description": "Task identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTaskDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Task updated successfully"
          },
          "404": {
            "description": "Task not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update task",
        "tags": [
          "crm-tasks"
        ]
      }
    },
    "/v1/team-hub/settings": {
      "get": {
        "operationId": "TeamHubSettingsAliasController_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current user's Team Hub settings (alias)",
        "tags": [
          "team-hub"
        ]
      },
      "put": {
        "operationId": "TeamHubSettingsAliasController_put",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTeamHubSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update current user's Team Hub settings (alias)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/auto-detect": {
      "post": {
        "description": "Scrapes the provided URL (Firecrawl if configured, heuristic otherwise) and runs OpenAI over the content to extract candidate team members. Returns suggestions — the frontend is expected to present these for user review before persisting.",
        "operationId": "TeamDetectionController_autoDetect",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "hintPath": {
                    "example": "/about",
                    "type": "string"
                  },
                  "websiteUrl": {
                    "example": "https://example-plumbing.com/team",
                    "type": "string"
                  }
                },
                "required": [
                  "websiteUrl"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Detected team members (may be an empty list if none found)."
          },
          "400": {
            "description": "Invalid URL or extraction failed."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Auto-detect team members from a public website",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/channels": {
      "get": {
        "operationId": "TeamChannelsController_list",
        "parameters": [
          {
            "in": "query",
            "name": "include_archived",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List team channels",
        "tags": [
          "team-hub"
        ]
      },
      "post": {
        "operationId": "TeamChannelsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTeamChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a channel",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/channels/{channelId}": {
      "delete": {
        "operationId": "TeamChannelsController_archive",
        "parameters": [
          {
            "in": "path",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Archive a channel",
        "tags": [
          "team-hub"
        ]
      },
      "patch": {
        "operationId": "TeamChannelsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTeamChannelDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a channel",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/channels/{channelId}/members": {
      "get": {
        "operationId": "TeamChannelsController_members",
        "parameters": [
          {
            "in": "path",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List channel members",
        "tags": [
          "team-hub"
        ]
      },
      "post": {
        "operationId": "TeamChannelsController_addMember",
        "parameters": [
          {
            "in": "path",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddTeamChannelMemberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a member to a private channel",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/channels/{channelId}/members/{userId}": {
      "delete": {
        "operationId": "TeamChannelsController_removeMember",
        "parameters": [
          {
            "in": "path",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a member from a private channel",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/channels/{channelId}/messages": {
      "get": {
        "operationId": "TeamMessagesController_channelMessages",
        "parameters": [
          {
            "in": "path",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get channel messages (cursor pagination)",
        "tags": [
          "team-hub"
        ]
      },
      "post": {
        "operationId": "TeamMessagesController_sendChannelMessage",
        "parameters": [
          {
            "in": "path",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTeamMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a channel message",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/channels/{channelId}/read": {
      "post": {
        "operationId": "TeamMessagesController_markChannelRead",
        "parameters": [
          {
            "in": "path",
            "name": "channelId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkReadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark channel as read (update read receipt)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/conversations": {
      "get": {
        "operationId": "TeamConversationsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List DM conversations for current user",
        "tags": [
          "team-hub"
        ]
      },
      "post": {
        "operationId": "TeamConversationsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDmConversationDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create or get an existing DM conversation",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/conversations/{conversationId}/messages": {
      "get": {
        "operationId": "TeamConversationsController_messages",
        "parameters": [
          {
            "in": "path",
            "name": "conversationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get DM messages (cursor pagination)",
        "tags": [
          "team-hub"
        ]
      },
      "post": {
        "operationId": "TeamConversationsController_send",
        "parameters": [
          {
            "in": "path",
            "name": "conversationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTeamMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a DM message",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/conversations/{conversationId}/read": {
      "post": {
        "operationId": "TeamConversationsController_markRead",
        "parameters": [
          {
            "in": "path",
            "name": "conversationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkReadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark DM as read (update read receipt)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/files/upload": {
      "post": {
        "operationId": "TeamFilesController_upload",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a team hub file (Filestack-backed)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/invitations": {
      "get": {
        "operationId": "TeamInvitationsController_listInvitations",
        "parameters": [
          {
            "description": "Filter invitations by status (defaults to pending). Use \"all\" for every status.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "example": "pending",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team invitations retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List team invitations",
        "tags": [
          "team-management"
        ]
      }
    },
    "/v1/team/link-preview": {
      "post": {
        "operationId": "TeamLinkPreviewController_preview",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch link preview metadata (Microlink-backed, best-effort)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/members": {
      "get": {
        "operationId": "TeamManagementController_getTeamMembers",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Team members retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List team members",
        "tags": [
          "team-management"
        ]
      }
    },
    "/v1/team/members/invite": {
      "post": {
        "operationId": "TeamManagementController_inviteMember",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteMemberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Member invited successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Invite new team member",
        "tags": [
          "team-management"
        ]
      }
    },
    "/v1/team/members/{id}": {
      "delete": {
        "operationId": "TeamManagementController_removeTeamMember",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team member removed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove team member",
        "tags": [
          "team-management"
        ]
      },
      "get": {
        "operationId": "TeamManagementController_getTeamMember",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team member retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get team member",
        "tags": [
          "team-management"
        ]
      },
      "patch": {
        "operationId": "TeamManagementController_updateTeamMember",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTeamMemberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Team member updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update team member",
        "tags": [
          "team-management"
        ]
      }
    },
    "/v1/team/members/{id}/reset-password": {
      "post": {
        "operationId": "TeamManagementController_resetPassword",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password reset email sent successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reset team member password",
        "tags": [
          "team-management"
        ]
      }
    },
    "/v1/team/members/{id}/role": {
      "patch": {
        "operationId": "TeamManagementController_changeMemberRole",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeMemberRoleDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Member role updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change team member role",
        "tags": [
          "team-management"
        ]
      }
    },
    "/v1/team/mentions": {
      "get": {
        "operationId": "TeamMentionsController_list",
        "parameters": [
          {
            "in": "query",
            "name": "unread_only",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get mentions for current user",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/mentions/read": {
      "post": {
        "operationId": "TeamMentionsController_markRead",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkMentionsReadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark mentions as read",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/messages/{messageId}": {
      "delete": {
        "operationId": "TeamMessagesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Soft-delete a message (sender or admin)",
        "tags": [
          "team-hub"
        ]
      },
      "patch": {
        "operationId": "TeamMessagesController_edit",
        "parameters": [
          {
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditTeamMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Edit a message (sender-only, within 15 minutes)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/messages/{messageId}/pin": {
      "post": {
        "operationId": "TeamMessagesController_pin",
        "parameters": [
          {
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Toggle pin on a message (admin only)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/messages/{messageId}/reactions": {
      "post": {
        "operationId": "TeamMessagesController_addReaction",
        "parameters": [
          {
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddReactionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a reaction",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/messages/{messageId}/reactions/{emoji}": {
      "delete": {
        "operationId": "TeamMessagesController_removeReaction",
        "parameters": [
          {
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "emoji",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a reaction",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/messages/{messageId}/replies": {
      "get": {
        "operationId": "TeamMessagesController_threadReplies",
        "parameters": [
          {
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get thread replies for a root message (cursor pagination)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/presence": {
      "get": {
        "operationId": "TeamPresenceController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get presence for org members (durable status list)",
        "tags": [
          "team-hub"
        ]
      },
      "put": {
        "operationId": "TeamPresenceController_update",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePresenceDto"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Presence updated or degraded state returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update current user's presence (durable status)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/search": {
      "get": {
        "operationId": "TeamSearchController_search",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search team hub messages (simple v1 contains match)",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/self-notes": {
      "get": {
        "operationId": "TeamSelfNotesController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List current user's self notes",
        "tags": [
          "team-hub"
        ]
      },
      "post": {
        "operationId": "TeamSelfNotesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSelfNoteDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a self note",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/self-notes/{noteId}": {
      "delete": {
        "operationId": "TeamSelfNotesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "noteId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a self note",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/settings": {
      "get": {
        "operationId": "TeamSettingsController_get",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current user's Team Hub settings",
        "tags": [
          "team-hub"
        ]
      },
      "put": {
        "operationId": "TeamSettingsController_put",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTeamHubSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update current user's Team Hub settings",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/team/status-updates": {
      "get": {
        "operationId": "TeamStatusUpdatesController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get recent status updates for org",
        "tags": [
          "team-hub"
        ]
      },
      "post": {
        "operationId": "TeamStatusUpdatesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTeamStatusUpdateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Post a new status update",
        "tags": [
          "team-hub"
        ]
      }
    },
    "/v1/ticket-categories": {
      "get": {
        "operationId": "TicketCategoriesController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Ticket categories retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List ticket categories",
        "tags": [
          "ticket-categories"
        ]
      },
      "post": {
        "operationId": "TicketCategoriesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTicketCategoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Ticket category created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create ticket category",
        "tags": [
          "ticket-categories"
        ]
      }
    },
    "/v1/ticket-categories/{id}": {
      "delete": {
        "operationId": "TicketCategoriesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket category deleted successfully"
          },
          "404": {
            "description": "Ticket category not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a ticket category",
        "tags": [
          "ticket-categories"
        ]
      },
      "get": {
        "operationId": "TicketCategoriesController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket category retrieved successfully"
          },
          "404": {
            "description": "Ticket category not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a ticket category by ID",
        "tags": [
          "ticket-categories"
        ]
      },
      "put": {
        "operationId": "TicketCategoriesController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTicketCategoryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ticket category updated successfully"
          },
          "404": {
            "description": "Ticket category not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a ticket category",
        "tags": [
          "ticket-categories"
        ]
      }
    },
    "/v1/ticket-priorities": {
      "get": {
        "operationId": "TicketPrioritiesController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Ticket priorities retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List all ticket priorities",
        "tags": [
          "ticket-priorities"
        ]
      },
      "post": {
        "operationId": "TicketPrioritiesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTicketPriorityDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Ticket priority created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create ticket priority",
        "tags": [
          "ticket-priorities"
        ]
      }
    },
    "/v1/ticket-priorities/reorder": {
      "patch": {
        "operationId": "TicketPrioritiesController_reorder",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderPrioritiesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Priorities reordered successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder ticket priorities by updating their levels",
        "tags": [
          "ticket-priorities"
        ]
      }
    },
    "/v1/ticket-priorities/{id}": {
      "delete": {
        "operationId": "TicketPrioritiesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket priority deleted successfully"
          },
          "404": {
            "description": "Ticket priority not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a ticket priority",
        "tags": [
          "ticket-priorities"
        ]
      },
      "get": {
        "operationId": "TicketPrioritiesController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket priority retrieved successfully"
          },
          "404": {
            "description": "Ticket priority not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a ticket priority by ID",
        "tags": [
          "ticket-priorities"
        ]
      },
      "put": {
        "operationId": "TicketPrioritiesController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTicketPriorityDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ticket priority updated successfully"
          },
          "404": {
            "description": "Ticket priority not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a ticket priority",
        "tags": [
          "ticket-priorities"
        ]
      }
    },
    "/v1/ticket-slas": {
      "get": {
        "operationId": "TicketSlasController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Ticket SLAs retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List all ticket SLAs",
        "tags": [
          "ticket-slas"
        ]
      },
      "post": {
        "operationId": "TicketSlasController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTicketSlaDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Ticket SLA created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create ticket SLA",
        "tags": [
          "ticket-slas"
        ]
      }
    },
    "/v1/ticket-slas/{id}": {
      "delete": {
        "operationId": "TicketSlasController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket SLA deleted successfully"
          },
          "404": {
            "description": "Ticket SLA not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a ticket SLA",
        "tags": [
          "ticket-slas"
        ]
      },
      "get": {
        "operationId": "TicketSlasController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket SLA retrieved successfully"
          },
          "404": {
            "description": "Ticket SLA not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a ticket SLA by ID",
        "tags": [
          "ticket-slas"
        ]
      },
      "put": {
        "operationId": "TicketSlasController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTicketSlaDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ticket SLA updated successfully"
          },
          "404": {
            "description": "Ticket SLA not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a ticket SLA",
        "tags": [
          "ticket-slas"
        ]
      }
    },
    "/v1/ticket-templates": {
      "get": {
        "operationId": "TicketTemplatesController_list",
        "parameters": [
          {
            "description": "Search across title/content/shortcut/category",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket templates retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List all ticket templates (canned responses)",
        "tags": [
          "ticket-templates"
        ]
      },
      "post": {
        "operationId": "TicketTemplatesController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTicketTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Ticket template created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a ticket template (canned response)",
        "tags": [
          "ticket-templates"
        ]
      }
    },
    "/v1/ticket-templates/{id}": {
      "delete": {
        "operationId": "TicketTemplatesController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket template deleted successfully"
          },
          "404": {
            "description": "Ticket template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a ticket template",
        "tags": [
          "ticket-templates"
        ]
      },
      "get": {
        "operationId": "TicketTemplatesController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket template retrieved successfully"
          },
          "404": {
            "description": "Ticket template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a single ticket template by ID",
        "tags": [
          "ticket-templates"
        ]
      },
      "put": {
        "operationId": "TicketTemplatesController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTicketTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ticket template updated successfully"
          },
          "404": {
            "description": "Ticket template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a ticket template",
        "tags": [
          "ticket-templates"
        ]
      }
    },
    "/v1/ticket-templates/{id}/increment-usage": {
      "post": {
        "operationId": "TicketTemplatesController_incrementUsage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usage incremented successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Increment usage counter for a ticket template",
        "tags": [
          "ticket-templates"
        ]
      }
    },
    "/v1/tickets": {
      "get": {
        "operationId": "TicketsController_findAll",
        "parameters": [
          {
            "description": "Page number for pagination",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "description": "Number of items per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "OPEN",
                "IN_PROGRESS",
                "WAITING_ON_CUSTOMER",
                "WAITING_ON_THIRD_PARTY",
                "RESOLVED",
                "CLOSED",
                "CANCELLED"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "priority",
            "required": false,
            "schema": {
              "enum": [
                "URGENT",
                "HIGH",
                "MEDIUM",
                "LOW"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by contact ID",
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by company ID",
            "in": "query",
            "name": "companyId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by assigned user ID",
            "in": "query",
            "name": "assignedToId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by assigned team",
            "in": "query",
            "name": "assignedTeam",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by category",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by tags",
            "in": "query",
            "name": "tags",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "EMAIL",
                "SMS",
                "WHATSAPP",
                "WEB_FORM",
                "PHONE",
                "API",
                "MANUAL",
                "CHAT"
              ],
              "type": "string"
            }
          },
          {
            "description": "Search query for subject/description",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by created after date",
            "in": "query",
            "name": "createdAfter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by created before date",
            "in": "query",
            "name": "createdBefore",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by due after date",
            "in": "query",
            "name": "dueAfter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by due before date",
            "in": "query",
            "name": "dueBefore",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort by field",
            "in": "query",
            "name": "sortBy",
            "required": false,
            "schema": {
              "default": "createdAt",
              "type": "string"
            }
          },
          {
            "description": "Sort order",
            "in": "query",
            "name": "sortOrder",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string"
            }
          },
          {
            "description": "Filter by unassigned tickets",
            "in": "query",
            "name": "unassigned",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Filter by overdue tickets",
            "in": "query",
            "name": "overdue",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tickets retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all tickets with filtering",
        "tags": [
          "Tickets"
        ]
      },
      "post": {
        "operationId": "TicketsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTicketDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Ticket created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/ai/auto-create": {
      "post": {
        "operationId": "TicketsController_shouldAutoCreateTicket",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Decision completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Decide if a message should auto-create a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/ai/classify": {
      "post": {
        "operationId": "TicketsController_classifyTicket",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Classification completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Classify ticket content using AI",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/from-thread/{threadId}": {
      "post": {
        "operationId": "TicketsController_convertThreadToTicket",
        "parameters": [
          {
            "in": "path",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvertThreadToTicketDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Ticket created from thread successfully"
          },
          "400": {
            "description": "Thread already linked to a ticket"
          },
          "404": {
            "description": "Message thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Convert a message thread to a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/statistics": {
      "get": {
        "operationId": "TicketsController_getStatistics",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Statistics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get ticket statistics",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}": {
      "delete": {
        "operationId": "TicketsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket deleted successfully"
          },
          "404": {
            "description": "Ticket not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a ticket",
        "tags": [
          "Tickets"
        ]
      },
      "get": {
        "operationId": "TicketsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket retrieved successfully"
          },
          "404": {
            "description": "Ticket not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a single ticket by ID",
        "tags": [
          "Tickets"
        ]
      },
      "patch": {
        "operationId": "TicketsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTicketDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ticket updated successfully"
          },
          "404": {
            "description": "Ticket not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/activities": {
      "get": {
        "operationId": "TicketsController_getActivities",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activities retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all activities for a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/ai/check-escalation": {
      "post": {
        "operationId": "TicketsController_checkEscalation",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Escalation check completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check if ticket should be escalated",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/ai/predict-resolution": {
      "post": {
        "operationId": "TicketsController_predictResolutionTime",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Prediction completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Predict ticket resolution time",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/ai/suggest-assignment": {
      "post": {
        "operationId": "TicketsController_suggestAssignee",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suggestion completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Suggest best assignee for a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/ai/suggest-reply": {
      "post": {
        "operationId": "TicketsController_generateReplyDrafts",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reply drafts generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate AI-powered reply drafts for a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/ai/summarize": {
      "post": {
        "operationId": "TicketsController_summarizeTicket",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Summary generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate AI summary of a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/appointments": {
      "get": {
        "operationId": "TicketsController_getLinkedAppointments",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get appointments linked to a ticket (if any)",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/comments": {
      "get": {
        "operationId": "TicketsController_getComments",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comments retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all comments for a ticket",
        "tags": [
          "Tickets"
        ]
      },
      "post": {
        "operationId": "TicketsController_addComment",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTicketCommentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Comment added successfully"
          },
          "404": {
            "description": "Ticket not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a comment to a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/comments/{commentId}": {
      "delete": {
        "operationId": "TicketsController_deleteComment",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "commentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comment deleted successfully"
          },
          "403": {
            "description": "Not allowed to delete this comment"
          },
          "404": {
            "description": "Ticket or comment not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a comment from a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/invoices": {
      "get": {
        "operationId": "TicketsController_getLinkedInvoices",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get invoices linked to a ticket (if any)",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/link-appointment/{appointmentId}": {
      "post": {
        "operationId": "TicketsController_linkAppointment",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "appointmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Ticket linked to appointment successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Link a ticket to an appointment",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/link-invoice/{invoiceId}": {
      "post": {
        "operationId": "TicketsController_linkInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Ticket linked to invoice successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Link a ticket to an invoice",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/link-thread/{threadId}": {
      "post": {
        "operationId": "TicketsController_linkThread",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "threadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Ticket linked to thread successfully"
          },
          "400": {
            "description": "Ticket or thread already linked"
          },
          "404": {
            "description": "Ticket or thread not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Link an existing ticket to a message thread",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/thread": {
      "get": {
        "operationId": "TicketsController_getLinkedThread",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get the message thread linked to a ticket (if any)",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/unlink-appointment/{appointmentId}": {
      "post": {
        "operationId": "TicketsController_unlinkAppointment",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "appointmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appointment unlinked successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Unlink a ticket from an appointment",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/unlink-invoice/{invoiceId}": {
      "post": {
        "operationId": "TicketsController_unlinkInvoice",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice unlinked successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Unlink a ticket from an invoice",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/tickets/{id}/unlink-thread": {
      "post": {
        "operationId": "TicketsController_unlinkThread",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Thread unlinked successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Unlink the message thread from a ticket",
        "tags": [
          "Tickets"
        ]
      }
    },
    "/v1/time-entries": {
      "get": {
        "operationId": "TimeTrackingController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "isBillable",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "contactId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "taskId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "projectId",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Time entries retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all time entries",
        "tags": [
          "time-tracking"
        ]
      },
      "post": {
        "operationId": "TimeTrackingController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTimeEntryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Time entry created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new time entry",
        "tags": [
          "time-tracking"
        ]
      }
    },
    "/v1/time-entries/billable-hours": {
      "get": {
        "operationId": "TimeTrackingController_getBillableHours",
        "parameters": [
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "taskId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "projectId",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Billable hours retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get billable hours summary",
        "tags": [
          "time-tracking"
        ]
      }
    },
    "/v1/time-entries/timer/start": {
      "post": {
        "operationId": "TimeTrackingController_startTimer",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Timer started successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start a timer",
        "tags": [
          "time-tracking"
        ]
      }
    },
    "/v1/time-entries/timer/{id}/stop": {
      "post": {
        "operationId": "TimeTrackingController_stopTimer",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Timer stopped successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Stop a running timer",
        "tags": [
          "time-tracking"
        ]
      }
    },
    "/v1/time-entries/{id}": {
      "delete": {
        "operationId": "TimeTrackingController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time entry deleted successfully"
          },
          "404": {
            "description": "Time entry not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a time entry",
        "tags": [
          "time-tracking"
        ]
      },
      "get": {
        "operationId": "TimeTrackingController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time entry retrieved successfully"
          },
          "404": {
            "description": "Time entry not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a time entry by ID",
        "tags": [
          "time-tracking"
        ]
      },
      "patch": {
        "operationId": "TimeTrackingController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTimeEntryDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Time entry updated successfully"
          },
          "404": {
            "description": "Time entry not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a time entry",
        "tags": [
          "time-tracking"
        ]
      }
    },
    "/v1/tools/calculations": {
      "get": {
        "operationId": "ToolsController_getCalculationHistory",
        "parameters": [
          {
            "in": "query",
            "name": "toolId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "History retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get calculation history",
        "tags": [
          "Tools & Calculators"
        ]
      }
    },
    "/v1/tools/categories/{industry}": {
      "get": {
        "operationId": "ToolsController_getToolCategories",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Categories retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get tool categories for industry",
        "tags": [
          "Tools & Calculators"
        ]
      }
    },
    "/v1/tools/industry/{industry}": {
      "get": {
        "operationId": "ToolsController_getIndustryTools",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tools retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific tools",
        "tags": [
          "Tools & Calculators"
        ]
      }
    },
    "/v1/tools/{toolId}/calculate": {
      "post": {
        "operationId": "ToolsController_calculateTool",
        "parameters": [
          {
            "in": "path",
            "name": "toolId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateToolDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Calculation completed successfully"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Tool not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Execute tool calculation",
        "tags": [
          "Tools & Calculators"
        ]
      }
    },
    "/v1/trustpilot-callback": {
      "get": {
        "operationId": "TrustpilotCompatOAuthController_callback",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "error",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns HTML that posts a message to opener"
          }
        },
        "summary": "Trustpilot OAuth callback (compat)",
        "tags": [
          "Trustpilot OAuth (compat)"
        ]
      }
    },
    "/v1/trustpilot-oauth": {
      "get": {
        "operationId": "TrustpilotCompatOAuthController_initiateGet",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate Trustpilot OAuth URL (GET alias)",
        "tags": [
          "Trustpilot OAuth (compat)"
        ]
      },
      "post": {
        "operationId": "TrustpilotCompatOAuthController_initiate",
        "parameters": [
          {
            "in": "query",
            "name": "locationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate Trustpilot OAuth URL (compat)",
        "tags": [
          "Trustpilot OAuth (compat)"
        ]
      }
    },
    "/v1/uploads": {
      "post": {
        "operationId": "UploadsController_upload",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "context": {
                    "example": "email-attachment",
                    "type": "string"
                  },
                  "file": {
                    "description": "Max 1MB on free plan, 10MB on paid plan",
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "File uploaded successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a file attachment",
        "tags": [
          "uploads"
        ]
      }
    },
    "/v1/usage/budget": {
      "post": {
        "operationId": "UsageController_setBudget",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Budget set successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set usage budget",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/budget/status": {
      "get": {
        "operationId": "UsageController_checkBudget",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Budget status retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check budget status",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/by-type/{type}": {
      "get": {
        "operationId": "UsageController_getByType",
        "parameters": [
          {
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usage by type retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get usage by type",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/events": {
      "post": {
        "operationId": "UsageController_recordEvent",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUsageEventDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Usage event recorded successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record usage event",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/invoice": {
      "post": {
        "operationId": "UsageController_generateInvoice",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Invoice generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate usage invoice",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/rate-limit/check": {
      "post": {
        "operationId": "UsageController_checkRateLimit",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Rate limit check completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check rate limit",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/summary": {
      "get": {
        "operationId": "UsageController_getSummary",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usage summary retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get usage summary",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/wallet": {
      "get": {
        "operationId": "UsageController_getWallet",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credit wallet retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get credit wallet balance",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/wallet/add": {
      "post": {
        "operationId": "UsageController_addCredits",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credits added successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add credits to wallet",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/usage/wallet/deduct": {
      "post": {
        "operationId": "UsageController_deductCredits",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Credits deducted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Deduct credits from wallet",
        "tags": [
          "analytics-usage"
        ]
      }
    },
    "/v1/users/permissions": {
      "get": {
        "operationId": "UsersController_getPermissions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Permissions retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get current user permissions",
        "tags": [
          "Users"
        ]
      },
      "patch": {
        "operationId": "UsersController_updatePermissions",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserPermissionsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Permissions updated successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update current user permissions",
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/users/preferences": {
      "get": {
        "operationId": "UsersController_getPreferences",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Preferences retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get user preferences",
        "tags": [
          "Users"
        ]
      },
      "put": {
        "operationId": "UsersController_updatePreferences",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserPreferencesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preferences updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update user preferences",
        "tags": [
          "Users"
        ]
      }
    },
    "/v1/vector-test/find-similar-contacts/{orgId}": {
      "post": {
        "description": "Generates an embedding for the query text and searches for similar contacts.",
        "operationId": "VectorTestController_findSimilarContacts",
        "parameters": [
          {
            "description": "Organization identifier",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Similar contacts retrieved successfully"
          },
          "403": {
            "description": "Organization mismatch"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find similar contacts",
        "tags": [
          "vector-test"
        ]
      }
    },
    "/v1/vector-test/find-similar-knowledge/{orgId}": {
      "post": {
        "description": "Searches for similar knowledge base segments relative to the provided query text.",
        "operationId": "VectorTestController_findSimilarKnowledge",
        "parameters": [
          {
            "description": "Organization identifier",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Similar knowledge retrieved successfully"
          },
          "403": {
            "description": "Organization mismatch"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find similar knowledge segments",
        "tags": [
          "vector-test"
        ]
      }
    },
    "/v1/vector-test/generate-embedding": {
      "post": {
        "description": "Generates a vector embedding for provided text using the chosen model, returning diagnostic metadata.",
        "operationId": "VectorTestController_generateEmbedding",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Embedding generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate ad-hoc embedding",
        "tags": [
          "vector-test"
        ]
      }
    },
    "/v1/vector-test/migrate-embeddings": {
      "post": {
        "description": "Migrates existing embeddings to the latest schema or storage strategy.",
        "operationId": "VectorTestController_migrateEmbeddings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Embeddings migrated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Migrate legacy embeddings",
        "tags": [
          "vector-test"
        ]
      }
    },
    "/v1/vector-test/stats/{orgId}": {
      "get": {
        "description": "Returns embedding storage and count statistics scoped to the organization.",
        "operationId": "VectorTestController_getStats",
        "parameters": [
          {
            "description": "Organization identifier",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Embedding stats retrieved successfully"
          },
          "403": {
            "description": "Organization mismatch"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get embedding statistics",
        "tags": [
          "vector-test"
        ]
      }
    },
    "/v1/vector-test/store-contact-embedding/{orgId}/{contactId}": {
      "post": {
        "description": "Generates and stores an embedding for a contact record after verifying organization scope.",
        "operationId": "VectorTestController_storeContactEmbedding",
        "parameters": [
          {
            "description": "Organization identifier",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Contact identifier",
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact embedding stored successfully"
          },
          "403": {
            "description": "Organization mismatch"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Store contact embedding",
        "tags": [
          "vector-test"
        ]
      }
    },
    "/v1/vector-test/store-knowledge-embedding/{orgId}/{knowledgeBaseId}": {
      "post": {
        "description": "Generates and stores an embedding for a knowledge base entry or segment.",
        "operationId": "VectorTestController_storeKnowledgeEmbedding",
        "parameters": [
          {
            "description": "Organization identifier",
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Knowledge base identifier",
            "in": "path",
            "name": "knowledgeBaseId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Knowledge embedding stored successfully"
          },
          "403": {
            "description": "Organization mismatch"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Store knowledge embedding",
        "tags": [
          "vector-test"
        ]
      }
    },
    "/v1/voice-agents/{id}/sample-run": {
      "post": {
        "description": "Simulates a first-run voice-agent demo without phone provisioning, payments, or any external telephony side effects.",
        "operationId": "VoiceAgentSampleRunsController_runSampleCall",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Sample call simulation completed"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Run a deterministic voice agent sample call",
        "tags": [
          "voice-agents"
        ]
      }
    },
    "/v1/voice-agents/{id}/sample-runs/{runId}": {
      "get": {
        "operationId": "VoiceAgentSampleRunsController_getSampleCall",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sample call result retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch a deterministic voice agent sample-call result",
        "tags": [
          "voice-agents"
        ]
      }
    },
    "/v1/voice/browser/token": {
      "post": {
        "description": "Frontend uses this token with Twilio Voice JS to place a browser call into the org’s primary AI phone number.",
        "operationId": "VoiceBrowserController_createClientToken",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a Twilio Voice Client token (browser WebRTC calling)",
        "tags": [
          "voice-browser"
        ]
      }
    },
    "/v1/voice/handoff/consent": {
      "post": {
        "description": "Writes consent metadata onto Call.metadataJson.consent. Idempotent — a second call overwrites. Use `source: \"dtmf\"` when capturing via keypad, `\"prompt\"` when the AI asked explicitly, `\"greeting\"` when consent was implicit via the opening line.",
        "operationId": "VoiceHandoffController_recordConsent",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Consent recorded"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record recording/two-party-consent capture on a call",
        "tags": [
          "voice-handoff"
        ]
      }
    },
    "/v1/voice/handoff/{callId}/context": {
      "get": {
        "description": "Returns transcript (PII-redacted), sentiment timeline, tools already called, consent posture, customer state, and a heuristic suggested next action. Accepts Call.id, Twilio CallSid, or providerCallId.",
        "operationId": "VoiceHandoffController_getContext",
        "parameters": [
          {
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Handoff context payload"
          },
          "404": {
            "description": "Call not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Single-read handoff context for human agent pickup",
        "tags": [
          "voice-handoff"
        ]
      }
    },
    "/v1/voice/outbound": {
      "post": {
        "description": "Creates an outbound call through the configured voice agent.",
        "operationId": "VoiceOutboundController_triggerOutboundCall",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundCallRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundCallResponseDto"
                }
              }
            },
            "description": "Outbound call initiated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate an outbound AI voice call",
        "tags": [
          "voice"
        ]
      }
    },
    "/v1/voice/phone-numbers": {
      "get": {
        "description": "Returns all Twilio numbers purchased and stored for the organization.",
        "operationId": "VoicePhoneNumbersController_listPurchased",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Phone numbers retrieved successfully."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List purchased voice phone numbers",
        "tags": [
          "voice-phone-numbers"
        ]
      }
    },
    "/v1/voice/phone-numbers/available": {
      "get": {
        "description": "Searches Twilio for available voice-enabled numbers based on search filters.",
        "operationId": "VoicePhoneNumbersController_listAvailable",
        "parameters": [
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "areaCode",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "match",
            "required": false,
            "schema": {
              "enum": [
                "startsWith",
                "endsWith",
                "contains"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Available numbers retrieved successfully."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available Twilio phone numbers",
        "tags": [
          "voice-phone-numbers"
        ]
      }
    },
    "/v1/voice/phone-numbers/procure": {
      "post": {
        "description": "Buys a Twilio phone number and stores it for the organization with optional agent assignment.",
        "operationId": "VoicePhoneNumbersController_procureNumber",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProcurePhoneNumberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Phone number purchased successfully."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Purchase and register a Twilio phone number",
        "tags": [
          "voice-phone-numbers"
        ]
      }
    },
    "/v1/voice/phone-numbers/{id}": {
      "delete": {
        "description": "Releases a previously purchased Twilio phone number back to Twilio.",
        "operationId": "VoicePhoneNumbersController_releaseNumber",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Phone number released successfully."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Release a Twilio phone number",
        "tags": [
          "voice-phone-numbers"
        ]
      }
    },
    "/v1/voice/phone-numbers/{id}/assign": {
      "put": {
        "operationId": "VoicePhoneNumbersController_assignNumber",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignPhoneNumberDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Phone number assigned successfully."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Assign purchased number to a voice agent",
        "tags": [
          "voice-phone-numbers"
        ]
      }
    },
    "/v1/voice/preview": {
      "post": {
        "description": "Generates a short TTS preview for a selected UI voice. Returns base64 mp3 by default.",
        "operationId": "VoicePreviewController_preview",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoicePreviewRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoicePreviewResponseDto"
                }
              }
            },
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Voice preview (TTS)",
        "tags": [
          "voice"
        ]
      }
    },
    "/v1/voice/preview/voices": {
      "get": {
        "description": "Returns the UI voice catalog supported by POST /v1/voice/preview. Use this to populate the voice picker instead of hard-coding IDs on the frontend.",
        "operationId": "VoicePreviewController_listVoices",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available voice preview voices",
        "tags": [
          "voice"
        ]
      }
    },
    "/v1/voice/retell/webhook": {
      "post": {
        "operationId": "VoiceCallsController_handleRetellWebhook",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetellWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "voice-webhooks"
        ]
      }
    },
    "/v1/voice/twilio/inbound/initiate": {
      "post": {
        "operationId": "VoiceCallsController_handleTwilioInitiate",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "voice-webhooks"
        ]
      }
    },
    "/v1/voiceagent/agent": {
      "get": {
        "description": "Retrieves the current voice agent provisioning status, phone number, and latest synchronization details.",
        "operationId": "VoiceAgentManagementController_getVoiceAgent",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Agent status retrieved successfully"
          },
          "404": {
            "description": "Organization not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get customer voice agent status",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/agent/sync": {
      "post": {
        "description": "Pushes the latest AI knowledge base content to the provisioned voice agent.",
        "operationId": "VoiceAgentManagementController_syncKnowledgeBase",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Knowledge base synced successfully"
          },
          "404": {
            "description": "Voice agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync knowledge base to voice agent",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/agent/sync-from-ai-agent/{aiAgentId}": {
      "post": {
        "description": "Updates the Voice Agent system prompt and configuration to match the selected AI Agent (Brain).",
        "operationId": "VoiceAgentManagementController_syncFromAiAgent",
        "parameters": [
          {
            "description": "ID of the AI Agent to sync from",
            "in": "path",
            "name": "aiAgentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Voice Agent synced successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync Voice Agent from AI Agent",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/agent/test": {
      "post": {
        "description": "Initiates a diagnostic call to validate that the voice agent is reachable and functioning.",
        "operationId": "VoiceAgentManagementController_testAIAgent",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Agent test completed"
          },
          "400": {
            "description": "Missing or invalid phone number"
          },
          "404": {
            "description": "Voice agent not found"
          },
          "503": {
            "description": "Voice provider unavailable"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test voice agent",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/agent/update": {
      "post": {
        "description": "Applies configuration updates such as prompts and descriptions to the voice agent.",
        "operationId": "VoiceAgentManagementController_updateAgent",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Agent updated successfully"
          },
          "404": {
            "description": "Voice agent not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update voice agent configuration",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/agents/{agentId}": {
      "patch": {
        "operationId": "VoiceAgentKnowledgeController_updateAgentKnowledge",
        "parameters": [
          {
            "in": "path",
            "name": "agentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentKnowledgeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update voice agent knowledge sources (references to org KB articles)",
        "tags": [
          "voiceagent-knowledge"
        ]
      }
    },
    "/v1/voiceagent/agents/{agentId}/knowledge-status": {
      "get": {
        "operationId": "VoiceAgentKnowledgeController_knowledgeStatus",
        "parameters": [
          {
            "in": "path",
            "name": "agentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get agent knowledge status",
        "tags": [
          "voiceagent-knowledge"
        ]
      }
    },
    "/v1/voiceagent/agents/{agentId}/sync-knowledge": {
      "post": {
        "description": "Fetches org knowledge base articles (by IDs or all), queues embedding regeneration, and stamps knowledge_base_synced_at.",
        "operationId": "VoiceAgentKnowledgeController_syncKnowledge",
        "parameters": [
          {
            "in": "path",
            "name": "agentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncKnowledgeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync referenced org KB articles to this agent (index/embeddings)",
        "tags": [
          "voiceagent-knowledge"
        ]
      }
    },
    "/v1/voiceagent/analytics": {
      "get": {
        "description": "Returns aggregated analytics for voice agent calls including metrics, trends, and insights.",
        "operationId": "VoiceAgentManagementController_getCallAnalytics",
        "parameters": [
          {
            "description": "Time range for analytics (e.g., 30d, 7d). Ignored if startDate/endDate provided.",
            "in": "query",
            "name": "timeRange",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO start date (overrides timeRange when provided)",
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO end date (defaults to now when startDate provided)",
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Grouping granularity",
            "in": "query",
            "name": "groupBy",
            "required": false,
            "schema": {
              "enum": [
                "day",
                "week",
                "month"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call analytics retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call analytics",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/calls": {
      "get": {
        "operationId": "VoiceAgentCallsController_listCalls",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "minDuration",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "maxDuration",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call history retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call history",
        "tags": [
          "voiceagent-calls"
        ]
      }
    },
    "/v1/voiceagent/calls/{callId}": {
      "get": {
        "operationId": "VoiceAgentCallsController_getCallDetails",
        "parameters": [
          {
            "description": "Call identifier (external or internal)",
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call details retrieved successfully"
          },
          "404": {
            "description": "Call not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call details",
        "tags": [
          "voiceagent-calls"
        ]
      }
    },
    "/v1/voiceagent/calls/{callId}/recording": {
      "get": {
        "operationId": "VoiceAgentCallsController_getCallRecording",
        "parameters": [
          {
            "description": "Call identifier (external or internal)",
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get call recording",
        "tags": [
          "voiceagent-calls"
        ]
      }
    },
    "/v1/voiceagent/calls/{callId}/recording/download": {
      "get": {
        "operationId": "VoiceAgentCallsController_downloadRecording",
        "parameters": [
          {
            "description": "Call identifier (external or internal)",
            "in": "path",
            "name": "callId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download recording (streams file when possible)",
        "tags": [
          "voiceagent-calls"
        ]
      }
    },
    "/v1/voiceagent/onboard": {
      "post": {
        "description": "Creates and configures a new voice agent for the organization with business information and knowledge base.",
        "operationId": "VoiceAgentManagementController_onboardVoiceAgent",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Voice agent onboarded successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initialize Voice Agent (Onboarding)",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/onboarding-status": {
      "get": {
        "description": "Returns onboarding progress for voice agent setup steps.",
        "operationId": "VoiceAgentManagementController_getOnboardingStatus",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Onboarding status returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get voice onboarding completion status",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/phone-numbers": {
      "get": {
        "description": "Lists purchasable phone numbers that can be assigned to the voice agent.",
        "operationId": "VoiceAgentManagementController_getPhoneNumbers",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Phone numbers retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get available phone numbers",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/settings": {
      "put": {
        "description": "Updates voice agent configuration including voice settings, greeting, hours, and transfer settings.",
        "operationId": "VoiceAgentManagementController_updateVoiceAgentSettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Voice agent settings updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update Voice Agent settings",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/sync-knowledge-base": {
      "post": {
        "operationId": "VoiceAgentManagementController_syncKnowledgeBaseAlias",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Knowledge base synced successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Re-sync organization knowledge base to voice agent",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/voiceagent/test-call": {
      "post": {
        "operationId": "VoiceAgentManagementController_testCallAlias",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Test call initiated"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Initiate a voice agent test call",
        "tags": [
          "voiceagent-management"
        ]
      }
    },
    "/v1/webhooks/deliveries": {
      "get": {
        "description": "Returns the canonical paginated envelope `{ data, meta }` (BE-10). Same shape as `GET /v1/webhooks/endpoints` so FE never has to branch on which webhooks list it is rendering.",
        "operationId": "WebhooksController_getDeliveries",
        "parameters": [
          {
            "in": "query",
            "name": "webhookId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "eventType",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "properties": {
                        "limit": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total",
                        "page",
                        "limit",
                        "totalPages"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Paginated webhook deliveries."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get webhook delivery history",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/v1/webhooks/deliveries/{id}/replay": {
      "post": {
        "operationId": "WebhooksController_replayDelivery",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook replay initiated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replay webhook delivery",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/v1/webhooks/email/bounced": {
      "post": {
        "operationId": "EmailEventsWebhookController_bounced",
        "parameters": [
          {
            "in": "header",
            "name": "x-webhook-secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Email bounced webhook",
        "tags": [
          "Email Webhooks"
        ]
      }
    },
    "/v1/webhooks/email/clicked": {
      "post": {
        "operationId": "EmailEventsWebhookController_clicked",
        "parameters": [
          {
            "in": "header",
            "name": "x-webhook-secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Email clicked webhook",
        "tags": [
          "Email Webhooks"
        ]
      }
    },
    "/v1/webhooks/email/complained": {
      "post": {
        "operationId": "EmailEventsWebhookController_complained",
        "parameters": [
          {
            "in": "header",
            "name": "x-webhook-secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Email complained webhook",
        "tags": [
          "Email Webhooks"
        ]
      }
    },
    "/v1/webhooks/email/delivered": {
      "post": {
        "operationId": "EmailEventsWebhookController_delivered",
        "parameters": [
          {
            "in": "header",
            "name": "x-webhook-secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Email delivered webhook",
        "tags": [
          "Email Webhooks"
        ]
      }
    },
    "/v1/webhooks/email/opened": {
      "post": {
        "operationId": "EmailEventsWebhookController_opened",
        "parameters": [
          {
            "in": "header",
            "name": "x-webhook-secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Email opened webhook",
        "tags": [
          "Email Webhooks"
        ]
      }
    },
    "/v1/webhooks/email/unsubscribed": {
      "post": {
        "operationId": "EmailEventsWebhookController_unsubscribed",
        "parameters": [
          {
            "in": "header",
            "name": "x-webhook-secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Email unsubscribed webhook",
        "tags": [
          "Email Webhooks"
        ]
      }
    },
    "/v1/webhooks/emit": {
      "post": {
        "operationId": "WebhooksController_emitEvent",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Event emitted successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Emit webhook event (internal)",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/v1/webhooks/endpoints": {
      "get": {
        "description": "Returns the canonical paginated envelope `{ data, meta }`. The `secret` field is **never** returned in plaintext on list/findOne — only `secretLast4` is exposed. Plaintext is returned exactly once, on `POST /webhooks/endpoints` create.",
        "operationId": "WebhooksController_findAllEndpoints",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/WebhookEndpointResponseDto"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "properties": {
                        "limit": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total",
                        "page",
                        "limit",
                        "totalPages"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Paginated webhook endpoints."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all webhook endpoints",
        "tags": [
          "webhooks"
        ]
      },
      "post": {
        "description": "Returns the webhook with the plaintext `secret` — **the only surface that ever exposes plaintext.** Copy it now; every subsequent read returns `secretLast4` instead.",
        "operationId": "WebhooksController_createEndpoint",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreateResponseDto"
                }
              }
            },
            "description": "Webhook endpoint created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create webhook endpoint",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/v1/webhooks/endpoints/{id}": {
      "delete": {
        "operationId": "WebhooksController_removeEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook endpoint deactivated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete webhook endpoint",
        "tags": [
          "webhooks"
        ]
      },
      "get": {
        "description": "`secret` is redacted to `secretLast4` on this response. The plaintext secret is only available on create.",
        "operationId": "WebhooksController_findOneEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointResponseDto"
                }
              }
            },
            "description": "Webhook endpoint retrieved successfully"
          },
          "404": {
            "description": "Webhook endpoint not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get webhook endpoint by ID",
        "tags": [
          "webhooks"
        ]
      },
      "patch": {
        "operationId": "WebhooksController_updateEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Webhook endpoint updated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update webhook endpoint",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/v1/webhooks/endpoints/{id}/test": {
      "post": {
        "operationId": "WebhooksController_testEndpoint",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook test initiated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test webhook endpoint",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/v1/webhooks/resend/inbound": {
      "post": {
        "operationId": "InboxWebhooksController_handleResendInbound",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Inbound email processed successfully"
          }
        },
        "summary": "Handle Resend inbound email webhooks",
        "tags": [
          "inbox-webhooks"
        ]
      }
    },
    "/v1/webhooks/sendgrid": {
      "post": {
        "operationId": "InboxWebhooksController_handleSendGrid",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Webhook processed successfully"
          }
        },
        "summary": "Handle SendGrid webhook events",
        "tags": [
          "inbox-webhooks"
        ]
      }
    },
    "/v1/webhooks/sendgrid/inbound": {
      "post": {
        "operationId": "InboxWebhooksController_handleSendGridInbound",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Inbound email processed successfully"
          }
        },
        "summary": "Handle SendGrid inbound parse events",
        "tags": [
          "inbox-webhooks"
        ]
      }
    },
    "/v1/webhooks/sms/delivery": {
      "post": {
        "operationId": "SmsEventsWebhookController_delivery",
        "parameters": [
          {
            "in": "header",
            "name": "x-twilio-signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Handle delivery receipts",
        "tags": [
          "SMS Webhooks"
        ]
      }
    },
    "/v1/webhooks/sms/inbound": {
      "post": {
        "operationId": "SmsEventsWebhookController_inbound",
        "parameters": [
          {
            "in": "header",
            "name": "x-twilio-signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Handle incoming SMS (opt-out, replies)",
        "tags": [
          "SMS Webhooks"
        ]
      }
    },
    "/v1/webhooks/telegram": {
      "post": {
        "operationId": "InboxWebhooksController_handleTelegram",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Telegram message processed successfully"
          }
        },
        "summary": "Handle incoming Telegram messages",
        "tags": [
          "inbox-webhooks"
        ]
      }
    },
    "/v1/webhooks/twilio/sms": {
      "post": {
        "operationId": "InboxWebhooksController_handleTwilioSMS",
        "parameters": [],
        "responses": {
          "200": {
            "description": "SMS processed successfully"
          }
        },
        "summary": "Handle incoming SMS from Twilio",
        "tags": [
          "inbox-webhooks"
        ]
      }
    },
    "/v1/webhooks/twilio/whatsapp": {
      "post": {
        "operationId": "InboxWebhooksController_handleTwilioWhatsApp",
        "parameters": [],
        "responses": {
          "200": {
            "description": "WhatsApp message processed successfully"
          }
        },
        "summary": "Handle incoming WhatsApp from Twilio",
        "tags": [
          "inbox-webhooks"
        ]
      }
    },
    "/v1/webhooks/whatsapp/business": {
      "post": {
        "operationId": "InboxWebhooksController_handleWhatsAppBusiness",
        "parameters": [],
        "responses": {
          "200": {
            "description": "WhatsApp Business message processed successfully"
          }
        },
        "summary": "Handle incoming WhatsApp Business message",
        "tags": [
          "inbox-webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "operationId": "WebhooksController_testEndpointShortPath",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook test initiated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test webhook endpoint (short path)",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/v1/widget/v1/admin/analytics": {
      "get": {
        "operationId": "WidgetController_getAnalytics",
        "parameters": [
          {
            "in": "query",
            "name": "startDate",
            "required": true,
            "schema": {
              "example": "2025-01-01",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "required": true,
            "schema": {
              "example": "2025-01-31",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "granularity",
            "required": false,
            "schema": {
              "default": "daily",
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "metrics",
            "required": false,
            "schema": {
              "example": "sessions,messages,resolutions,conversions",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "groupBy",
            "required": false,
            "schema": {
              "enum": [
                "source",
                "intent",
                "outcome"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get widget analytics and metrics",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/configs": {
      "get": {
        "operationId": "WidgetController_listWidgetConfigs",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List widget configurations for the organization",
        "tags": [
          "widget"
        ]
      },
      "post": {
        "operationId": "WidgetController_createWidgetConfig",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Widget configuration created"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new widget configuration",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/configs/{id}": {
      "delete": {
        "operationId": "WidgetController_deleteWidgetConfig",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a widget configuration",
        "tags": [
          "widget"
        ]
      },
      "get": {
        "operationId": "WidgetController_getWidgetConfig",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a widget configuration by ID",
        "tags": [
          "widget"
        ]
      },
      "patch": {
        "operationId": "WidgetController_updateWidgetConfig",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWidgetConfigDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update an existing widget configuration",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/configs/{id}/allowed-domains": {
      "get": {
        "operationId": "WidgetController_getAllowedDomains",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch widget domain allowlist configuration",
        "tags": [
          "widget"
        ]
      },
      "put": {
        "operationId": "WidgetController_updateAllowedDomains",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAllowedDomainsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update widget domain allowlist configuration",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/configs/{id}/allowed-domains/test": {
      "post": {
        "operationId": "WidgetController_testAllowedDomains",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestAllowedDomainDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test a URL or hostname against widget domain allowlist",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/configs/{id}/business-hours": {
      "get": {
        "operationId": "WidgetController_getBusinessHours",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Fetch business hours configuration for widget",
        "tags": [
          "widget"
        ]
      },
      "patch": {
        "operationId": "WidgetController_updateBusinessHours",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WidgetBusinessHoursDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update business hours configuration for widget",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/configs/{id}/origin-blocks": {
      "get": {
        "operationId": "WidgetController_listOriginBlocks",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only return blocks at or after this ISO timestamp.",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List blocked widget origin attempts",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/knowledge-sources": {
      "get": {
        "operationId": "WidgetController_listKnowledgeSources",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available knowledge sources for widget configuration",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions": {
      "get": {
        "operationId": "WidgetController_listSessions",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List widget sessions for an organization",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/bulk-action": {
      "post": {
        "operationId": "WidgetController_bulkAction",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkActionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Perform bulk action on multiple sessions",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/assign": {
      "post": {
        "operationId": "WidgetController_assignSession",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignSessionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Assign a widget session to a team member",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/book-appointment": {
      "post": {
        "operationId": "WidgetController_bookAppointment",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookAppointmentDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Book appointment from widget session",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/context": {
      "patch": {
        "operationId": "WidgetController_updateContext",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSessionContextDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update session context with AI-extracted data",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/convert-to-ticket": {
      "post": {
        "operationId": "WidgetController_convertToTicket",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvertToTicketDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Convert widget session to support ticket",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/create-contact": {
      "post": {
        "operationId": "WidgetController_createContact",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContactFromWidgetDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create CRM contact from widget visitor",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/create-deal": {
      "post": {
        "operationId": "WidgetController_createDeal",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDealFromWidgetDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create deal from high-intent widget session",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/lead": {
      "post": {
        "operationId": "WidgetController_submitLead",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitWidgetLeadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Submit a lead captured from the widget session",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/message": {
      "post": {
        "operationId": "WidgetController_sendAgentMessage",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendAgentMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send an agent message to a visitor session",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/nudge": {
      "post": {
        "operationId": "WidgetController_triggerNudge",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerNudgeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger a proactive nudge to a visitor",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/presence/read": {
      "post": {
        "operationId": "WidgetController_updateAgentReadPresence",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentReadDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update agent read state for a widget session",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/presence/typing": {
      "post": {
        "operationId": "WidgetController_updateAgentTypingPresence",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentTypingDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update agent typing presence for a widget session",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/status": {
      "post": {
        "operationId": "WidgetController_updateSessionStatus",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSessionStatusDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update session status or resolution details",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/sessions/{sessionId}/trigger-workflow": {
      "post": {
        "operationId": "WidgetController_triggerWorkflow",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger workflow from widget event",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/admin/webhooks": {
      "get": {
        "operationId": "WidgetWebhooksController_list",
        "parameters": [
          {
            "description": "Filter webhooks for a single widget config.",
            "in": "query",
            "name": "widgetConfigId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by enabled state.",
            "in": "query",
            "name": "enabled",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Page number.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Widget webhooks returned"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List widget webhook subscriptions",
        "tags": [
          "widget-webhooks"
        ]
      },
      "post": {
        "operationId": "WidgetWebhooksController_create",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a widget webhook subscription",
        "tags": [
          "widget-webhooks"
        ]
      }
    },
    "/v1/widget/v1/admin/webhooks/{id}": {
      "delete": {
        "operationId": "WidgetWebhooksController_delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a widget webhook subscription",
        "tags": [
          "widget-webhooks"
        ]
      },
      "get": {
        "operationId": "WidgetWebhooksController_get",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a widget webhook subscription",
        "tags": [
          "widget-webhooks"
        ]
      },
      "patch": {
        "operationId": "WidgetWebhooksController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWidgetWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a widget webhook subscription",
        "tags": [
          "widget-webhooks"
        ]
      }
    },
    "/v1/widget/v1/admin/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "WidgetWebhooksController_deliveries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter delivery status.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "success",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Page number.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List widget webhook delivery attempts",
        "tags": [
          "widget-webhooks"
        ]
      }
    },
    "/v1/widget/v1/admin/webhooks/{id}/deliveries/{deliveryId}/replay": {
      "post": {
        "operationId": "WidgetWebhooksController_replay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "deliveryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replay a widget webhook delivery",
        "tags": [
          "widget-webhooks"
        ]
      }
    },
    "/v1/widget/v1/admin/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "WidgetWebhooksController_rotate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Rotate a widget webhook secret",
        "tags": [
          "widget-webhooks"
        ]
      }
    },
    "/v1/widget/v1/admin/webhooks/{id}/test": {
      "post": {
        "operationId": "WidgetWebhooksController_test",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestWidgetWebhookDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a test widget webhook delivery",
        "tags": [
          "widget-webhooks"
        ]
      }
    },
    "/v1/widget/v1/config/{widgetKey}": {
      "get": {
        "operationId": "WidgetController_getPublicConfig",
        "parameters": [
          {
            "in": "path",
            "name": "widgetKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "referer",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "user-agent",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Fetch public widget configuration for embedding",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/session": {
      "post": {
        "operationId": "WidgetController_createSession",
        "parameters": [
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "referer",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "user-agent",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidgetSessionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Session created successfully"
          }
        },
        "summary": "Create or resume a chat widget session",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/session/{sessionId}": {
      "get": {
        "operationId": "WidgetController_getSession",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Session token issued during creation",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Fetch widget session details",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/session/{sessionId}/message": {
      "post": {
        "operationId": "WidgetController_sendMessage",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendWidgetMessageDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Message processed successfully"
          }
        },
        "summary": "Send a message from the widget and process AI response",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/widget/v1/session/{sessionId}/messages": {
      "get": {
        "operationId": "WidgetController_getMessages",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Session token issued during creation",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max number of messages to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "origin",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Fetch widget session messages",
        "tags": [
          "widget"
        ]
      }
    },
    "/v1/workflow-actions": {
      "get": {
        "operationId": "WorkflowActionsController_getActions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Workflow actions retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List available workflow actions",
        "tags": [
          "Workflow Actions"
        ]
      }
    },
    "/v1/workflow-templates": {
      "get": {
        "operationId": "LegacyWorkflowTemplatesController_getWorkflowTemplates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Workflow templates retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List workflow templates",
        "tags": [
          "Workflow Extensions"
        ]
      }
    },
    "/v1/workflow-templates/{id}": {
      "get": {
        "operationId": "LegacyWorkflowTemplatesController_getWorkflowTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow template retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Workflow template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow template",
        "tags": [
          "Workflow Extensions"
        ]
      }
    },
    "/v1/workflow-templates/{id}/use": {
      "post": {
        "operationId": "LegacyWorkflowTemplatesController_useWorkflowTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Workflow created successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Workflow template not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create workflow from template",
        "tags": [
          "Workflow Extensions"
        ]
      }
    },
    "/v1/workflows": {
      "get": {
        "description": "Returns the canonical paginated envelope `{ data, meta: { total, page, limit, totalPages } }`. The flat keys (`total`, `page`, `limit`, `totalPages`) are also echoed at the root for one release as a legacy alias — prefer reading from `meta`. By default returns ALL workflows including drafts; pass `?isActive=true` to filter only active.",
        "operationId": "WorkflowsController_findAll",
        "parameters": [
          {
            "in": "query",
            "name": "isActive",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "limit": {
                      "deprecated": true,
                      "type": "integer"
                    },
                    "meta": {
                      "properties": {
                        "limit": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "total",
                        "page",
                        "limit",
                        "totalPages"
                      ],
                      "type": "object"
                    },
                    "page": {
                      "deprecated": true,
                      "type": "integer"
                    },
                    "total": {
                      "deprecated": true,
                      "type": "integer"
                    },
                    "totalPages": {
                      "deprecated": true,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Paginated list of workflows."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get all workflows",
        "tags": [
          "workflows"
        ]
      },
      "post": {
        "description": "Returns the bare workflow object. The legacy `{ workflow: {...} }` wrapper has been removed — read fields directly off the response (`response.id`, `response.name`, ...).",
        "operationId": "WorkflowsController_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "properties": {
                    "category": {
                      "nullable": true,
                      "type": "string"
                    },
                    "conversationCount": {
                      "type": "integer"
                    },
                    "createdAt": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "description": {
                      "nullable": true,
                      "type": "string"
                    },
                    "edges": {
                      "items": {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "hasAiHistory": {
                      "type": "boolean"
                    },
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "isActive": {
                      "type": "boolean"
                    },
                    "locationId": {
                      "format": "uuid",
                      "nullable": true,
                      "type": "string"
                    },
                    "metadata": {
                      "additionalProperties": true,
                      "nullable": true,
                      "type": "object"
                    },
                    "name": {
                      "type": "string"
                    },
                    "nodes": {
                      "items": {
                        "additionalProperties": true,
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "organizationId": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "source": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "DRAFT",
                        "ACTIVE",
                        "PAUSED",
                        "ARCHIVED"
                      ],
                      "type": "string"
                    },
                    "templateId": {
                      "nullable": true,
                      "type": "string"
                    },
                    "trigger": {
                      "properties": {
                        "config": {
                          "additionalProperties": true,
                          "type": "object"
                        },
                        "type": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "triggerConfig": {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    "triggerType": {
                      "enum": [
                        "MANUAL",
                        "SCHEDULED",
                        "EVENT",
                        "WEBHOOK"
                      ],
                      "type": "string"
                    },
                    "updatedAt": {
                      "format": "date-time",
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "organizationId",
                    "isActive",
                    "status",
                    "nodes",
                    "edges"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Workflow created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a new workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/actions": {
      "get": {
        "operationId": "WorkflowsController_getActionRegistry",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Workflow action registry retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List workflow action registry definitions",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/advisor/apply": {
      "post": {
        "operationId": "WorkflowAdvisorController_apply",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyWorkflowSuggestionDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Workflow created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a workflow from a suggestion/template",
        "tags": [
          "Workflow Advisor"
        ]
      }
    },
    "/v1/workflows/advisor/suggest": {
      "post": {
        "operationId": "WorkflowAdvisorController_suggest",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuggestWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workflow suggestions returned successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Suggest workflows based on a natural language prompt",
        "tags": [
          "Workflow Advisor"
        ]
      }
    },
    "/v1/workflows/ai/generate": {
      "post": {
        "operationId": "WorkflowsController_generateWithAi",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateWorkflowWithAiDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workflow generated successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Generate workflow graph from natural language prompt",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/ai/refine": {
      "post": {
        "operationId": "WorkflowsController_refineWithAi",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefineWorkflowWithAiDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workflow refined successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Refine an existing workflow with AI instruction",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/ai/validate": {
      "post": {
        "operationId": "WorkflowsController_validateWithAi",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateWorkflowWithAiDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workflow validation completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Validate AI-generated or edited workflow graph",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/queue/metrics": {
      "get": {
        "operationId": "WorkflowsController_getQueueMetrics",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow runs queue metrics (depth/active/failed)",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/recipes": {
      "get": {
        "operationId": "WorkflowsController_getRecipes",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Workflow recipes retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List installable workflow recipes",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/recipes/{recipeKey}/install": {
      "post": {
        "operationId": "WorkflowsController_installRecipe",
        "parameters": [
          {
            "in": "path",
            "name": "recipeKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallWorkflowRecipeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Workflow recipe installed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Install a workflow recipe for the current organization",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/runs/failed": {
      "get": {
        "operationId": "WorkflowsController_listFailedRuns",
        "parameters": [
          {
            "in": "query",
            "name": "workflowId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List failed workflow runs (DLQ-like inbox)",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/runs/{runId}": {
      "get": {
        "operationId": "WorkflowsController_getRun",
        "parameters": [
          {
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow run retrieved successfully"
          },
          "404": {
            "description": "Workflow run not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a workflow run by ID",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/runs/{runId}/cancel": {
      "post": {
        "operationId": "WorkflowsController_cancelRun",
        "parameters": [
          {
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow run cancelled successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a workflow run",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/runs/{runId}/retry": {
      "post": {
        "operationId": "WorkflowsController_retryRun",
        "parameters": [
          {
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetryWorkflowRunDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry a workflow run by creating a new run",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/schema": {
      "get": {
        "operationId": "WorkflowsController_getWorkflowSchema",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Workflow schema retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow builder schema for AI + UI",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/templates": {
      "get": {
        "operationId": "WorkflowTemplatesController_getTemplateGallery",
        "parameters": [
          {
            "description": "Industry slug. Defaults to org industry or general.",
            "in": "query",
            "name": "industry",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional category filter.",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Free-text search over template name/description/tags.",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "number"
            }
          },
          {
            "description": "Max templates to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow template gallery retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow template gallery for current organization",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/batch": {
      "post": {
        "operationId": "WorkflowTemplatesController_batchInsert",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchWorkflowTemplatesDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upsert workflow templates in batch",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/batch-create": {
      "post": {
        "operationId": "WorkflowTemplatesController_batchCreate",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCreateTemplatesRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Workflows created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Batch create workflows from templates for organization",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/categories/{industry}": {
      "get": {
        "operationId": "WorkflowTemplatesController_getCategoriesByIndustry",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Categories retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow categories for industry",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/sentiment-templates/create": {
      "post": {
        "operationId": "WorkflowTemplatesController_createSentimentTemplates",
        "parameters": [
          {
            "in": "query",
            "name": "activate",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Sentiment templates created successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create all sentiment workflow templates for organization",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/{id}/executions": {
      "get": {
        "operationId": "WorkflowTemplatesController_getExecutionHistory",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Execution history retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow execution history",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/{id}/install": {
      "post": {
        "operationId": "WorkflowTemplatesController_installTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstantiateWorkflowTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Workflow template installed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Install a workflow template for the current organization",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/{id}/test": {
      "post": {
        "operationId": "WorkflowTemplatesController_testWorkflow",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow test completed successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test workflow execution",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/{industry}": {
      "get": {
        "operationId": "WorkflowTemplatesController_getTemplatesByIndustry",
        "parameters": [
          {
            "in": "path",
            "name": "industry",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Templates retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get industry-specific workflow templates",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/templates/{templateId}/instantiate": {
      "post": {
        "operationId": "WorkflowTemplatesController_instantiateTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "templateId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstantiateWorkflowTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Instantiate a workflow from a template",
        "tags": [
          "Workflow Templates"
        ]
      }
    },
    "/v1/workflows/triggers": {
      "get": {
        "operationId": "WorkflowsController_getTriggerRegistry",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Workflow trigger registry retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List workflow trigger registry definitions",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/webhook/trigger": {
      "post": {
        "operationId": "WorkflowsController_handleWebhookTrigger",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Trigger processed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Handle external workflow trigger",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}": {
      "delete": {
        "description": "BE-8: soft-archive. Sets `isActive=false` AND `status=ARCHIVED`. The workflow is hidden from the default `GET /workflows` listing only if the caller filters by `?status=ACTIVE` or `?isActive=true`. Use `POST /:id/deactivate` instead if you want the workflow to remain editable as a paused row.",
        "operationId": "WorkflowsController_remove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow archived successfully"
          },
          "403": {
            "description": "Forbidden - insufficient permissions"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Archive a workflow",
        "tags": [
          "workflows"
        ]
      },
      "get": {
        "operationId": "WorkflowsController_findOne",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow retrieved successfully"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a workflow by ID",
        "tags": [
          "workflows"
        ]
      },
      "patch": {
        "operationId": "WorkflowsController_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workflow updated successfully"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a workflow",
        "tags": [
          "workflows"
        ]
      },
      "put": {
        "description": "Full-save route for workflow builders. Uses the same validation and persistence path as PATCH /workflows/:id.",
        "operationId": "WorkflowsController_replace",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workflow updated successfully"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Replace/update a workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/activate": {
      "post": {
        "description": "BE-8 + BE-15: explicit, idempotent activation. Sets `isActive=true` AND `status=ACTIVE` atomically — preferred over `PATCH /:id { isActive: true }` because it cannot drift the two fields. Pre-flight validation (BE-15): the workflow graph is validated using the same rules as `POST /v1/workflows/ai/validate`. If the graph has unresolved errors (no trigger, orphan nodes, missing required action config, etc.), this endpoint returns 400 with `code: WORKFLOW_NOT_ACTIVATABLE` and a structured `details[]` array the FE can map back to specific nodes. Idempotent: calling on an already-active workflow returns 200 with the workflow unchanged (skips validation).",
        "operationId": "WorkflowsController_activate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow activated successfully"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "code": {
                      "description": "Stable error code. Use this in FE error handling instead of matching on message strings.",
                      "example": "WORKFLOW_NOT_ACTIVATABLE",
                      "type": "string"
                    },
                    "details": {
                      "description": "Per-issue details for `WORKFLOW_NOT_ACTIVATABLE`. Map back to nodes/edges in the builder UI via `nodeId` / `edgeId`. Same issue codes as `POST /v1/workflows/ai/validate`.",
                      "items": {
                        "properties": {
                          "code": {
                            "description": "Stable issue code. See FE_WIRING_WORKFLOWS.md for the catalog.",
                            "example": "WORKFLOW_TRIGGER_COUNT",
                            "type": "string"
                          },
                          "edgeId": {
                            "nullable": true,
                            "type": "string"
                          },
                          "field": {
                            "example": "config.message",
                            "nullable": true,
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "nodeId": {
                            "nullable": true,
                            "type": "string"
                          },
                          "severity": {
                            "enum": [
                              "error"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message",
                          "severity"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "message": {
                      "example": "Workflow has unresolved validation errors and cannot be activated.",
                      "type": "string"
                    },
                    "statusCode": {
                      "enum": [
                        400
                      ],
                      "type": "integer"
                    }
                  },
                  "required": [
                    "statusCode",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Activation blocked. Either the trigger type is not allowed on the current plan, the workflow is a system template, or — most commonly — the graph has unresolved validation errors (`code: WORKFLOW_NOT_ACTIVATABLE`)."
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Activate a workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/audit": {
      "get": {
        "operationId": "WorkflowsController_getAudit",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "userId",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow audit trail retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow audit trail",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/deactivate": {
      "post": {
        "description": "BE-8: explicit, idempotent deactivation. Sets `isActive=false` AND `status=PAUSED` atomically. Idempotent: calling on an already-paused workflow returns 200 unchanged. Does NOT change `ARCHIVED` workflows.",
        "operationId": "WorkflowsController_deactivate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow deactivated successfully"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Deactivate a workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/dry-run": {
      "post": {
        "description": "Side-effect-free simulator for the workflow editor. Loads the graph, walks dependency order, evaluates simple condition nodes, and reports which action nodes would execute. Does not enqueue a run or call external services.",
        "operationId": "WorkflowsController_dryRun",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkflowDryRunDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Workflow dry-run completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Dry-run a workflow with synthetic trigger data",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/duplicate": {
      "post": {
        "operationId": "WorkflowsController_duplicate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DuplicateWorkflowDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Workflow duplicated successfully"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Duplicate a workflow",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/executions": {
      "get": {
        "operationId": "WorkflowsController_getExecutions",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "triggeredBy",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow executions retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow execution history",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/logs": {
      "get": {
        "operationId": "WorkflowLogsController_getWorkflowLogs",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow logs retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Workflow not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow logs",
        "tags": [
          "Workflow Extensions"
        ]
      }
    },
    "/v1/workflows/{id}/preflight": {
      "post": {
        "operationId": "WorkflowsController_preflightWorkflow",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow preflight completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Run workflow activation preflight checks",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/runs": {
      "get": {
        "operationId": "WorkflowsController_getRuns",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {}
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow runs retrieved successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get workflow runs",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/trigger": {
      "post": {
        "operationId": "WorkflowsController_trigger",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow triggered successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Trigger a workflow manually",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{id}/validate": {
      "post": {
        "operationId": "WorkflowsController_validateWorkflow",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow validation completed successfully"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Validate a persisted workflow graph",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/workflows/{workflowId}/executions/{executionId}": {
      "get": {
        "operationId": "WorkflowsController_getExecution",
        "parameters": [
          {
            "in": "path",
            "name": "workflowId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "executionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workflow execution retrieved successfully"
          },
          "404": {
            "description": "Workflow execution not found"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a single workflow execution (frontend polling contract)",
        "tags": [
          "workflows"
        ]
      }
    },
    "/v1/zapier/oauth/authorize": {
      "get": {
        "operationId": "ZapierOAuthController_authorize",
        "parameters": [
          {
            "description": "Must be \"code\"",
            "in": "query",
            "name": "response_type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "client_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "redirect_uri",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "scope",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "summary": "Zapier OAuth2 authorization endpoint (ServiceAgent is OAuth provider)",
        "tags": [
          "zapier-oauth"
        ]
      }
    },
    "/v1/zapier/oauth/authorize/complete": {
      "post": {
        "operationId": "ZapierOAuthController_authorizeComplete",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Redirect URL with authorization code"
          }
        },
        "summary": "Complete Zapier OAuth authorization after portal login (returns redirect URL)",
        "tags": [
          "zapier-oauth"
        ]
      }
    },
    "/v1/zapier/oauth/me": {
      "get": {
        "operationId": "ZapierOAuthController_me",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Current org/user context for the Zapier connection"
          }
        },
        "summary": "Zapier OAuth test endpoint (used by Zapier connection test)",
        "tags": [
          "zapier-oauth"
        ]
      }
    },
    "/v1/zapier/oauth/token": {
      "post": {
        "operationId": "ZapierOAuthController_token",
        "parameters": [
          {
            "in": "header",
            "name": "content-type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tokens issued successfully"
          }
        },
        "summary": "Zapier OAuth2 token endpoint",
        "tags": [
          "zapier-oauth"
        ]
      }
    },
    "/widget.js": {
      "get": {
        "operationId": "WidgetAssetsController_serveWidget",
        "parameters": [
          {
            "in": "query",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    }
  },
  "servers": [
    {
      "description": "production",
      "url": "https://process.serviceagent.ai/v1"
    }
  ],
  "tags": []
}
