{
 "openapi": "3.0.0",
 "info": {
  "title": "API",
  "version": "1.0.0",
  "description": "\n# Welcome to the API!\n\nThis API identifies the exact people visiting your website (name, email, phone, LinkedIn) plus their company and its firmographics, so you can feed them straight into your sales pipeline.\n\n**Quick Start:** Get your API Private Key from your account settings page and start making requests.\n\n<details>\n<summary><b>📖 API Overview</b> (Click to expand)</summary>\n\n## RESTful Design\n- Intuitive URL structure\n- Standard HTTP verbs (GET, POST, PUT, DELETE, PATCH)\n- JSON API 1.0 response format\n\n</details>\n\n<details>\n<summary><b>🔐 Authentication</b> (Click to expand)</summary>\n\n## Private Key Authentication\n\nAdd the **privateKey** query parameter to any request:\n\n```bash\ncurl \"<base-url>/admin/<endpoint>?privateKey=<YOUR_PRIVATE_KEY>\"\n```\n\nThe key scopes every request to its website (or, for a master key, to your whole account) and acts as the account Owner.\nAPI access is included on paid plans and trials.\n\n**Private Key Types:**\n\n1. **Website Private Key** (Website-level access)\n   - Format: `priv-{random-string}` (e.g., `priv-aTKkKaVAgtzD4vVTXCtgqD`)\n   - Generated when the website is created\n   - Unique per website\n   - Grants access to ONLY that specific website\n\n2. **Master Private Key** (Account-level access)\n   - Format: `master-priv-{random-string}` (e.g., `master-priv-a8Df3JkLm9`)\n   - One per account\n   - Grants access to ALL websites under your account\n   - Perfect for agencies/multi-website setups\n   - Copy it from Settings → API in your dashboard\n\n**Security Best Practices:**\n- Never share publicly or commit to version control\n- Contact support if the key is compromised\n\n</details>\n\n<details>\n<summary><b>👥 Team roles &amp; permissions</b> (Click to expand)</summary>\n\n## Two roles since October 2026\n\n- **Owner** — everything: billing, white-label, the master API key, adding or removing Owners.\n- **Member** — exactly the permissions you tick, on the websites you choose (or `allWebsites: true`).\n\nPermission ids (grouped) come from `GET /admin/permissions/catalog`:\n`pixel`, `add_website`, `website`, `delete_website`, `integrations`, `leads_view`, `leads_export`, `qualify`,\n`campaigns`, `buy_mailboxes`, `connect_mailboxes`, `warmup`, `inbox`, `team`, `api_keys`, `billing`, `whitelabel`.\n\nPresets: `full`, `sales`, `developer`, `viewer` — and for white-label accounts `team` and `client`.\n\n### If you still send the old roles\n`role: \"Admin\" | \"Editor\" | \"Viewer\"` on `POST /admin/invite` and `PUT /admin/members` keeps working:\nit is translated to a Member with the matching preset (Admin → everything except white-label,\nEditor → Client, Viewer → View only). Please move to `preset` or `permissions` — the old names will be\nretired. Responses now carry `role` (Owner / Member), `permissions`, `preset` and `allWebsites`.\n\nA private key always acts as the account Owner. A user token is limited to that user's permissions —\na request outside them answers **403** with `code: \"permission_denied\"` and the missing `permission`.\n\nFull guide: https://help.happierleads.com/kb/happierleads/article/how-to-manage-team-permissions\n\n</details>\n\n<details>\n<summary><b>📊 Response Format</b> (Click to expand)</summary>\n\n## API Response Format\n\nAll responses follow JSON API 1.0 convention:\n\n### Success Response\n```json\n{\n  \"status\": \"success\",\n  \"data\": {\n    // Response data\n  }\n}\n```\n\n### Error Response\n```json\n{\n  \"status\": \"error message\",\n  \"error\": {\n    \"code\": \"ERROR_CODE\",\n    \"message\": \"Detailed error message\"\n  }\n}\n```\n\n### HTTP Status Codes\n- **200 OK**: Success\n- **201 Created**: Resource created\n- **400 Bad Request**: Invalid parameters\n- **401 Unauthorized**: Missing/invalid authentication\n- **403 Forbidden**: Insufficient permissions\n- **404 Not Found**: Resource not found\n- **405 Method Not Allowed**: Invalid method or account restrictions\n- **429 Too Many Requests**: Rate limit exceeded\n- **500 Internal Server Error**: Server error\n\n</details>\n\n<details>\n<summary><b>⚡ Rate Limiting</b> (Click to expand)</summary>\n\nAPI requests are rate limited to ensure fair usage. Rate limit information is returned in response headers:\n- `X-RateLimit-Limit`: Maximum requests allowed\n- `X-RateLimit-Remaining`: Requests remaining\n- `X-RateLimit-Reset`: Time when limit resets\n\nIf you exceed the rate limit, you'll receive a 429 response.\n\n</details>\n\n<details>\n<summary><b>📄 Pagination & Filtering</b> (Click to expand)</summary>\n\n## Pagination\nList endpoints support pagination:\n\n- `page`: Page number (default: 1)\n- `limit`: Items per page (default: 20, max: 100)\n- `sort`: Field to sort by\n- `order`: Sort order (asc/desc)\n\n## Filtering\nMost endpoints support filtering via query parameters. Check individual endpoint docs for available filters.\n\n</details>\n"
 },
 "servers": [
  {
   "url": "https://rest-admin.happierleads.com",
   "description": "Production server"
  }
 ],
 "components": {
  "securitySchemes": {
   "privateKey": {
    "type": "apiKey",
    "in": "query",
    "name": "privateKey",
    "description": "API Private Key for authentication. Get this from your account settings page."
   },
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT",
    "description": "JWT Bearer token for user authentication"
   }
  },
  "schemas": {
   "Industry": {
    "type": "string",
    "enum": [
     "Accounting",
     "Aerospace & Defense",
     "Air Freight & Logistics",
     "Airlines/Aviation",
     "Alternative Medicine",
     "Animation",
     "Apparel & Fashion",
     "Architecture & Planning",
     "Arts and Crafts",
     "Automotive",
     "Aviation & Aerospace",
     "Banking",
     "Beverages",
     "Biotechnology",
     "Broadcast Media",
     "Building Materials",
     "Business Supplies and Equipment",
     "Capital Markets",
     "Chemicals",
     "Civic & Social Organization",
     "Civil Engineering",
     "Commercial Real Estate",
     "Commercial Services & Supplies",
     "Communications Equipment",
     "Computer & Network Security",
     "Computer Games",
     "Computer Hardware",
     "Computer Networking",
     "Computer Software",
     "Construction & Engineering",
     "Consumer Discretionary",
     "Consumer Electronics",
     "Consumer Goods",
     "Consumer Services",
     "Consumer Staples",
     "Containers & Packaging",
     "Cosmetics",
     "Dairy",
     "Defense & Space",
     "Design",
     "Distributors",
     "Diversified Consumer Services",
     "Diversified Financial Services",
     "Diversified Telecommunication Services",
     "E-Learning",
     "Education Management",
     "Education Services",
     "Electric Utilities",
     "Electrical Equipment",
     "Electrical/Electronic Manufacturing",
     "Electronic Equipment, Instruments & Components",
     "Entertainment",
     "Environmental Services",
     "Events Services",
     "Executive Office",
     "Facilities Services",
     "Family Services",
     "Farming",
     "Financial Services",
     "Fine Art",
     "Fishery",
     "Food & Beverages",
     "Food Production",
     "Food Products",
     "Fund-Raising",
     "Furniture",
     "Gambling & Casinos",
     "Gas Utilities",
     "Glass, Ceramics & Concrete",
     "Government Administration",
     "Government Relations",
     "Graphic Design",
     "Health Care Equipment & Supplies",
     "Health Care Providers & Services",
     "Health, Wellness and Fitness",
     "Higher Education",
     "Hospital & Health Care",
     "Hospitality",
     "Hotels, Restaurants & Leisure",
     "Household Durables",
     "Human Resources",
     "IT Services",
     "Import and Export",
     "Individual & Family Services",
     "Industrial Automation",
     "Industrial Conglomerates",
     "Information Services",
     "Information Technology and Services",
     "Insurance",
     "International Affairs",
     "International Trade and Development",
     "Internet",
     "Internet Software & Services",
     "Investment Banking",
     "Investment Management",
     "Judiciary",
     "Law Enforcement",
     "Law Practice",
     "Legal Services",
     "Legislative Office",
     "Leisure Products",
     "Leisure, Travel & Tourism",
     "Libraries",
     "Logistics and Supply Chain",
     "Luxury Goods & Jewelry",
     "Machinery",
     "Management Consulting",
     "Marine",
     "Maritime",
     "Market Research",
     "Marketing and Advertising",
     "Mechanical or Industrial Engineering",
     "Media",
     "Media Production",
     "Medical Devices",
     "Medical Practice",
     "Mental Health Care",
     "Military",
     "Mining & Metals",
     "Motion Pictures and Film",
     "Museums and Institutions",
     "Music",
     "Nanotechnology",
     "Newspapers",
     "Non-Profit Organization Management",
     "Oil & Energy",
     "Online Media",
     "Outsourcing/Offshoring",
     "Package/Freight Delivery",
     "Packaging and Containers",
     "Paper & Forest Products",
     "Performing Arts",
     "Personal Products",
     "Pharmaceuticals",
     "Philanthropy",
     "Photography",
     "Plastics",
     "Political Organization",
     "Primary/Secondary Education",
     "Printing",
     "Professional Services",
     "Professional Training & Coaching",
     "Program Development",
     "Public Policy",
     "Public Relations and Communications",
     "Public Safety",
     "Publishing",
     "Railroad Manufacture",
     "Ranching",
     "Real Estate",
     "Recreational Facilities and Services",
     "Religious Institutions",
     "Renewable Electricity",
     "Renewables & Environment",
     "Research",
     "Restaurants",
     "Retail",
     "Retailing",
     "Road & Rail",
     "Security and Investigations",
     "Semiconductors",
     "Shipbuilding",
     "Software",
     "Specialized Consumer Services",
     "Specialty Retail",
     "Sporting Goods",
     "Sports",
     "Staffing and Recruiting",
     "Supermarkets",
     "Technology Hardware, Storage & Peripherals",
     "Telecommunications",
     "Textiles",
     "Textiles, Apparel & Luxury Goods",
     "Think Tanks",
     "Tobacco",
     "Trading Companies & Distributors",
     "Translation and Localization",
     "Transportation",
     "Transportation/Trucking/Railroad",
     "Utilities",
     "Venture Capital & Private Equity",
     "Veterinary",
     "Warehousing",
     "Wholesale",
     "Wine and Spirits",
     "Wireless",
     "Wireless Telecommunication Services",
     "Writing and Editing"
    ],
    "description": "Industry classification"
   },
   "Country": {
    "type": "string",
    "enum": [
     "United States",
     "United Kingdom",
     "Germany",
     "Belgium",
     "Austria",
     "Denmark",
     "Finland",
     "Egypt",
     "Croatia",
     "Cuba",
     "Cyprus",
     "Czech Republic",
     "Estonia",
     "France",
     "Gabon",
     "Gambia",
     "Georgia",
     "Ghana",
     "Gibraltar",
     "Greece",
     "Greenland",
     "Grenada",
     "Iceland",
     "India",
     "Indonesia",
     "Malta",
     "Iraq",
     "Hong Kong",
     "Cameroon",
     "Canada",
     "Falkland Islands (Malvinas)",
     "Hungary",
     "French Southern Territories",
     "United Arab Emirates",
     "Turkey",
     "Sweden",
     "Switzerland",
     "Singapore",
     "Qatar",
     "New Zealand",
     "Lithuania",
     "Luxembourg",
     "Latvia",
     "Lebanon",
     "Norway",
     "Portugal",
     "Russian Federation",
     "Mexico",
     "Israel",
     "Italy",
     "Japan",
     "Korea, Democratic People'S Republic of",
     "Korea, Republic of",
     "Monaco",
     "Iran, Islamic Republic Of",
     "Ireland",
     "Isle of Man",
     "British Indian Ocean Territory",
     "Cayman Islands",
     "Australia",
     "Afghanistan",
     "Åland Islands",
     "Albania",
     "Algeria",
     "Brazil",
     "American Samoa",
     "AndorrA",
     "Angola",
     "Anguilla",
     "Antarctica",
     "Antigua and Barbuda",
     "Argentina",
     "Armenia",
     "Aruba",
     "Azerbaijan",
     "Bahamas",
     "Bahrain",
     "Bangladesh",
     "Barbados",
     "Belarus",
     "Belize",
     "Benin",
     "Bermuda",
     "Bhutan",
     "Bolivia",
     "Bosnia and Herzegovina",
     "Botswana",
     "Bouvet Island",
     "Brunei Darussalam",
     "Bulgaria",
     "Burkina Faso",
     "Burundi",
     "Cambodia",
     "Cape Verde",
     "Central African Republic",
     "Chad",
     "Chile",
     "China",
     "Christmas Island",
     "Cocos (Keeling) Islands",
     "Colombia",
     "Comoros",
     "Congo",
     "Congo, The Democratic Republic of the",
     "Cook Islands",
     "Costa Rica",
     "Cote D'Ivoire",
     "Djibouti",
     "Dominica",
     "Dominican Republic",
     "Ecuador",
     "El Salvador",
     "Equatorial Guinea",
     "Eritrea",
     "Ethiopia",
     "Faroe Islands",
     "Fiji",
     "French Guiana",
     "French Polynesia",
     "Guadeloupe",
     "Guam",
     "Guatemala",
     "Guernsey",
     "Guinea",
     "Guinea-Bissau",
     "Guyana",
     "Haiti",
     "Heard Island and Mcdonald Islands",
     "Holy See (Vatican City State)",
     "Honduras",
     "Jamaica",
     "Jersey",
     "Jordan",
     "Kazakhstan",
     "Kenya",
     "Kiribati",
     "Kuwait",
     "Kyrgyzstan",
     "Lao People'S Democratic Republic",
     "Lesotho",
     "Liberia",
     "Libyan Arab Jamahiriya",
     "Liechtenstein",
     "Macao",
     "Macedonia, The Former Yugoslav Republic of",
     "Madagascar",
     "Malawi",
     "Malaysia",
     "Maldives",
     "Mali",
     "Marshall Islands",
     "Martinique",
     "Mauritania",
     "Mauritius",
     "Mayotte",
     "Micronesia, Federated States of",
     "Moldova, Republic of",
     "Mongolia",
     "Montserrat",
     "Morocco",
     "Mozambique",
     "Myanmar",
     "Namibia",
     "Nauru",
     "Nepal",
     "Netherlands",
     "Netherlands Antilles",
     "New Caledonia",
     "Nicaragua",
     "Niger",
     "Nigeria",
     "Niue",
     "Norfolk Island",
     "Northern Mariana Islands",
     "Oman",
     "Pakistan",
     "Palau",
     "Palestinian Territory, Occupied",
     "Panama",
     "Papua New Guinea",
     "Paraguay",
     "Peru",
     "Philippines",
     "Pitcairn",
     "Poland",
     "Puerto Rico",
     "Reunion",
     "Romania",
     "RWANDA",
     "Saint Helena",
     "Saint Kitts and Nevis",
     "Saint Lucia",
     "Saint Pierre and Miquelon",
     "Saint Vincent and the Grenadines",
     "Samoa",
     "San Marino",
     "Sao Tome and Principe",
     "Saudi Arabia",
     "Senegal",
     "Serbia and Montenegro",
     "Seychelles",
     "Sierra Leone",
     "Slovakia",
     "Slovenia",
     "Solomon Islands",
     "Somalia",
     "South Africa",
     "South Georgia and the South Sandwich Islands",
     "Spain",
     "Sri Lanka",
     "Sudan",
     "Surivalue",
     "Svalbard and Jan Mayen",
     "Swaziland",
     "Syrian Arab Republic",
     "Taiwan, Province of China",
     "Tajikistan",
     "Tanzania, United Republic of",
     "Thailand",
     "Timor-Leste",
     "Togo",
     "Tokelau",
     "Tonga",
     "Trinidad and Tobago",
     "Tunisia",
     "Turkmenistan",
     "Turks and Caicos Islands",
     "Tuvalu",
     "Uganda",
     "Ukraine",
     "United States Minor Outlying Islands",
     "Uruguay",
     "Uzbekistan",
     "Vanuatu",
     "Venezuela",
     "Viet Nam",
     "Virgin Islands, British",
     "Virgin Islands, U.S.",
     "Wallis and Futuna",
     "Western Sahara",
     "Yemen",
     "Zambia",
     "Zimbabwe"
    ],
    "description": "Country name"
   },
   "CountryCode": {
    "type": "string",
    "enum": [
     "US",
     "GB",
     "DE",
     "BE",
     "AT",
     "DK",
     "FI",
     "EG",
     "HR",
     "CU",
     "CY",
     "CZ",
     "EE",
     "FR",
     "GA",
     "GM",
     "GE",
     "GH",
     "GI",
     "GR",
     "GL",
     "GD",
     "IS",
     "IN",
     "ID",
     "MT",
     "IQ",
     "HK",
     "CM",
     "CA",
     "FK",
     "HU",
     "TF",
     "AE",
     "TR",
     "SE",
     "CH",
     "SG",
     "QA",
     "NZ",
     "LT",
     "LU",
     "LV",
     "LB",
     "NO",
     "PT",
     "RU",
     "MX",
     "IL",
     "IT",
     "JP",
     "KP",
     "KR",
     "MC",
     "IR",
     "IE",
     "IM",
     "IO",
     "KY",
     "AU",
     "AF",
     "AX",
     "AL",
     "DZ",
     "BR",
     "AS",
     "AD",
     "AO",
     "AI",
     "AQ",
     "AG",
     "AR",
     "AM",
     "AW",
     "AZ",
     "BS",
     "BH",
     "BD",
     "BB",
     "BY",
     "BZ",
     "BJ",
     "BM",
     "BT",
     "BO",
     "BA",
     "BW",
     "BV",
     "BN",
     "BG",
     "BF",
     "BI",
     "KH",
     "CV",
     "CF",
     "TD",
     "CL",
     "CN",
     "CX",
     "CC",
     "CO",
     "KM",
     "CG",
     "CD",
     "CK",
     "CR",
     "CI",
     "DJ",
     "DM",
     "DO",
     "EC",
     "SV",
     "GQ",
     "ER",
     "ET",
     "FO",
     "FJ",
     "GF",
     "PF",
     "GP",
     "GU",
     "GT",
     "GG",
     "GN",
     "GW",
     "GY",
     "HT",
     "HM",
     "VA",
     "HN",
     "JM",
     "JE",
     "JO",
     "KZ",
     "KE",
     "KI",
     "KW",
     "KG",
     "LA",
     "LS",
     "LR",
     "LY",
     "LI",
     "MO",
     "MK",
     "MG",
     "MW",
     "MY",
     "MV",
     "ML",
     "MH",
     "MQ",
     "MR",
     "MU",
     "YT",
     "FM",
     "MD",
     "MN",
     "MS",
     "MA",
     "MZ",
     "MM",
     "NA",
     "NR",
     "NP",
     "NL",
     "AN",
     "NC",
     "NI",
     "NE",
     "NG",
     "NU",
     "NF",
     "MP",
     "OM",
     "PK",
     "PW",
     "PS",
     "PA",
     "PG",
     "PY",
     "PE",
     "PH",
     "PN",
     "PL",
     "PR",
     "RE",
     "RO",
     "RW",
     "SH",
     "KN",
     "LC",
     "PM",
     "VC",
     "WS",
     "SM",
     "ST",
     "SA",
     "SN",
     "CS",
     "SC",
     "SL",
     "SK",
     "SI",
     "SB",
     "SO",
     "ZA",
     "GS",
     "ES",
     "LK",
     "SD",
     "SR",
     "SJ",
     "SZ",
     "SY",
     "TW",
     "TJ",
     "TZ",
     "TH",
     "TL",
     "TG",
     "TK",
     "TO",
     "TT",
     "TN",
     "TM",
     "TC",
     "TV",
     "UG",
     "UA",
     "UM",
     "UY",
     "UZ",
     "VU",
     "VE",
     "VN",
     "VG",
     "VI",
     "WF",
     "EH",
     "YE",
     "ZM",
     "ZW"
    ],
    "description": "ISO 3166-1 alpha-2 country code"
   },
   "Sector": {
    "type": "string",
    "enum": [
     "Materials",
     "Energy",
     "Consumer Staples",
     "Financials",
     "Health Care",
     "Information Technology",
     "Industrials",
     "Consumer Discretionary",
     "Telecommunication Services",
     "Utilities"
    ],
    "description": "Company sector classification (GICS sectors)"
   },
   "EmployeesRange": {
    "type": "string",
    "enum": [
     "1-10",
     "10-100",
     "100-1000",
     "1k-10k",
     "10k-120k",
     "50k-150k",
     "100k-500k",
     "500k-1000k",
     "1000k-3000k"
    ],
    "description": "Company employee count range"
   },
   "EstimatedAnnualRevenue": {
    "type": "string",
    "description": "Estimated annual revenue range. Common formats include: $0-$1M, $1M-$10M, $10M-$50M, $50M-$100M, $100M-$250M, $250M-$500M, $500M-$1B, $1B+. Note: This field is not strictly enumerated and may contain variations from different data sources.",
    "example": "$1M-$10M"
   },
   "ErrorCode": {
    "type": "string",
    "enum": [
     "BAD_REQUEST",
     "UNAUTHORIZED",
     "FORBIDDEN",
     "NOT_FOUND",
     "METHOD_NOT_ALLOWED",
     "NOT_ACCEPTABLE",
     "GONE",
     "IM_A_TEAPOT",
     "TOO_MANY_REQUESTS",
     "INTERNAL_SERVER_ERROR",
     "SERVICE_UNAVAILABLE"
    ],
    "description": "Standard API error codes"
   },
   "Error": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "Error message"
     },
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "$ref": "#/components/schemas/ErrorCode"
       },
       "message": {
        "type": "string"
       }
      }
     }
    },
    "example": {
     "status": "Bad Request",
     "error": {
      "code": "BAD_REQUEST",
      "message": "Your request is invalid."
     }
    }
   },
   "Lead": {
    "type": "object",
    "properties": {
     "_id": {
      "type": "string",
      "description": "Lead ID"
     },
     "domain": {
      "type": "string",
      "description": "Company domain"
     },
     "companyName": {
      "type": "string",
      "description": "Company name"
     },
     "industry": {
      "$ref": "#/components/schemas/Industry"
     },
     "employees": {
      "type": "number",
      "description": "Number of employees"
     },
     "revenue": {
      "$ref": "#/components/schemas/EstimatedAnnualRevenue"
     },
     "location": {
      "type": "object",
      "properties": {
       "country": {
        "$ref": "#/components/schemas/Country"
       },
       "city": {
        "type": "string"
       },
       "state": {
        "type": "string"
       }
      }
     },
     "visits": {
      "type": "number",
      "description": "Number of visits"
     },
     "leadScore": {
      "type": "number",
      "description": "Lead score (0-100)"
     },
     "tags": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "createdAt": {
      "type": "string",
      "format": "date-time"
     },
     "lastVisit": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "Company": {
    "type": "object",
    "properties": {
     "_id": {
      "type": "string"
     },
     "domain": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "yearFounded": {
      "type": "number"
     },
     "companyType": {
      "type": "string"
     },
     "sector": {
      "$ref": "#/components/schemas/Sector"
     },
     "industry": {
      "$ref": "#/components/schemas/Industry"
     },
     "country": {
      "$ref": "#/components/schemas/Country"
     },
     "countryCode": {
      "$ref": "#/components/schemas/CountryCode"
     },
     "estimatedAnnualRevenue": {
      "$ref": "#/components/schemas/EstimatedAnnualRevenue"
     },
     "employeesRange": {
      "$ref": "#/components/schemas/EmployeesRange"
     },
     "alexaRank": {
      "type": "number"
     },
     "linkedinPage": {
      "type": "string"
     },
     "summary": {
      "type": "string"
     },
     "tags": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   },
   "Contact": {
    "type": "object",
    "properties": {
     "_id": {
      "type": "string"
     },
     "email": {
      "type": "string",
      "format": "email"
     },
     "firstName": {
      "type": "string"
     },
     "lastName": {
      "type": "string"
     },
     "headline": {
      "type": "string"
     },
     "position": {
      "type": "string"
     },
     "department": {
      "type": "string"
     },
     "phone": {
      "type": "string"
     },
     "linkedin": {
      "type": "string"
     },
     "company": {
      "type": "string",
      "description": "Company domain"
     },
     "businessEmail": {
      "type": "string"
     },
     "personalEmail": {
      "type": "string"
     },
     "verifiedStatus": {
      "type": "string"
     },
     "social": {
      "type": "object",
      "properties": {
       "linkedin": {
        "type": "string"
       },
       "twitter": {
        "type": "string"
       },
       "facebook": {
        "type": "string"
       }
      }
     }
    }
   },
   "EmailCampaign": {
    "type": "object",
    "properties": {
     "_id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "isActive": {
      "type": "boolean"
     },
     "website": {
      "type": "string"
     },
     "roles": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Target job titles"
     },
     "excludedRoles": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Excluded job titles"
     },
     "stats": {
      "type": "object",
      "properties": {
       "total": {
        "type": "number"
       },
       "sentCount": {
        "type": "number"
       },
       "openCount": {
        "type": "number"
       },
       "clickCount": {
        "type": "number"
       },
       "replyCount": {
        "type": "number"
       },
       "bounceCount": {
        "type": "number"
       },
       "openRate": {
        "type": "number"
       },
       "clickRate": {
        "type": "number"
       },
       "replyRate": {
        "type": "number"
       }
      }
     }
    }
   },
   "EmailAccount": {
    "type": "object",
    "properties": {
     "_id": {
      "type": "string"
     },
     "website": {
      "type": "string"
     },
     "email": {
      "type": "string"
     },
     "fullName": {
      "type": "string"
     },
     "smtpHost": {
      "type": "string"
     },
     "smtpPort": {
      "type": "number"
     },
     "smtpTLS": {
      "type": "boolean"
     },
     "imapHost": {
      "type": "string"
     },
     "imapPort": {
      "type": "number"
     },
     "imapTLS": {
      "type": "boolean"
     },
     "messagesPerDayLimit": {
      "type": "number"
     },
     "messagesPerDaySent": {
      "type": "number"
     },
     "connected": {
      "type": "boolean"
     },
     "isMarkedAsSpam": {
      "type": "boolean"
     }
    }
   },
   "Automation": {
    "type": "object",
    "properties": {
     "_id": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "isActive": {
      "type": "boolean"
     },
     "website": {
      "type": "string"
     },
     "trigger": {
      "type": "string",
      "enum": [
       "only-on-first-visit",
       "on-every-visit",
       "none"
      ]
     },
     "when": {
      "type": "string",
      "enum": [
       "new-lead-is-identified",
       "new-intent-data-triggered",
       "new-prospector-lead",
       "new-web-scraping-signal",
       "new-scout-lead",
       "new-linkedin-engagement",
       "new-tag-added-to-lead"
      ]
     },
     "then": {
      "type": "string",
      "enum": [
       "send-to-slack",
       "send-to-hubspot",
       "send-to-pipedrive",
       "send-to-salesforce",
       "send-to-zoho",
       "send-to-gohighlevel",
       "trigger-webhook",
       "send-to-zapier",
       "send-to-clay",
       "send-to-emailCampaign",
       "send-to-linkedinCampaign",
       "send-email-alert",
       "send-csv-on-email",
       "send-to-googleAdsCampaign",
       "send-to-linkedinAdsAudience",
       "send-to-metaAdsAudience"
      ]
     },
     "interval": {
      "type": "string",
      "enum": [
       "immediately",
       "after-session",
       "daily",
       "weekly",
       "monthly"
      ]
     },
     "contactPersona": {
      "type": "object",
      "properties": {
       "roles": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "excludedRoles": {
        "type": "array",
        "items": {
         "type": "string"
        }
       }
      }
     },
     "emailVerification": {
      "type": "object",
      "properties": {
       "allowOnlyValidEmails": {
        "type": "boolean"
       },
       "allowCatchAllEmails": {
        "type": "boolean"
       },
       "allowGuessedEmails": {
        "type": "boolean"
       },
       "allowWithoutEmails": {
        "type": "boolean"
       }
      }
     },
     "actions": {
      "type": "object",
      "description": "Automation action configurations"
     }
    }
   },
   "IntentTopicCatalogEntry": {
    "type": "object",
    "description": "A topic available for subscription from the global intent catalog",
    "properties": {
     "_id": {
      "type": "string",
      "description": "Catalog entry ID"
     },
     "topicSlug": {
      "type": "string",
      "description": "Unique slug used when subscribing (e.g. \"crm-software-buyers\")",
      "example": "crm-software-buyers"
     },
     "displayName": {
      "type": "string",
      "description": "Human-readable topic name shown in the UI",
      "example": "CRM Software Buyers"
     },
     "profile": {
      "type": "object",
      "description": "Audience targeting profile cloned into each subscription",
      "properties": {
       "roleKeywords": {
        "type": "array",
        "items": {
         "type": "string"
        },
        "description": "Job title keywords used to match decision-makers for this topic",
        "example": [
         "VP Sales",
         "Sales Director",
         "CRO"
        ]
       },
       "industryConstraint": {
        "type": "array",
        "items": {
         "type": "string"
        },
        "description": "Industries to constrain delivery to (empty = all industries)",
        "example": []
       }
      }
     },
     "surgeThreshold": {
      "type": "number",
      "description": "Minimum intent score (0–100) a company must exceed to be delivered",
      "example": 70
     },
     "availabilityPerDay": {
      "type": "number",
      "description": "Estimated number of matching leads available per day for this topic",
      "example": 150
     }
    }
   },
   "IntentTopicSubscription": {
    "type": "object",
    "description": "A website's active subscription to an intent topic",
    "properties": {
     "_id": {
      "type": "string",
      "description": "Subscription ID"
     },
     "topicSlug": {
      "type": "string",
      "description": "Slug of the subscribed topic",
      "example": "crm-software-buyers"
     },
     "displayName": {
      "type": "string",
      "example": "CRM Software Buyers"
     },
     "profile": {
      "type": "object",
      "properties": {
       "roleKeywords": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "industryConstraint": {
        "type": "array",
        "items": {
         "type": "string"
        }
       }
      }
     },
     "paused": {
      "type": "boolean",
      "description": "Whether delivery is currently paused for this subscription"
     },
     "enabledAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the subscription was first created"
     },
     "pausedAt": {
      "type": "string",
      "format": "date-time",
      "nullable": true,
      "description": "Timestamp of the most recent pause (null when active)"
     },
     "surgeThreshold": {
      "type": "number",
      "description": "Minimum intent score required for delivery"
     },
     "availabilityPerDay": {
      "type": "number",
      "description": "Estimated matching leads per day for this topic, as of when you subscribed"
     },
     "userDailyLimit": {
      "type": "number",
      "description": "Maximum leads to deliver per day (capped at 5000). Set this lower to control credit usage.",
      "example": 20
     },
     "dailyDeliveryTarget": {
      "type": "number",
      "description": "Number of leads scheduled for delivery today"
     },
     "dailyDeliveredToday": {
      "type": "number",
      "description": "Leads delivered today for this topic"
     },
     "totalDeliveredCount": {
      "type": "number",
      "description": "Cumulative leads delivered since subscription"
     },
     "recentSurgeCount7d": {
      "type": "number",
      "description": "Leads carrying this topic seen in the last 7 days"
     }
    }
   },
   "InviteObject": {
    "type": "object",
    "required": [
     "email"
    ],
    "properties": {
     "email": {
      "type": "string",
      "format": "email",
      "example": "john@example.com"
     },
     "role": {
      "type": "string",
      "enum": [
       "Owner",
       "Member",
       "Admin",
       "Editor",
       "Viewer"
      ],
      "default": "Member",
      "description": "Owner or Member. **Deprecated:** the old values Admin / Editor / Viewer\nare still accepted and translated to a Member with the matching preset,\nbut this is legacy and will be removed — send `preset` or `permissions`.\n"
     },
     "preset": {
      "type": "string",
      "enum": [
       "full",
       "sales",
       "developer",
       "viewer",
       "team",
       "client"
      ],
      "description": "Start from a preset (see GET /admin/permissions/catalog)"
     },
     "permissions": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Exact permission ids to tick (overrides preset)",
      "example": [
       "pixel",
       "leads_view"
      ]
     },
     "allWebsites": {
      "type": "boolean",
      "description": "Access to every current and future website"
     },
     "websites": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Website ids the person may see",
      "example": [
       "507f1f77bcf86cd799439011"
      ]
     },
     "firstName": {
      "type": "string"
     },
     "lastName": {
      "type": "string"
     }
    }
   },
   "InviteRequest": {
    "type": "object",
    "required": [
     "invites"
    ],
    "properties": {
     "invites": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/InviteObject"
      },
      "description": "Array of invite objects"
     }
    }
   },
   "InviteSuccessResponse": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "Success message",
      "example": "Invites Sent"
     },
     "invitationLinks": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Array of invitation links (only when invitation emails are turned off)",
      "example": [
       "https://app.example.com/reset-password?isInvite=true&resetId=abc-123-def"
      ]
     }
    }
   },
   "InviteErrorResponse": {
    "type": "object",
    "properties": {
     "status": {
      "oneOf": [
       {
        "type": "string"
       },
       {
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "msg": {
           "type": "string"
          }
         }
        }
       }
      ],
      "description": "Error message or array of validation errors"
     }
    }
   }
  },
  "parameters": {
   "privateKey": {
    "name": "privateKey",
    "in": "query",
    "required": true,
    "schema": {
     "type": "string"
    },
    "description": "Your API Private Key from your account settings"
   },
   "websiteId": {
    "name": "websiteId",
    "in": "query",
    "required": true,
    "schema": {
     "type": "string"
    },
    "description": "Website ID"
   },
   "page": {
    "name": "page",
    "in": "query",
    "schema": {
     "type": "integer",
     "default": 1
    },
    "description": "Page number for pagination"
   },
   "limit": {
    "name": "limit",
    "in": "query",
    "schema": {
     "type": "integer",
     "default": 20,
     "maximum": 100
    },
    "description": "Number of items per page"
   },
   "dateFrom": {
    "name": "dateFrom",
    "in": "query",
    "schema": {
     "type": "string",
     "format": "date"
    },
    "description": "Start date for filtering (YYYY-MM-DD)"
   },
   "dateTo": {
    "name": "dateTo",
    "in": "query",
    "schema": {
     "type": "string",
     "format": "date"
    },
    "description": "End date for filtering (YYYY-MM-DD)"
   }
  },
  "responses": {
   "UnauthorizedError": {
    "description": "Authentication information is missing or invalid",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      },
      "example": {
       "status": "Invalid Private Key"
      }
     }
    }
   },
   "ForbiddenError": {
    "description": "Valid authentication but insufficient permissions",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      },
      "example": {
       "status": "Account is not allowed to use this API"
      }
     }
    }
   },
   "NotFoundError": {
    "description": "The requested resource was not found",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "SuccessMessage": {
    "description": "Operation completed successfully",
    "content": {
     "application/json": {
      "schema": {
       "type": "object",
       "properties": {
        "status": {
         "type": "string",
         "example": "Successful"
        }
       }
      }
     }
    }
   }
  }
 },
 "tags": [
  {
   "name": "Prospector",
   "description": "Search the contact database for new people and reveal their contact details"
  },
  {
   "name": "Company Enrichment",
   "description": "Enrich company data with firmographics and people"
  },
  {
   "name": "Leads",
   "description": "Manage and retrieve lead information"
  },
  {
   "name": "Websites",
   "description": "Website management and configuration"
  },
  {
   "name": "Analytics",
   "description": "Website analytics and visitor activity metrics"
  },
  {
   "name": "Automations",
   "description": "Marketing automation workflows"
  },
  {
   "name": "Email Campaigns",
   "description": "Email campaign creation and management"
  },
  {
   "name": "Email Templates",
   "description": "Email template management"
  },
  {
   "name": "Email Accounts",
   "description": "Email account configuration for sending"
  },
  {
   "name": "CSV Export",
   "description": "Export lead data to CSV"
  },
  {
   "name": "Domain Blacklist",
   "description": "Manage blacklisted domains"
  },
  {
   "name": "Email Blacklist",
   "description": "Manage blacklisted email addresses"
  },
  {
   "name": "Lists",
   "description": "Contact and company list management"
  },
  {
   "name": "Filters",
   "description": "Saved filters for lead segmentation"
  },
  {
   "name": "Lead Scoring",
   "description": "Lead scoring models and configuration"
  },
  {
   "name": "Members",
   "description": "Team member management"
  },
  {
   "name": "Admin - Team Management",
   "description": "Invite team members and manage team roles & permissions"
  },
  {
   "name": "Location",
   "description": "Lookup countries, states, and cities used in filters"
  },
  {
   "name": "Warmup API",
   "description": "Email warmup automation for building sender reputation and improving deliverability"
  },
  {
   "name": "Intent Topics",
   "description": "Manage 3rd-party intent data subscriptions. Intent topics let you receive leads that are actively researching a particular subject (e.g. \"CRM Software Buyers\") even if those companies have never visited your website. Each topic targets a specific audience profile (role keywords + industry constraints) and delivers matching leads to your dashboard daily based on your configured daily limit."
  },
  {
   "name": "Inbox",
   "description": "Read and answer the replies to your campaigns"
  },
  {
   "name": "LinkedIn",
   "description": "Your LinkedIn accounts and campaigns"
  },
  {
   "name": "Outreach Domains",
   "description": "Domains for your sending mailboxes"
  },
  {
   "name": "Mailboxes",
   "description": "Your sending mailboxes"
  },
  {
   "name": "Ads",
   "description": "Ad audiences built from your leads"
  },
  {
   "name": "Account",
   "description": "Account-wide settings"
  },
  {
   "name": "Billing",
   "description": "Invoices, credits and auto top-up"
  }
 ],
 "security": [
  {
   "privateKey": []
  }
 ],
 "paths": {
  "/admin/automations/{id}": {
   "delete": {
    "summary": "Delete an automation",
    "description": "Permanently deletes an automation workflow by its ID",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the automation to delete"
     }
    ],
    "responses": {
     "200": {
      "description": "Automation deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "Successful"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "404": {
      "description": "Automation not found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "No automation found"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Validation error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "delete_automation"
   },
   "get": {
    "summary": "Get a single automation by ID",
    "description": "Retrieves detailed information about a specific automation",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the automation",
      "example": "507f1f77bcf86cd799439011"
     },
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "responses": {
     "200": {
      "description": "Automation retrieved successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "isActive": {
           "type": "boolean"
          },
          "trigger": {
           "type": "string",
           "enum": [
            "only-on-first-visit",
            "on-every-visit",
            "none"
           ]
          },
          "then": {
           "type": "string",
           "enum": [
            "send-to-slack",
            "send-to-hubspot",
            "send-to-pipedrive",
            "send-to-salesforce",
            "send-to-zoho",
            "send-to-gohighlevel",
            "trigger-webhook",
            "send-to-zapier",
            "send-to-clay",
            "send-to-emailCampaign",
            "send-to-linkedinCampaign",
            "send-email-alert",
            "send-csv-on-email",
            "send-to-googleAdsCampaign",
            "send-to-linkedinAdsAudience",
            "send-to-metaAdsAudience"
           ]
          },
          "interval": {
           "type": "string",
           "enum": [
            "immediately",
            "after-session",
            "daily",
            "weekly",
            "monthly"
           ]
          },
          "when": {
           "type": "string",
           "enum": [
            "new-lead-is-identified",
            "new-intent-data-triggered",
            "new-prospector-lead",
            "new-web-scraping-signal",
            "new-scout-lead",
            "new-linkedin-engagement",
            "new-tag-added-to-lead"
           ]
          },
          "emailVerification": {
           "type": "object"
          },
          "contactPersona": {
           "type": "object"
          },
          "actions": {
           "type": "object"
          }
         }
        },
        "example": {
         "name": "Sending leads to slack",
         "isActive": false,
         "trigger": "only-on-first-visit",
         "then": "send-to-slack",
         "interval": "daily",
         "when": "new-lead-is-identified",
         "emailVerification": {
          "allowOnlyValidEmails": false,
          "allowCatchAllEmails": false,
          "allowGuessedEmails": true,
          "allowWithoutEmails": false
         },
         "contactSelectionStrategy": "exact-job-titles",
         "recipientEmail": "johndoe@gmail.com",
         "personalMessage": "",
         "contactPersona": {
          "roles": [
           "CEO",
           "Manager"
          ],
          "excludedRoles": [
           "Developer"
          ]
         },
         "maxContactsToSend": 5,
         "actions": {
          "sentToSlack": {
           "paragraph": "",
           "sendMessagesTo": "General",
           "howManyToAdd": 4
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "404": {
      "description": "Automation not found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "automation not found."
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_automation"
   },
   "patch": {
    "summary": "Enable or disable an automation",
    "description": "Toggles the active status of an automation without modifying other settings",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the automation",
      "example": "507f1f77bcf86cd799439011"
     },
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "isActive"
        ],
        "properties": {
         "isActive": {
          "type": "boolean",
          "description": "Set to true to enable, false to disable"
         }
        }
       },
       "example": {
        "isActive": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Automation status updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "isActive": {
           "type": "boolean"
          },
          "website": {
           "type": "object"
          },
          "filter": {
           "type": "object"
          },
          "then": {
           "type": "string"
          },
          "interval": {
           "type": "string"
          },
          "when": {
           "type": "string"
          },
          "contactPersona": {
           "type": "object"
          },
          "actions": {
           "type": "object"
          }
         }
        },
        "example": {
         "_id": "1bcedff0021cdeafd",
         "name": "any_name",
         "isActive": false,
         "website": {},
         "filter": {},
         "then": "send-to-pipedrive",
         "interval": "immediately",
         "when": "new-lead-is-identified",
         "contactPersona": {
          "roles": {},
          "excludedRoles": []
         },
         "actions": {
          "sentToHubspot": {
           "assignContactsTo": null
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "404": {
      "description": "Automation not found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "No automation found"
        }
       }
      }
     },
     "405": {
      "description": "Validation error"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "toggle_automation"
   },
   "put": {
    "summary": "Update an automation",
    "description": "Updates an existing automation with new configuration",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the automation to update",
      "example": "507f1f77bcf86cd799439011"
     },
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "id",
         "name",
         "isActive",
         "then",
         "when",
         "actions"
        ],
        "properties": {
         "id": {
          "type": "string",
          "description": "Automation ID (must match path parameter)"
         },
         "name": {
          "type": "string",
          "description": "Name of the automation"
         },
         "isActive": {
          "type": "boolean",
          "description": "Whether automation is active"
         },
         "filter": {
          "type": "object",
          "description": "Filter criteria for leads"
         },
         "then": {
          "type": "string",
          "enum": [
           "send-to-slack",
           "send-to-hubspot",
           "send-to-pipedrive",
           "send-to-salesforce",
           "send-to-zoho",
           "send-to-gohighlevel",
           "trigger-webhook",
           "send-to-zapier",
           "send-to-clay",
           "send-to-emailCampaign",
           "send-to-linkedinCampaign",
           "send-email-alert",
           "send-csv-on-email",
           "send-to-googleAdsCampaign",
           "send-to-linkedinAdsAudience",
           "send-to-metaAdsAudience"
          ],
          "description": "Action to perform"
         },
         "when": {
          "type": "string",
          "enum": [
           "new-lead-is-identified",
           "new-intent-data-triggered",
           "new-prospector-lead",
           "new-web-scraping-signal",
           "new-scout-lead",
           "new-linkedin-engagement",
           "new-tag-added-to-lead"
          ],
          "description": "Trigger event"
         },
         "interval": {
          "type": "string",
          "enum": [
           "immediately",
           "after-session",
           "daily",
           "weekly",
           "monthly"
          ],
          "description": "Execution interval"
         },
         "actions": {
          "type": "object",
          "description": "Action-specific configurations",
          "properties": {
           "sentToHubspot": {
            "type": "object",
            "properties": {
             "assignContactsTo": {
              "type": "string",
              "nullable": true
             }
            }
           }
          }
         }
        }
       },
       "example": {
        "name": "any_name",
        "isActive": true,
        "then": "send-to-pipedrive",
        "when": "new-lead-is-identified",
        "actions": {
         "sentToHubspot": {
          "assignContactsTo": null
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Automation updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "isActive": {
           "type": "boolean"
          },
          "website": {
           "type": "object"
          },
          "filter": {
           "type": "object"
          },
          "then": {
           "type": "string"
          },
          "interval": {
           "type": "string"
          },
          "when": {
           "type": "string"
          },
          "contactPersona": {
           "type": "object"
          },
          "actions": {
           "type": "object"
          }
         }
        },
        "example": {
         "_id": "1bcedff0021cdeafd",
         "name": "any_name",
         "isActive": true,
         "website": {},
         "filter": {},
         "then": "send-to-pipedrive",
         "interval": "immediately",
         "when": "new-lead-is-identified",
         "contactPersona": {
          "roles": {},
          "excludedRoles": []
         },
         "actions": {
          "sentToHubspot": {
           "assignContactsTo": null
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "404": {
      "description": "Automation not found"
     },
     "405": {
      "description": "Validation error"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "update_automation"
   }
  },
  "/admin/automations": {
   "get": {
    "summary": "Get all automations for a website",
    "description": "Retrieves all automation workflows configured for a specific website",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "601733dbcedff50114a599f6"
     },
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved automations",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "_id": {
            "type": "string"
           },
           "name": {
            "type": "string"
           },
           "isActive": {
            "type": "boolean"
           },
           "trigger": {
            "type": "string",
            "enum": [
             "only-on-first-visit",
             "on-every-visit",
             "none"
            ]
           },
           "then": {
            "type": "string",
            "enum": [
             "send-to-slack",
             "send-to-hubspot",
             "send-to-pipedrive",
             "send-to-salesforce",
             "send-to-zoho",
             "send-to-gohighlevel",
             "trigger-webhook",
             "send-to-zapier",
             "send-to-clay",
             "send-to-emailCampaign",
             "send-to-linkedinCampaign",
             "send-email-alert",
             "send-csv-on-email",
             "send-to-googleAdsCampaign",
             "send-to-linkedinAdsAudience",
             "send-to-metaAdsAudience"
            ]
           },
           "interval": {
            "type": "string",
            "enum": [
             "immediately",
             "after-session",
             "daily",
             "weekly",
             "monthly"
            ]
           },
           "when": {
            "type": "string",
            "enum": [
             "new-lead-is-identified",
             "new-intent-data-triggered",
             "new-prospector-lead",
             "new-web-scraping-signal",
             "new-scout-lead",
             "new-linkedin-engagement",
             "new-tag-added-to-lead"
            ]
           },
           "emailVerification": {
            "type": "object",
            "properties": {
             "allowOnlyValidEmails": {
              "type": "boolean"
             },
             "allowCatchAllEmails": {
              "type": "boolean"
             },
             "allowGuessedEmails": {
              "type": "boolean"
             },
             "allowWithoutEmails": {
              "type": "boolean"
             }
            }
           },
           "contactSelectionStrategy": {
            "type": "string",
            "enum": [
             "exact-job-titles",
             "flexible-job-titles",
             "flexible-find-at-least-one-job-titles"
            ]
           },
           "recipientEmail": {
            "type": "string"
           },
           "personalMessage": {
            "type": "string"
           },
           "contactPersona": {
            "type": "object",
            "properties": {
             "roles": {
              "type": "array",
              "items": {
               "type": "string"
              }
             },
             "excludedRoles": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            }
           },
           "maxContactsToSend": {
            "type": "integer"
           },
           "actions": {
            "type": "object",
            "properties": {
             "sentToSlack": {
              "type": "object",
              "properties": {
               "paragraph": {
                "type": "string"
               },
               "sendMessagesTo": {
                "type": "string"
               },
               "howManyToAdd": {
                "type": "integer"
               }
              }
             }
            }
           }
          }
         }
        },
        "example": [
         {
          "name": "Sending leads to slack",
          "isActive": false,
          "trigger": "only-on-first-visit",
          "then": "send-to-slack",
          "interval": "daily",
          "when": "new-lead-is-identified",
          "emailVerification": {
           "allowOnlyValidEmails": false,
           "allowCatchAllEmails": false,
           "allowGuessedEmails": true,
           "allowWithoutEmails": false
          },
          "contactSelectionStrategy": "exact-job-titles",
          "recipientEmail": "johndoe@gmail.com",
          "personalMessage": "",
          "contactPersona": {
           "roles": [
            "CEO",
            "Manager"
           ],
           "excludedRoles": [
            "Developer"
           ]
          },
          "maxContactsToSend": 5,
          "actions": {
           "sentToSlack": {
            "paragraph": "",
            "sendMessagesTo": "General",
            "howManyToAdd": 4
           }
          }
         }
        ]
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing or invalid websiteId",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "list_automations"
   },
   "post": {
    "summary": "Create a new automation",
    "description": "Creates a new automation workflow for lead engagement with various triggers and actions",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "isActive",
         "website",
         "when",
         "then"
        ],
        "properties": {
         "name": {
          "type": "string",
          "description": "Name of the automation",
          "example": "Send new leads to Slack"
         },
         "isActive": {
          "type": "boolean",
          "description": "Whether automation is active",
          "example": false
         },
         "website": {
          "type": "string",
          "description": "Website ID this automation belongs to",
          "example": "b7a8fbc49ef48a6e6a03"
         },
         "filter": {
          "type": "object",
          "nullable": true,
          "description": "Filter criteria for leads"
         },
         "trigger": {
          "type": "string",
          "enum": [
           "only-on-first-visit",
           "on-every-visit",
           "none"
          ],
          "default": "only-on-first-visit"
         },
         "when": {
          "type": "string",
          "enum": [
           "new-lead-is-identified",
           "new-intent-data-triggered",
           "new-prospector-lead",
           "new-web-scraping-signal",
           "new-scout-lead",
           "new-linkedin-engagement",
           "new-tag-added-to-lead"
          ],
          "description": "Event that triggers the automation",
          "example": "new-lead-is-identified"
         },
         "then": {
          "type": "string",
          "enum": [
           "send-to-slack",
           "send-to-hubspot",
           "send-to-pipedrive",
           "send-to-salesforce",
           "send-to-zoho",
           "send-to-gohighlevel",
           "trigger-webhook",
           "send-to-zapier",
           "send-to-clay",
           "send-to-emailCampaign",
           "send-to-linkedinCampaign",
           "send-email-alert",
           "send-csv-on-email",
           "send-to-googleAdsCampaign",
           "send-to-linkedinAdsAudience",
           "send-to-metaAdsAudience"
          ],
          "description": "Action to perform",
          "example": "send-to-slack"
         },
         "interval": {
          "type": "string",
          "enum": [
           "immediately",
           "after-session",
           "daily",
           "weekly",
           "monthly"
          ],
          "default": "daily"
         },
         "contactPersona": {
          "type": "object",
          "properties": {
           "roles": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "example": [
             "CEO",
             "Manager"
            ]
           },
           "excludedRoles": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "example": [
             "Developer"
            ]
           }
          }
         },
         "emailVerification": {
          "type": "object",
          "properties": {
           "allowOnlyValidEmails": {
            "type": "boolean",
            "default": false
           },
           "allowCatchAllEmails": {
            "type": "boolean",
            "default": false
           },
           "allowGuessedEmails": {
            "type": "boolean",
            "default": true
           },
           "allowWithoutEmails": {
            "type": "boolean",
            "default": false
           }
          }
         },
         "contactSelectionStrategy": {
          "type": "string",
          "enum": [
           "exact-job-titles",
           "flexible-job-titles",
           "flexible-find-at-least-one-job-titles"
          ],
          "default": "exact-job-titles"
         },
         "maxContactsToSend": {
          "type": "integer",
          "default": 5
         },
         "actions": {
          "type": "object",
          "description": "Action-specific configurations",
          "properties": {
           "sentToSlack": {
            "type": "object",
            "properties": {
             "sendMessagesTo": {
              "type": "string",
              "description": "Slack channel, e.g.",
              "example": "#leads"
             },
             "messageTemplate": {
              "type": "string",
              "description": "Message with merge fields such as {{name}} and {{company}}; empty uses the saved template"
             },
             "howManyToAdd": {
              "type": "integer",
              "example": 5
             }
            }
           },
           "sentToWebhook": {
            "type": "object",
            "properties": {
             "url": {
              "type": "string",
              "example": "https://webhook.site/your-unique-id"
             },
             "whenToPush": {
              "type": "string",
              "enum": [
               "every-time",
               "only-with-suggested-contacts"
              ]
             }
            }
           },
           "sendToClay": {
            "type": "object",
            "properties": {
             "url": {
              "type": "string",
              "description": "The webhook URL of your Clay table"
             },
             "whenToPush": {
              "type": "string",
              "enum": [
               "every-time",
               "only-with-suggested-contacts"
              ]
             }
            }
           },
           "sentToEmailCampaign": {
            "type": "object",
            "properties": {
             "emailCampaign": {
              "type": "string",
              "description": "Campaign ID from GET /admin/email-campaigns"
             },
             "emailAccounts": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            }
           },
           "sentToHubspot": {
            "type": "object",
            "properties": {
             "action": {
              "type": "string",
              "enum": [
               "create-a-contact",
               "create-a-company",
               "create-a-deal",
               "create-a-lead"
              ]
             },
             "assignContactsTo": {
              "type": "string",
              "description": "Owner ID from GET /v3/crm/owners"
             }
            }
           },
           "sentToPipedrive": {
            "type": "object",
            "properties": {
             "assignContactsTo": {
              "type": "string"
             }
            }
           },
           "sentToSalesforce": {
            "type": "object",
            "properties": {
             "assignContactsTo": {
              "type": "string"
             }
            }
           },
           "sentToZoho": {
            "type": "object",
            "properties": {
             "assignContactsTo": {
              "type": "string"
             }
            }
           },
           "sentToGoHighLevel": {
            "type": "object",
            "properties": {
             "assignContactsTo": {
              "type": "string"
             },
             "createOpportunity": {
              "type": "boolean"
             },
             "pipelineId": {
              "type": "string"
             },
             "pipelineStageId": {
              "type": "string"
             },
             "opportunityStatus": {
              "type": "string",
              "enum": [
               "open",
               "won",
               "lost",
               "abandoned"
              ]
             },
             "tags": {
              "type": "array",
              "items": {
               "type": "string"
              }
             }
            }
           }
          }
         }
        }
       },
       "example": {
        "name": "Testing automation",
        "isActive": false,
        "website": "b7a8fbc49ef48a6e6a03",
        "filter": null,
        "then": "send-to-slack",
        "when": "new-lead-is-identified",
        "interval": "daily",
        "contactPersona": {
         "roles": [
          "CEO"
         ],
         "excludedRoles": [
          "Marketer"
         ]
        },
        "actions": {
         "sentToSlack": {
          "paragraph": "",
          "sendMessagesTo": "random",
          "howManyToAdd": 12
         }
        },
        "emailVerification": {
         "allowOnlyValidEmails": true
        },
        "contactSelectionStrategy": "exact-job-titles"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Automation created successfully",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Automation"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error or missing required fields"
     }
    },
    "x-mcp-tool": "create_automation"
   }
  },
  "/admin/automations/rerun-single": {
   "post": {
    "summary": "Rerun a specific automation type for a lead",
    "description": "Manually rerun a specific automation (webhook, slack, hubspot, etc.) for a single lead",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "leadId",
         "automationType",
         "websiteId"
        ],
        "properties": {
         "leadId": {
          "type": "string",
          "description": "Lead ID to rerun automation for"
         },
         "automationType": {
          "type": "string",
          "enum": [
           "webhook",
           "slack",
           "hubspot",
           "pipedrive",
           "zoho",
           "zapier",
           "salesforce",
           "mailchimp",
           "email-campaign"
          ],
          "description": "Type of automation to rerun"
         },
         "websiteId": {
          "type": "string",
          "description": "Website ID the lead belongs to"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Automation rerun successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "result": {
           "type": "object",
           "properties": {
            "success": {
             "type": "boolean"
            },
            "message": {
             "type": "string"
            },
            "executedAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request"
     },
     "401": {
      "description": "Unauthorized"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "rerun_automation_for_lead"
   }
  },
  "/admin/automations/re-trigger": {
   "post": {
    "summary": "Retrigger automations for specific leads",
    "description": "Manually retrigger all active automations for selected leads",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "selectedLeads",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Single lead ID (for backward compatibility)"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "leadIds",
         "websiteId"
        ],
        "properties": {
         "leadIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Array of lead IDs to retrigger automations for",
          "example": [
           "1",
           "2",
           "3"
          ]
         },
         "websiteId": {
          "type": "string",
          "description": "Website ID the leads belong to",
          "example": "601733dbcedff50114a599f6"
         }
        }
       },
       "example": {
        "leadIds": [
         "1",
         "2"
        ],
        "websiteId": "601733dbcedff50114a599f6"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Automations retriggered successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required fields",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "retrigger_automations"
   }
  },
  "/admin/domain-blacklist": {
   "delete": {
    "summary": "Delete domain blacklist",
    "description": "Removes domains from the blacklist for a specific website",
    "tags": [
     "Domain Blacklist"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "b7a8fbc49ef48a6e6a03"
     },
     {
      "in": "query",
      "name": "csv",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "CSV file identifier to delete",
      "example": "blacklist.csv"
     }
    ],
    "responses": {
     "200": {
      "description": "Domain blacklist deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required parameters"
     },
     "500": {
      "description": "Server error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "An error occurred"
        }
       }
      }
     }
    },
    "x-mcp-tool": "remove_from_domain_blacklist"
   },
   "get": {
    "summary": "Get domain blacklist for a website",
    "description": "Retrieves all blacklisted domains for a specific website",
    "tags": [
     "Domain Blacklist"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "4bc00dba8921abcdc"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved domain blacklist",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "result": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "websiteId": {
              "type": "string"
             },
             "csv": {
              "type": "string"
             },
             "domain": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "example": {
         "result": [
          {
           "websiteId": "4bc00dba8921abcdc",
           "csv": "",
           "domain": "example.com"
          }
         ]
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing websiteId"
     }
    },
    "x-mcp-tool": "get_domain_blacklist"
   },
   "post": {
    "summary": "Create domain blacklist entry",
    "description": "Adds a domain to the blacklist to prevent tracking from that domain",
    "tags": [
     "Domain Blacklist"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "csv",
         "domain"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "ID of the website",
          "example": "b7a8fbc49ef48a6e6a03"
         },
         "csv": {
          "type": "string",
          "description": "CSV file name or identifier",
          "example": ""
         },
         "domain": {
          "type": "string",
          "description": "Domain to blacklist",
          "example": "example.com"
         }
        }
       },
       "example": {
        "websiteId": "b7a8fbc49ef48a6e6a03",
        "csv": "",
        "domain": "example.com"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Domain blacklist created successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required fields"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "add_to_domain_blacklist"
   }
  },
  "/admin/email-accounts/{id}": {
   "delete": {
    "summary": "Delete an email account",
    "description": "Permanently deletes an email account and restores account limits",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email account ID to delete",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "responses": {
     "200": {
      "description": "Email account deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Email account deleted"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Account or email account not found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "msg": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "example": {
         "status": [
          {
           "msg": "Email account not found"
          }
         ]
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "delete_email_account"
   },
   "get": {
    "summary": "Get a single email account",
    "description": "Retrieves details of a specific email account by ID",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email account ID",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved email account",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "websiteId": {
           "type": "string"
          },
          "email": {
           "type": "string",
           "format": "email"
          },
          "fullName": {
           "type": "string"
          },
          "imapEmail": {
           "type": "string"
          },
          "imapHost": {
           "type": "string"
          },
          "imapPort": {
           "type": "number"
          },
          "smtpEmail": {
           "type": "string"
          },
          "smtpHost": {
           "type": "string"
          },
          "smtpPort": {
           "type": "number"
          },
          "messagesPerDayLimit": {
           "type": "number"
          },
          "active": {
           "type": "boolean"
          },
          "createdAt": {
           "type": "string",
           "format": "date-time"
          }
         }
        },
        "example": {
         "_id": "507f1f77bcf86cd799439011",
         "websiteId": "601733dbcedff50114a599f6",
         "email": "sales@example.com",
         "fullName": "John Doe",
         "imapEmail": "sales@example.com",
         "imapHost": "imap.gmail.com",
         "imapPort": 993,
         "smtpEmail": "sales@example.com",
         "smtpHost": "smtp.gmail.com",
         "smtpPort": 587,
         "messagesPerDayLimit": 50,
         "active": true,
         "createdAt": "2024-01-01T00:00:00.000Z"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Email account not found or validation error"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_email_account"
   }
  },
  "/admin/email-accounts": {
   "get": {
    "summary": "Get email accounts for a website",
    "description": "Retrieves all email accounts configured for a specific website",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved email accounts",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "_id": {
            "type": "string",
            "description": "Email account ID"
           },
           "websiteId": {
            "type": "string",
            "description": "Associated website ID"
           },
           "email": {
            "type": "string",
            "format": "email",
            "description": "Email address"
           },
           "provider": {
            "type": "string",
            "description": "Email provider (gmail, outlook, etc.)"
           },
           "host": {
            "type": "string",
            "description": "SMTP host"
           },
           "port": {
            "type": "number",
            "description": "SMTP port"
           },
           "secure": {
            "type": "boolean",
            "description": "Use SSL/TLS"
           },
           "active": {
            "type": "boolean",
            "description": "Account is active"
           },
           "createdAt": {
            "type": "string",
            "format": "date-time"
           },
           "updatedAt": {
            "type": "string",
            "format": "date-time"
           }
          }
         }
        },
        "example": [
         {
          "_id": "507f1f77bcf86cd799439011",
          "websiteId": "601733dbcedff50114a599f6",
          "email": "sales@example.com",
          "provider": "gmail",
          "host": "smtp.gmail.com",
          "port": 587,
          "secure": true,
          "active": true,
          "createdAt": "2024-01-01T00:00:00.000Z",
          "updatedAt": "2024-01-01T00:00:00.000Z"
         }
        ]
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing websiteId",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "list_email_accounts"
   },
   "post": {
    "summary": "Create a new email account",
    "description": "Creates a new email account with SMTP/IMAP configuration",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Website ID to associate the email account with"
         },
         "fullName": {
          "type": "string",
          "description": "Full name of the email account owner"
         },
         "email": {
          "type": "string",
          "format": "email",
          "description": "Email address"
         },
         "imapEmail": {
          "type": "string",
          "description": "IMAP email address"
         },
         "imapHost": {
          "type": "string",
          "description": "IMAP server host"
         },
         "imapPort": {
          "type": "number",
          "description": "IMAP server port"
         },
         "imapTLS": {
          "type": "boolean",
          "description": "Use TLS for IMAP"
         },
         "smtpEmail": {
          "type": "string",
          "description": "SMTP email address"
         },
         "smtpHost": {
          "type": "string",
          "description": "SMTP server host"
         },
         "smtpPort": {
          "type": "number",
          "description": "SMTP server port"
         },
         "smtpTLS": {
          "type": "boolean",
          "description": "Use TLS for SMTP"
         }
        }
       },
       "example": {
        "websiteId": "601733dbcedff50114a599f6",
        "fullName": "John Doe",
        "email": "john@example.com",
        "imapEmail": "john@example.com",
        "imapHost": "imap.gmail.com",
        "imapPort": 993,
        "imapTLS": true,
        "smtpEmail": "john@example.com",
        "smtpHost": "smtp.gmail.com",
        "smtpPort": 587,
        "smtpTLS": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Email account created successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "websiteId": {
           "type": "string"
          },
          "email": {
           "type": "string"
          },
          "active": {
           "type": "boolean"
          }
         }
        },
        "example": {
         "_id": "507f1f77bcf86cd799439011",
         "websiteId": "601733dbcedff50114a599f6",
         "email": "john@example.com",
         "active": true
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error or website not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "add_email_account"
   },
   "put": {
    "summary": "Update email account details",
    "description": "Updates configuration and settings for an existing email account",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "emailAccountId",
         "messagesPerDayLimit"
        ],
        "properties": {
         "emailAccountId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Email account ID to update"
         },
         "messagesPerDayLimit": {
          "type": "number",
          "description": "Maximum messages to send per day",
          "minimum": 0,
          "maximum": 500
         },
         "firstname": {
          "type": "string",
          "description": "First name"
         },
         "lastname": {
          "type": "string",
          "description": "Last name"
         },
         "company": {
          "type": "string",
          "description": "Company name"
         },
         "position": {
          "type": "string",
          "description": "Job position"
         },
         "phoneNumber": {
          "type": "string",
          "description": "Phone number"
         },
         "signatureHTML": {
          "type": "string",
          "description": "HTML email signature"
         },
         "emailWarmUp": {
          "type": "number",
          "description": "Email warm-up setting"
         },
         "emailForward": {
          "type": "string",
          "format": "email",
          "description": "Forward emails to this address"
         }
        }
       },
       "example": {
        "emailAccountId": "507f1f77bcf86cd799439011",
        "messagesPerDayLimit": 50,
        "firstname": "John",
        "lastname": "Doe",
        "company": "Example Corp",
        "position": "Sales Manager",
        "phoneNumber": "+1-555-0123",
        "signatureHTML": "<p>Best regards,<br>John Doe</p>",
        "emailWarmUp": 10,
        "emailForward": "forward@example.com"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Email account updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Email account updated successfully"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Email account not found or validation error"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "update_email_account"
   }
  },
  "/admin/email-accounts/{id}/warmup/health": {
   "get": {
    "summary": "Get warmup health status for an account",
    "description": "Check email account health, reputation, and warmup performance",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email account ID"
     }
    ],
    "responses": {
     "200": {
      "description": "Health status retrieved successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "health": {
           "type": "object",
           "properties": {
            "reputation": {
             "type": "string",
             "enum": [
              "excellent",
              "good",
              "fair",
              "poor",
              "critical"
             ],
             "example": "good"
            },
            "score": {
             "type": "number",
             "description": "Health score (0-100)",
             "example": 85
            },
            "spamRate": {
             "type": "string",
             "description": "Spam rate percentage",
             "example": "0.50"
            },
            "issues": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "example": []
            },
            "totalSent": {
             "type": "number",
             "example": 120
            },
            "spamReports": {
             "type": "number",
             "example": 1
            }
           }
          },
          "warmupStatus": {
           "type": "object",
           "properties": {
            "enabled": {
             "type": "boolean",
             "example": true
            },
            "currentWeek": {
             "type": "number",
             "example": 3
            },
            "dailyLimit": {
             "type": "number",
             "example": 25
            },
            "todaySent": {
             "type": "number",
             "example": 18
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_warmup_health"
   }
  },
  "/admin/email-accounts/warmup/stats": {
   "get": {
    "summary": "Get warmup statistics for all accounts in a website",
    "description": "Retrieve warmup stats including total sent/received, health status, etc.",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID"
     }
    ],
    "responses": {
     "200": {
      "description": "Statistics retrieved successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "stats": {
           "type": "object",
           "properties": {
            "total": {
             "type": "number",
             "description": "Total email accounts",
             "example": 10
            },
            "warmupEnabled": {
             "type": "number",
             "description": "Accounts with warmup enabled",
             "example": 5
            },
            "connected": {
             "type": "number",
             "description": "Connected accounts",
             "example": 8
            },
            "totalSent": {
             "type": "number",
             "description": "Total warmup emails sent",
             "example": 234
            },
            "totalReceived": {
             "type": "number",
             "description": "Total warmup emails received",
             "example": 198
            },
            "accounts": {
             "type": "array",
             "description": "Individual account details",
             "items": {
              "type": "object",
              "properties": {
               "_id": {
                "type": "string"
               },
               "email": {
                "type": "string"
               },
               "warmupEnabled": {
                "type": "boolean"
               },
               "connected": {
                "type": "boolean"
               },
               "warmupStats": {
                "type": "object"
               },
               "warmupSettings": {
                "type": "object"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Validation error"
     },
     "403": {
      "description": "Unauthorized"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_warmup_stats"
   }
  },
  "/admin/email-providers": {
   "get": {
    "summary": "Get email provider SMTP/IMAP configurations",
    "description": "## Overview\nReturns pre-configured SMTP and IMAP settings for supported email providers.\nThis endpoint helps users quickly connect email accounts without manually looking up server settings.\n\n## How Provider Detection Works\n\n### Auto-Detection (With Email Parameter)\nWhen you provide an email address:\n- Extracts domain from email (e.g., \"@gmail.com\")\n- Matches against known provider domains\n- Returns pre-configured settings for that provider\n- Example: \"user@gmail.com\" → Gmail SMTP/IMAP settings\n\n### Manual Selection (No Email Parameter)\nWithout email parameter:\n- Returns list of providers to choose from\n- Popular providers: Gmail, Outlook, Yahoo, etc.\n- All providers: Includes less common providers\n\n## Provider Types\n\n### Popular Providers (default)\nMost commonly used email services:\n- **Gmail** (Google Workspace)\n- **Outlook** (Microsoft 365, Outlook.com, Hotmail)\n- **Yahoo Mail**\n- **iCloud Mail** (Apple)\n- **ProtonMail**\n- **Zoho Mail**\n\n### All Providers\nIncludes popular + additional providers:\n- Domain-specific providers\n- Regional email services\n- Enterprise email solutions\n- ISP email services\n\n## Provider Configuration Format\n\nEach provider includes:\n```javascript\n{\n  id: \"gmail\",\n  name: \"Gmail\",\n  displayName: \"Gmail (Google)\",\n  smtp: {\n    host: \"smtp.gmail.com\",\n    port: 587,\n    tls: true,\n    auth: true\n  },\n  imap: {\n    host: \"imap.gmail.com\",\n    port: 993,\n    tls: true,\n    auth: true\n  },\n  domains: [\"gmail.com\", \"googlemail.com\"],\n  instructions: \"Use App Password instead of regular password\"\n}\n```\n\n## Common Use Cases\n\n**Use Case 1: Email Account Setup UI**\n```javascript\n// Load popular providers for dropdown\nGET /admin/email-providers?type=popular\n// User selects Gmail, pre-fill SMTP/IMAP fields\n```\n\n**Use Case 2: Auto-Detect Provider**\n```javascript\n// User enters email address\nGET /admin/email-providers?email=john@gmail.com\n// Response includes detectedProvider with Gmail settings\n// Auto-fill form with smtp.gmail.com:587, imap.gmail.com:993\n```\n\n**Use Case 3: Show All Options**\n```javascript\n// User clicks \"Show more providers\"\nGET /admin/email-providers?type=all\n// Display expanded list including less common providers\n```\n\n## Important Provider Notes\n\n### Gmail / Google Workspace\n- **Requires App Password**: Cannot use regular Google password\n- Enable 2FA on Google Account first\n- Generate App Password in Google Account settings\n- SMTP: smtp.gmail.com:587 (TLS)\n- IMAP: imap.gmail.com:993 (TLS)\n\n### Outlook / Microsoft 365\n- **OAuth recommended**: Modern auth preferred over password\n- SMTP: smtp-mail.outlook.com:587 (TLS)\n- IMAP: outlook.office365.com:993 (TLS)\n- Also works for: @hotmail.com, @live.com, @msn.com\n\n### Yahoo Mail\n- **Requires App Password**: Enable in Yahoo Account settings\n- SMTP: smtp.mail.yahoo.com:587 (TLS)\n- IMAP: imap.mail.yahoo.com:993 (TLS)\n\n### iCloud Mail\n- **Requires App-Specific Password**: Generate in Apple ID settings\n- SMTP: smtp.mail.me.com:587 (TLS)\n- IMAP: imap.mail.me.com:993 (TLS)\n\n## Security Recommendations\n\n- **Never store passwords in plain text**: Encrypt before storage\n- **Use App Passwords**: More secure than account passwords\n- **TLS required**: All providers require encrypted connections\n- **Test connections**: Use `/admin/email-accounts-test` before saving\n",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "type",
      "schema": {
       "type": "string",
       "enum": [
        "all",
        "popular"
       ],
       "default": "popular"
      },
      "description": "Type of providers to return:\n- `popular`: Common providers (Gmail, Outlook, Yahoo, etc.)\n- `all`: All supported providers including less common ones\n",
      "example": "popular"
     },
     {
      "in": "query",
      "name": "email",
      "schema": {
       "type": "string",
       "format": "email"
      },
      "description": "Email address to auto-detect provider for.\n- Extracts domain and matches against known providers\n- Returns matching provider in `detectedProvider` field\n- Example: \"user@gmail.com\" detects Gmail settings\n",
      "example": "user@gmail.com"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved email provider configurations.\nIncludes SMTP/IMAP settings for each provider.\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "providers": {
           "type": "array",
           "description": "List of email providers with connection settings",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string",
              "description": "Unique provider identifier",
              "example": "gmail"
             },
             "name": {
              "type": "string",
              "description": "Provider name",
              "example": "Gmail"
             },
             "displayName": {
              "type": "string",
              "description": "User-friendly display name",
              "example": "Gmail (Google)"
             },
             "smtp": {
              "type": "object",
              "description": "SMTP server configuration",
              "properties": {
               "host": {
                "type": "string",
                "example": "smtp.gmail.com"
               },
               "port": {
                "type": "integer",
                "example": 587
               },
               "tls": {
                "type": "boolean",
                "example": true
               }
              }
             },
             "imap": {
              "type": "object",
              "description": "IMAP server configuration",
              "properties": {
               "host": {
                "type": "string",
                "example": "imap.gmail.com"
               },
               "port": {
                "type": "integer",
                "example": 993
               },
               "tls": {
                "type": "boolean",
                "example": true
               }
              }
             },
             "domains": {
              "type": "array",
              "description": "Email domains this provider handles",
              "items": {
               "type": "string"
              },
              "example": [
               "gmail.com",
               "googlemail.com"
              ]
             },
             "instructions": {
              "type": "string",
              "description": "Setup instructions for the user",
              "example": "Use App Password instead of regular password"
             }
            }
           }
          },
          "detectedProvider": {
           "type": "object",
           "nullable": true,
           "description": "Auto-detected provider if email parameter was provided.\nContains same structure as items in providers array.\nNull if no provider detected or email not provided.\n"
          }
         }
        },
        "examples": {
         "popularProviders": {
          "summary": "Popular Providers List",
          "value": {
           "providers": [
            {
             "id": "gmail",
             "name": "Gmail",
             "displayName": "Gmail (Google)",
             "smtp": {
              "host": "smtp.gmail.com",
              "port": 587,
              "tls": true
             },
             "imap": {
              "host": "imap.gmail.com",
              "port": 993,
              "tls": true
             },
             "domains": [
              "gmail.com",
              "googlemail.com"
             ],
             "instructions": "Use App Password instead of regular password"
            },
            {
             "id": "outlook",
             "name": "Outlook",
             "displayName": "Outlook (Microsoft 365)",
             "smtp": {
              "host": "smtp-mail.outlook.com",
              "port": 587,
              "tls": true
             },
             "imap": {
              "host": "outlook.office365.com",
              "port": 993,
              "tls": true
             },
             "domains": [
              "outlook.com",
              "hotmail.com",
              "live.com"
             ]
            }
           ],
           "detectedProvider": null
          }
         },
         "autoDetected": {
          "summary": "Auto-Detected Provider (email=user@gmail.com)",
          "value": {
           "providers": [
            {
             "id": "gmail",
             "name": "Gmail",
             "displayName": "Gmail (Google)",
             "smtp": {
              "host": "smtp.gmail.com",
              "port": 587,
              "tls": true
             },
             "imap": {
              "host": "imap.gmail.com",
              "port": 993,
              "tls": true
             }
            }
           ],
           "detectedProvider": {
            "id": "gmail",
            "name": "Gmail",
            "displayName": "Gmail (Google)",
            "smtp": {
             "host": "smtp.gmail.com",
             "port": 587,
             "tls": true
            },
            "imap": {
             "host": "imap.gmail.com",
             "port": 993,
             "tls": true
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "500": {
      "description": "Internal server error while fetching providers",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "error"
          },
          "message": {
           "type": "string",
           "example": "Failed to fetch email providers"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_email_providers"
   }
  },
  "/admin/email-accounts-test": {
   "post": {
    "summary": "Test email account SMTP/IMAP configuration before saving",
    "description": "## Overview\nTests SMTP (sending) and IMAP (receiving) configuration before creating an email account.\nThis prevents saving invalid credentials and helps diagnose connection issues.\n\n## How Testing Works\n\n### SMTP Test (Sending Emails)\n- Attempts to connect to SMTP server\n- Authenticates with provided credentials\n- Sends test email to user's email address\n- Verifies successful delivery\n- Returns `smtp: true` if successful\n\n### IMAP Test (Receiving Emails)\n- Attempts to connect to IMAP server\n- Authenticates with provided credentials\n- Verifies mailbox access\n- Returns `imap: true` if successful\n\n### AI-Powered Error Diagnosis\nWhen tests fail, AI analyzes the error and provides:\n- **Root cause**: What went wrong\n- **Common fixes**: Step-by-step solutions\n- **Provider-specific help**: Gmail, Outlook, etc.\n- **Configuration tips**: Port, TLS, authentication issues\n\n## Common Connection Issues\n\n### Gmail / Google Workspace\n**Problem**: \"Authentication failed\" with correct password\n**Solution**:\n1. Enable 2-Factor Authentication on Google Account\n2. Generate App Password: Google Account → Security → App Passwords\n3. Use App Password instead of regular password\n4. Ensure \"Less secure app access\" is NOT enabled (deprecated)\n\n### Outlook / Microsoft 365\n**Problem**: \"Connection refused\" or \"TLS error\"\n**Solution**:\n- Use `smtp-mail.outlook.com` (not smtp.office365.com)\n- Port 587 with TLS enabled\n- For IMAP: `outlook.office365.com:993`\n- OAuth2 recommended for enterprise accounts\n\n### Yahoo Mail\n**Problem**: \"Invalid credentials\"\n**Solution**:\n1. Enable \"Allow apps that use less secure sign in\"\n2. OR Generate App Password in Yahoo Account settings\n3. Use App Password for authentication\n\n### Generic Issues\n- **Wrong Port**: SMTP usually 587 (TLS) or 465 (SSL), IMAP usually 993\n- **Firewall**: Ensure outbound ports are not blocked\n- **TLS Mismatch**: Enable TLS if provider requires it\n- **Wrong Host**: Use provider's documented server names\n\n## Test Response Codes\n\n### 200 - Both Tests Passed\n```json\n{ \"smtp\": true, \"imap\": true }\n```\n- Safe to save email account\n- Configuration is valid\n\n### 422 - One or Both Tests Failed\n```json\n{\n  \"smtp\": false,\n  \"imap\": true,\n  \"status\": \"SMTP connection failed\",\n  \"aiHelp\": \"Gmail requires an App Password...\"\n}\n```\n- Do NOT save email account\n- Fix issues based on error message and AI help\n- Re-test before saving\n\n## Security Considerations\n\n- **Test email sent**: User receives test email with subject \"Quick note\"\n- **Password not logged**: Credentials never logged in plain text\n- **TLS required**: Connections must use TLS encryption\n- **No storage**: Test doesn't save credentials (only validation)\n\n## Common Use Cases\n\n**Use Case 1: Validate Before Saving**\n```javascript\n// Step 1: Test configuration\nPOST /admin/email-accounts-test\n{ smtpHost: \"smtp.gmail.com\", smtpPort: 587, ... }\n\n// Step 2: If both pass, save account\nif (response.smtp && response.imap) {\n  POST /admin/email-accounts\n  { ... same config ... }\n}\n```\n\n**Use Case 2: Diagnose Connection Issues**\n```javascript\n// Test fails with helpful AI explanation\nPOST /admin/email-accounts-test\nResponse (422):\n{\n  \"smtp\": false,\n  \"imap\": false,\n  \"status\": \"Authentication failed\",\n  \"aiHelp\": \"Gmail requires App Password. Steps: 1) Enable 2FA...\"\n}\n// Display aiHelp to user for troubleshooting\n```\n\n**Use Case 3: Update Existing Account**\n```javascript\n// User changed password, test before updating\nPOST /admin/email-accounts-test\n{ ...existing config, smtpPassword: \"new-password\", imapPassword: \"new-password\" }\n// If passes, update via PUT /admin/email-accounts/{id}\n```\n",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "imapEmail",
         "imapHost",
         "imapPort",
         "smtpEmail",
         "smtpHost",
         "smtpPort",
         "smtpPassword",
         "imapPassword",
         "imapTLS",
         "smtpTLS"
        ],
        "properties": {
         "imapEmail": {
          "type": "string",
          "format": "email",
          "description": "IMAP email address (usually same as SMTP email)",
          "example": "user@gmail.com"
         },
         "imapHost": {
          "type": "string",
          "description": "IMAP server hostname (e.g., imap.gmail.com)",
          "example": "imap.gmail.com"
         },
         "imapPort": {
          "type": "number",
          "description": "IMAP server port (usually 993 for TLS)",
          "example": 993
         },
         "imapTLS": {
          "type": "boolean",
          "description": "Enable TLS encryption for IMAP (recommended)",
          "example": true
         },
         "smtpEmail": {
          "type": "string",
          "format": "email",
          "description": "SMTP email address (usually same as IMAP email)",
          "example": "user@gmail.com"
         },
         "smtpHost": {
          "type": "string",
          "description": "SMTP server hostname (e.g., smtp.gmail.com)",
          "example": "smtp.gmail.com"
         },
         "smtpPort": {
          "type": "number",
          "description": "SMTP server port (usually 587 for TLS, 465 for SSL)",
          "example": 587
         },
         "smtpTLS": {
          "type": "boolean",
          "description": "Enable TLS encryption for SMTP (recommended)",
          "example": true
         }
        }
       },
       "examples": {
        "gmail": {
         "summary": "Gmail Configuration",
         "value": {
          "imapEmail": "user@gmail.com",
          "imapHost": "imap.gmail.com",
          "imapPort": 993,
          "imapTLS": true,
          "smtpEmail": "user@gmail.com",
          "smtpHost": "smtp.gmail.com",
          "smtpPort": 587,
          "smtpTLS": true
         }
        },
        "outlook": {
         "summary": "Outlook/Microsoft 365",
         "value": {
          "imapEmail": "user@outlook.com",
          "imapHost": "outlook.office365.com",
          "imapPort": 993,
          "imapTLS": true,
          "smtpEmail": "user@outlook.com",
          "smtpHost": "smtp-mail.outlook.com",
          "smtpPort": 587,
          "smtpTLS": true
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Both SMTP and IMAP tests passed successfully.\nConfiguration is valid and can be saved.\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "smtp": {
           "type": "boolean",
           "description": "SMTP test result (true = passed)",
           "example": true
          },
          "imap": {
           "type": "boolean",
           "description": "IMAP test result (true = passed)",
           "example": true
          }
         }
        },
        "example": {
         "smtp": true,
         "imap": true
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required fields",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "msg": {
              "type": "string"
             },
             "param": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "example": {
         "status": [
          {
           "msg": "smtpEmail Is Required",
           "param": "smtpEmail"
          },
          {
           "msg": "smtpHost Is Required",
           "param": "smtpHost"
          }
         ]
        }
       }
      }
     },
     "422": {
      "description": "One or both connection tests failed.\nContains error details and AI-generated help for troubleshooting.\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "smtp": {
           "type": "boolean",
           "description": "SMTP test result"
          },
          "imap": {
           "type": "boolean",
           "description": "IMAP test result"
          },
          "status": {
           "type": "string",
           "description": "Raw error message"
          },
          "aiHelp": {
           "type": "string",
           "nullable": true,
           "description": "AI-generated troubleshooting help and solutions"
          }
         }
        },
        "examples": {
         "authenticationFailed": {
          "summary": "Authentication Failed (Gmail)",
          "value": {
           "smtp": false,
           "imap": false,
           "status": "Connection failed: SMTP connection failed and IMAP connection failed",
           "aiHelp": "Gmail requires an App Password instead of your regular Google password. Here's how to fix it:\n\n1. Enable 2-Factor Authentication on your Google Account\n2. Go to Google Account → Security → App Passwords\n3. Generate a new App Password for 'Mail'\n4. Use this 16-character password instead of your regular password\n5. Make sure 'Less secure app access' is disabled (it's deprecated)\n\nYour current settings look correct (smtp.gmail.com:587, imap.gmail.com:993 with TLS), so the password is likely the issue."
          }
         },
         "smtpOnly": {
          "summary": "SMTP Failed, IMAP Passed",
          "value": {
           "smtp": false,
           "imap": true,
           "status": "SMTP connection failed",
           "aiHelp": "SMTP connection failed while IMAP succeeded. This suggests:\n\n1. Check SMTP port: Should be 587 (TLS) or 465 (SSL), not 993\n2. Verify SMTP host is correct (smtp.gmail.com for Gmail)\n3. Ensure TLS is enabled for port 587\n4. Check firewall allows outbound port 587\n\nYour IMAP works fine, so credentials are correct."
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal server error during test execution"
     }
    },
    "x-mcp-tool": "test_email_account"
   }
  },
  "/admin/email-accounts/{id}/check-deliverability": {
   "post": {
    "summary": "Run deliverability check for an email account",
    "description": "Checks SPF, DKIM, DMARC, and custom tracking domain configuration",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email account ID"
     }
    ],
    "responses": {
     "200": {
      "description": "Deliverability check results"
     },
     "401": {
      "description": "Unauthorized"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "run_deliverability_check"
   }
  },
  "/admin/email-accounts/{id}/verify-tracking-domain": {
   "post": {
    "summary": "Verify custom tracking domain CNAME configuration",
    "description": "Verifies that the user's custom tracking domain CNAME record points to the correct destination",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email account ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "customDomain"
        ],
        "properties": {
         "customDomain": {
          "type": "string",
          "description": "The custom domain to verify (e.g., \"example.com\" will check \"trail.example.com\")"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Verification result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "verified": {
           "type": "boolean"
          },
          "message": {
           "type": "string"
          },
          "expectedCname": {
           "type": "string"
          },
          "actualCname": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Unauthorized"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "verify_tracking_domain"
   }
  },
  "/admin/email-accounts/{id}/warmup/toggle": {
   "post": {
    "summary": "Enable or disable email warmup for an account",
    "description": "Toggle email warmup feature on/off for a specific email account",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email account ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "enabled"
        ],
        "properties": {
         "enabled": {
          "type": "boolean",
          "description": "Enable or disable warmup",
          "example": true
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Warmup toggled successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "warmupEnabled": {
           "type": "boolean",
           "example": true
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Validation error"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "toggle_warmup"
   }
  },
  "/admin/email-accounts/{id}/warmup/settings": {
   "put": {
    "summary": "Update email warmup settings",
    "description": "Configure warmup intensity and daily limits for an email account",
    "tags": [
     "Email Accounts"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email account ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "intensity": {
          "type": "string",
          "enum": [
           "conservative",
           "normal",
           "aggressive"
          ],
          "description": "Warmup intensity level",
          "example": "normal"
         },
         "dailyLimit": {
          "type": "number",
          "description": "Maximum warmup emails per day",
          "example": 20,
          "minimum": 5,
          "maximum": 100
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Settings updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "settings": {
           "type": "object",
           "properties": {
            "intensity": {
             "type": "string",
             "example": "normal"
            },
            "dailyLimit": {
             "type": "number",
             "example": 20
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Validation error"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "update_warmup_settings"
   }
  },
  "/admin/email-blacklist": {
   "delete": {
    "summary": "Remove emails from blacklist",
    "description": "Removes all emails associated with a specific CSV from the blacklist",
    "tags": [
     "Email Blacklist"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "601733dbcedff50114a599f6"
     },
     {
      "in": "query",
      "name": "csv",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "CSV identifier to delete",
      "example": ""
     }
    ],
    "responses": {
     "200": {
      "description": "Email blacklist deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required parameters",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "An error occurred"
        }
       }
      }
     }
    },
    "x-mcp-tool": "remove_from_email_blacklist"
   },
   "get": {
    "summary": "Get blacklisted emails for a website",
    "description": "Retrieves all blacklisted email addresses for a specific website",
    "tags": [
     "Email Blacklist"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved email blacklist",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "result": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "_id": {
              "type": "string"
             },
             "website": {
              "type": "string"
             },
             "csv": {
              "type": "string"
             },
             "email": {
              "type": "string",
              "format": "email"
             },
             "createdAt": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        },
        "example": {
         "result": [
          {
           "_id": "507f1f77bcf86cd799439011",
           "website": "601733dbcedff50114a599f6",
           "csv": "",
           "email": "spam@example.com",
           "createdAt": "2024-01-01T00:00:00.000Z"
          },
          {
           "_id": "507f1f77bcf86cd799439012",
           "website": "601733dbcedff50114a599f6",
           "csv": "",
           "email": "noreply@example.com",
           "createdAt": "2024-01-01T00:00:00.000Z"
          }
         ]
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing websiteId"
     },
     "500": {
      "description": "Server error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "An error occurred"
        }
       }
      }
     }
    },
    "x-mcp-tool": "list_email_blacklist"
   },
   "post": {
    "summary": "Add emails to blacklist",
    "description": "Adds multiple email addresses to the blacklist to prevent communication",
    "tags": [
     "Email Blacklist"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "csv",
         "email"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "ID of the website"
         },
         "csv": {
          "type": "string",
          "description": "CSV identifier (use empty string for manual entries)"
         },
         "email": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "email"
          },
          "description": "Array of email addresses to blacklist"
         }
        }
       },
       "example": {
        "websiteId": "601733dbcedff50114a599f6",
        "csv": "",
        "email": [
         "spam@example.com",
         "noreply@example.com",
         "donotcontact@example.com"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Emails added to blacklist successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error or CSV name already exists",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "csvExists": {
          "value": {
           "status": "CSV name already exist for this website"
          }
         },
         "validationError": {
          "value": {
           "status": [
            {
             "msg": "email Is Required",
             "param": "email"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "An error occurred"
        }
       }
      }
     }
    },
    "x-mcp-tool": "add_to_email_blacklist"
   }
  },
  "/admin/email-campaigns/{id}": {
   "delete": {
    "summary": "Delete email campaign",
    "description": "Permanently deletes an email campaign and all associated templates",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email campaign ID to delete",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "responses": {
     "200": {
      "description": "Email campaign deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Email Campaign deleted"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing campaign ID",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "delete_campaign"
   },
   "get": {
    "summary": "Get single email campaign details",
    "description": "Retrieves detailed information about a specific email campaign including statistics",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email campaign ID",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved email campaign with statistics",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "websiteId": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "timeSlot": {
           "type": "object",
           "properties": {
            "from": {
             "type": "string"
            },
            "to": {
             "type": "string"
            }
           }
          },
          "daysRange": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "timezone": {
           "type": "string"
          },
          "status": {
           "type": "string"
          },
          "isTrackingEnabled": {
           "type": "boolean"
          },
          "createdAt": {
           "type": "string",
           "format": "date-time"
          },
          "statistics": {
           "type": "object",
           "properties": {
            "totalLeads": {
             "type": "integer"
            },
            "activeLeads": {
             "type": "integer"
            },
            "completedLeads": {
             "type": "integer"
            },
            "emailsSent": {
             "type": "integer"
            },
            "emailsOpened": {
             "type": "integer"
            },
            "emailsClicked": {
             "type": "integer"
            },
            "responseRate": {
             "type": "number"
            }
           }
          }
         }
        },
        "example": {
         "_id": "507f1f77bcf86cd799439011",
         "websiteId": "601733dbcedff50114a599f6",
         "name": "Welcome Series",
         "timeSlot": {
          "from": "09:00",
          "to": "17:00"
         },
         "daysRange": [
          "monday",
          "tuesday",
          "wednesday"
         ],
         "timezone": "UTC",
         "status": "active",
         "isTrackingEnabled": true,
         "createdAt": "2024-01-01T00:00:00.000Z",
         "statistics": {
          "totalLeads": 150,
          "activeLeads": 45,
          "completedLeads": 105,
          "emailsSent": 420,
          "emailsOpened": 189,
          "emailsClicked": 67,
          "responseRate": 0.14
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing campaign ID"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_campaign"
   },
   "put": {
    "summary": "Update email campaign settings",
    "description": "Updates configuration and settings for an existing email campaign",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email campaign ID to update",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "Campaign name"
         },
         "timeSlot": {
          "type": "object",
          "properties": {
           "from": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
           },
           "to": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$"
           }
          }
         },
         "daysRange": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "monday",
            "tuesday",
            "wednesday",
            "thursday",
            "friday",
            "saturday",
            "sunday"
           ]
          }
         },
         "timezone": {
          "type": "string",
          "description": "Campaign timezone"
         },
         "status": {
          "type": "string",
          "enum": [
           "active",
           "paused",
           "completed"
          ],
          "description": "Campaign status"
         },
         "isTrackingEnabled": {
          "type": "boolean",
          "description": "Enable email tracking"
         }
        }
       },
       "example": {
        "name": "Updated Welcome Series",
        "timeSlot": {
         "from": "08:00",
         "to": "18:00"
        },
        "daysRange": [
         "monday",
         "tuesday",
         "wednesday",
         "thursday",
         "friday"
        ],
        "timezone": "America/New_York",
        "status": "active",
        "isTrackingEnabled": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Email campaign updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "emailCampaign": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "timeSlot": {
             "type": "object"
            },
            "daysRange": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "status": {
             "type": "string"
            },
            "updatedAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        },
        "example": {
         "emailCampaign": {
          "_id": "507f1f77bcf86cd799439011",
          "name": "Updated Welcome Series",
          "timeSlot": {
           "from": "08:00",
           "to": "18:00"
          },
          "daysRange": [
           "monday",
           "tuesday",
           "wednesday",
           "thursday",
           "friday"
          ],
          "status": "active",
          "updatedAt": "2024-01-02T00:00:00.000Z"
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error"
     },
     "500": {
      "description": "Server error or campaign not found"
     }
    },
    "x-mcp-tool": "update_campaign"
   }
  },
  "/admin/email-campaigns-stats/{id}": {
   "get": {
    "summary": "Get email campaign statistics",
    "description": "Retrieves detailed statistics for a specific email campaign including scheduled emails and performance metrics",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email campaign ID",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved campaign statistics",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "newLeadsOnly": {
           "type": "object",
           "properties": {
            "totalScheduled": {
             "type": "integer",
             "description": "Total emails scheduled for new leads"
            },
            "sent": {
             "type": "integer",
             "description": "Emails sent to new leads"
            },
            "pending": {
             "type": "integer",
             "description": "Emails pending for new leads"
            },
            "failed": {
             "type": "integer",
             "description": "Failed emails for new leads"
            }
           }
          },
          "allEmails": {
           "type": "object",
           "properties": {
            "totalScheduled": {
             "type": "integer",
             "description": "Total emails scheduled across all contacts"
            },
            "sent": {
             "type": "integer",
             "description": "Total emails sent"
            },
            "pending": {
             "type": "integer",
             "description": "Total emails pending"
            },
            "failed": {
             "type": "integer",
             "description": "Total failed emails"
            },
            "opened": {
             "type": "integer",
             "description": "Total emails opened"
            },
            "clicked": {
             "type": "integer",
             "description": "Total email clicks"
            },
            "replied": {
             "type": "integer",
             "description": "Total email replies"
            }
           }
          }
         }
        },
        "example": {
         "newLeadsOnly": {
          "totalScheduled": 45,
          "sent": 32,
          "pending": 10,
          "failed": 3
         },
         "allEmails": {
          "totalScheduled": 150,
          "sent": 120,
          "pending": 25,
          "failed": 5,
          "opened": 78,
          "clicked": 23,
          "replied": 12
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing campaign ID"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_campaign_stats"
   }
  },
  "/admin/email-campaigns": {
   "get": {
    "summary": "Get all email campaigns for a website",
    "description": "Retrieves paginated list of email campaigns with sorting options",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "601733dbcedff50114a599f6"
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 1
      },
      "description": "Page number for pagination"
     },
     {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 50,
       "maximum": 100
      },
      "description": "Number of campaigns per page"
     },
     {
      "in": "query",
      "name": "sortProperty",
      "required": false,
      "schema": {
       "type": "string",
       "default": "createdAt",
       "enum": [
        "createdAt",
        "name",
        "status"
       ]
      },
      "description": "Property to sort by"
     },
     {
      "in": "query",
      "name": "order",
      "required": false,
      "schema": {
       "type": "string",
       "default": "desc",
       "enum": [
        "asc",
        "desc"
       ]
      },
      "description": "Sort order"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved email campaigns",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "campaigns": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "_id": {
              "type": "string"
             },
             "websiteId": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "timeSlot": {
              "type": "object"
             },
             "daysRange": {
              "type": "array",
              "items": {
               "type": "string"
              }
             },
             "status": {
              "type": "string",
              "enum": [
               "active",
               "paused",
               "completed"
              ]
             },
             "createdAt": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          },
          "total": {
           "type": "integer"
          },
          "page": {
           "type": "integer"
          },
          "limit": {
           "type": "integer"
          }
         }
        },
        "example": {
         "campaigns": [
          {
           "_id": "507f1f77bcf86cd799439011",
           "websiteId": "601733dbcedff50114a599f6",
           "name": "Welcome Series",
           "timeSlot": {
            "from": "09:00",
            "to": "17:00"
           },
           "daysRange": [
            "monday",
            "tuesday",
            "wednesday"
           ],
           "status": "active",
           "createdAt": "2024-01-01T00:00:00.000Z"
          }
         ],
         "total": 25,
         "page": 1,
         "limit": 50
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - invalid websiteId format"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "list_campaigns"
   },
   "post": {
    "summary": "Create new email campaign",
    "description": "Creates a new email campaign with specified scheduling and configuration",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "daysRange",
         "timeSlot",
         "campaignName"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "ID of the website"
         },
         "campaignName": {
          "type": "string",
          "description": "Name of the email campaign",
          "minLength": 1,
          "maxLength": 100
         },
         "daysRange": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "monday",
            "tuesday",
            "wednesday",
            "thursday",
            "friday",
            "saturday",
            "sunday"
           ]
          },
          "description": "Days when emails should be sent",
          "minItems": 1
         },
         "timeSlot": {
          "type": "object",
          "properties": {
           "from": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$",
            "description": "Start time in HH:MM format"
           },
           "to": {
            "type": "string",
            "pattern": "^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$",
            "description": "End time in HH:MM format"
           }
          },
          "required": [
           "from",
           "to"
          ]
         },
         "timezone": {
          "type": "string",
          "description": "Timezone for scheduling (e.g., UTC, America/New_York)",
          "default": "UTC"
         }
        }
       },
       "example": {
        "websiteId": "601733dbcedff50114a599f6",
        "campaignName": "Welcome Series",
        "daysRange": [
         "monday",
         "tuesday",
         "wednesday",
         "thursday",
         "friday"
        ],
        "timeSlot": {
         "from": "09:00",
         "to": "17:00"
        },
        "timezone": "America/New_York"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Email campaign created successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "emailCampaign": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string"
            },
            "websiteId": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "timeSlot": {
             "type": "object"
            },
            "daysRange": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "timezone": {
             "type": "string"
            },
            "status": {
             "type": "string"
            },
            "createdAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        },
        "example": {
         "emailCampaign": {
          "_id": "507f1f77bcf86cd799439011",
          "websiteId": "601733dbcedff50114a599f6",
          "name": "Welcome Series",
          "timeSlot": {
           "from": "09:00",
           "to": "17:00"
          },
          "daysRange": [
           "monday",
           "tuesday",
           "wednesday",
           "thursday",
           "friday"
          ],
          "timezone": "America/New_York",
          "status": "active",
          "createdAt": "2024-01-01T00:00:00.000Z"
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required fields or invalid format"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "create_campaign"
   }
  },
  "/admin/email-campaigns/{id}/capacity": {
   "get": {
    "summary": "Get comprehensive campaign health analysis",
    "description": "Retrieves comprehensive health analysis including capacity, activity, errors, configuration, and mailbox health",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email campaign ID"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved comprehensive health analysis",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "enum": [
            "operational",
            "warning",
            "critical"
           ]
          },
          "summary": {
           "type": "string"
          },
          "showWarning": {
           "type": "boolean"
          },
          "checks": {
           "type": "object",
           "properties": {
            "capacity": {
             "type": "object"
            },
            "activity": {
             "type": "object"
            },
            "errors": {
             "type": "object"
            },
            "configuration": {
             "type": "object"
            },
            "mailboxes": {
             "type": "object"
            }
           }
          },
          "recommendations": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "type": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "impact": {
              "type": "string"
             },
             "actionUrl": {
              "type": "string"
             }
            }
           }
          },
          "lastChecked": {
           "type": "string",
           "format": "date-time"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_campaign_capacity"
   }
  },
  "/admin/email-campaigns/clone": {
   "post": {
    "summary": "Clone existing email campaign",
    "description": "Creates a copy of an existing email campaign with all its templates and settings",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "emailCampaignId",
         "websiteId"
        ],
        "properties": {
         "emailCampaignId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "ID of the campaign to clone"
         },
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "ID of the website (for verification)"
         }
        }
       },
       "example": {
        "emailCampaignId": "507f1f77bcf86cd799439011",
        "websiteId": "601733dbcedff50114a599f6"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Email campaign cloned successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "websiteId": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "timeSlot": {
           "type": "object"
          },
          "daysRange": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "status": {
           "type": "string"
          },
          "createdAt": {
           "type": "string",
           "format": "date-time"
          }
         }
        },
        "example": {
         "_id": "507f1f77bcf86cd799439012",
         "websiteId": "601733dbcedff50114a599f6",
         "name": "Welcome Series (Copy)",
         "timeSlot": {
          "from": "09:00",
          "to": "17:00"
         },
         "daysRange": [
          "monday",
          "tuesday",
          "wednesday"
         ],
         "status": "active",
         "createdAt": "2024-01-02T00:00:00.000Z"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "404": {
      "description": "Email campaign not found or access denied",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Email Campaign Not Found"
        }
       }
      }
     },
     "405": {
      "description": "Validation error"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "clone_campaign"
   }
  },
  "/admin/email-campaigns/{id}/capacity/dismiss": {
   "post": {
    "summary": "Dismiss campaign capacity warning",
    "description": "Dismisses the capacity warning for a specified number of days (default 7 days)",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email campaign ID"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "dismissDays": {
          "type": "integer",
          "description": "Number of days to dismiss the warning (default 7)",
          "example": 7
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Warning successfully dismissed",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "success": {
           "type": "boolean"
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "dismiss_campaign_capacity_warning"
   }
  },
  "/admin/email-campaign/schedule-contact": {
   "post": {
    "summary": "Schedule contact in email campaign",
    "description": "Adds a contact to an email campaign with optional scheduling and contact details",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "email",
         "emailCampaignId"
        ],
        "properties": {
         "email": {
          "type": "string",
          "format": "email",
          "description": "Contact's email address"
         },
         "emailCampaignId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Email campaign ID to schedule contact in"
         },
         "domain": {
          "type": "string",
          "description": "Contact's company domain"
         },
         "leadId": {
          "type": "string",
          "description": "Associated lead ID if available"
         },
         "firstName": {
          "type": "string",
          "description": "Contact's first name"
         },
         "lastName": {
          "type": "string",
          "description": "Contact's last name"
         },
         "position": {
          "type": "string",
          "description": "Contact's job position"
         },
         "phone": {
          "type": "string",
          "description": "Contact's phone number"
         },
         "scheduledFor": {
          "type": "string",
          "format": "date-time",
          "description": "Specific date/time to schedule (optional)"
         },
         "custom": {
          "type": "object",
          "description": "Custom fields for personalization"
         },
         "emailAccounts": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Specific email accounts to use for sending"
         },
         "validation": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "valid",
            "catch-all",
            "risky"
           ]
          },
          "description": "Accepted for backwards compatibility and ignored. Contacts are not verified when they are added to a campaign.\n"
         }
        }
       },
       "example": {
        "email": "john.doe@example.com",
        "emailCampaignId": "507f1f77bcf86cd799439011",
        "domain": "example.com",
        "firstName": "John",
        "lastName": "Doe",
        "position": "Sales Manager",
        "phone": "+1-555-0123",
        "custom": {
         "companySize": "50-100",
         "industry": "Technology"
        },
        "emailAccounts": [
         "507f1f77bcf86cd799439013"
        ],
        "validation": [
         "valid",
         "catch-all"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Contact scheduled successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "scheduled": {
           "type": "boolean"
          },
          "prospectId": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "contact scheduled successfully",
         "scheduled": true,
         "prospectId": "507f1f77bcf86cd799439014"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error or email campaign not found"
     },
     "409": {
      "description": "Contact is already a prospect in this campaign"
     },
     "422": {
      "description": "The contact could not be scheduled. The body carries a machine-readable `reason` (campaign-inactive, company-excluded, contact-not-found, error-sending, error) and a human-readable `error`.\n"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "add_prospect_to_campaign"
   }
  },
  "/admin/email-campaigns/stop": {
   "post": {
    "summary": "Stop email campaign for specific lead",
    "description": "Stops all email campaign communications for a specific lead and adds them to unsubscribe list",
    "tags": [
     "Email Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Lead ID to stop campaigns for"
     },
     {
      "in": "query",
      "name": "email",
      "required": true,
      "schema": {
       "type": "string",
       "format": "email"
      },
      "description": "Email address to stop campaigns for"
     }
    ],
    "responses": {
     "200": {
      "description": "Email campaign stopped successfully for the lead"
     },
     "401": {
      "description": "Insufficient permissions for this website",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Access denied"
        }
       }
      }
     },
     "404": {
      "description": "Lead not found",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Lead not found"
        }
       }
      }
     },
     "405": {
      "description": "Validation error - invalid leadId or email format",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "errors": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "stop_prospect"
   }
  },
  "/admin/email-templates/{id}": {
   "delete": {
    "summary": "Delete email template",
    "description": "Permanently deletes an email template from a campaign",
    "tags": [
     "Email Templates"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email template ID to delete",
      "example": "507f1f77bcf86cd799439012"
     }
    ],
    "responses": {
     "200": {
      "description": "Email template deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Email template deleted"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing template ID",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "delete_campaign_step"
   },
   "get": {
    "summary": "Get single email template",
    "description": "Retrieves details of a specific email template by its ID",
    "tags": [
     "Email Templates"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email template ID",
      "example": "507f1f77bcf86cd799439012"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved email template",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "type": {
           "type": "string",
           "enum": [
            "sequence",
            "followup",
            "initial"
           ]
          },
          "subjectTemplate": {
           "type": "string",
           "description": "Email subject with templating variables"
          },
          "bodyTemplate": {
           "type": "string",
           "description": "Email body HTML with templating variables"
          },
          "fromTemplate": {
           "type": "string",
           "description": "From field with templating variables"
          },
          "sendingPeriod": {
           "type": "integer",
           "description": "Days to wait before sending this template"
          },
          "sequence": {
           "type": "integer",
           "description": "Order of template in campaign sequence"
          },
          "emailCampaignId": {
           "type": "string",
           "description": "Associated email campaign ID"
          },
          "websiteId": {
           "type": "string",
           "description": "Associated website ID"
          },
          "createdAt": {
           "type": "string",
           "format": "date-time"
          },
          "updatedAt": {
           "type": "string",
           "format": "date-time"
          }
         }
        },
        "example": {
         "_id": "507f1f77bcf86cd799439012",
         "name": "Welcome Email",
         "type": "initial",
         "subjectTemplate": "Welcome to {{company.name}}, {{contact.firstName}}!",
         "bodyTemplate": "<p>Hi {{contact.firstName}},</p><p>Thank you for your interest in {{company.name}}. We're excited to help you grow your business!</p><p>Best regards,<br>{{emailAccount.fullName}}</p>",
         "fromTemplate": "{{emailAccount.fullName}} <{{emailAccount.email}}>",
         "sendingPeriod": 0,
         "sequence": 1,
         "emailCampaignId": "507f1f77bcf86cd799439011",
         "websiteId": "601733dbcedff50114a599f6",
         "createdAt": "2024-01-01T00:00:00.000Z",
         "updatedAt": "2024-01-01T00:00:00.000Z"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing template ID"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_email_template"
   },
   "put": {
    "summary": "Update email template content",
    "description": "Updates an existing email template with new content, validates Twig syntax, and tests rendering",
    "tags": [
     "Email Templates"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email template ID to update",
      "example": "507f1f77bcf86cd799439012"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "Template name"
         },
         "bodyTemplate": {
          "type": "string",
          "description": "HTML email body with Twig variables"
         },
         "subjectTemplate": {
          "type": "string",
          "description": "Email subject with Twig variables"
         },
         "fromTemplate": {
          "type": "string",
          "description": "From field with Twig variables"
         },
         "sendingPeriod": {
          "type": "integer",
          "description": "Days to wait before sending",
          "minimum": 0
         },
         "type": {
          "type": "string",
          "enum": [
           "initial",
           "followup",
           "sequence"
          ]
         },
         "sequence": {
          "type": "integer",
          "description": "Template order in campaign"
         }
        }
       },
       "example": {
        "name": "Updated Welcome Email",
        "bodyTemplate": "<p>Hi {{contact.firstName}},</p><p>Thank you for joining {{company.name}}! We've updated our welcome message.</p>",
        "subjectTemplate": "Updated: Welcome to {{company.name}}!",
        "fromTemplate": "{{emailAccount.fullName}} <{{emailAccount.email}}>",
        "sendingPeriod": 0,
        "type": "initial",
        "sequence": 1
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Email template updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "bodyTemplate": {
           "type": "string"
          },
          "subjectTemplate": {
           "type": "string"
          },
          "fromTemplate": {
           "type": "string"
          },
          "sendingPeriod": {
           "type": "integer"
          },
          "type": {
           "type": "string"
          },
          "sequence": {
           "type": "integer"
          },
          "updatedAt": {
           "type": "string",
           "format": "date-time"
          }
         }
        },
        "example": {
         "_id": "507f1f77bcf86cd799439012",
         "name": "Updated Welcome Email",
         "bodyTemplate": "<p>Hi {{contact.firstName}},</p><p>Thank you for joining {{company.name}}!</p>",
         "subjectTemplate": "Updated: Welcome to {{company.name}}!",
         "fromTemplate": "{{emailAccount.fullName}} <{{emailAccount.email}}>",
         "sendingPeriod": 0,
         "type": "initial",
         "sequence": 1,
         "updatedAt": "2024-01-02T00:00:00.000Z"
        }
       }
      }
     },
     "400": {
      "description": "Template rendering error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Invalid template syntax in bodyTemplate"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Template validation failed",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "errors": {
           "type": "object"
          }
         }
        },
        "example": {
         "status": "Template validation failed",
         "errors": {
          "bodyTemplate": "Unexpected token 'contact'"
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "update_campaign_step"
   }
  },
  "/admin/email-templates": {
   "get": {
    "summary": "Get templates for email campaign",
    "description": "Retrieves all email templates associated with a specific email campaign",
    "tags": [
     "Email Templates"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "emailCampaignId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Email campaign ID to get templates for",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved email templates",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "_id": {
            "type": "string"
           },
           "name": {
            "type": "string"
           },
           "type": {
            "type": "string",
            "enum": [
             "sequence",
             "followup",
             "initial"
            ]
           },
           "subjectTemplate": {
            "type": "string"
           },
           "bodyTemplate": {
            "type": "string"
           },
           "fromTemplate": {
            "type": "string"
           },
           "sendingPeriod": {
            "type": "integer",
            "description": "Days to wait before sending this template"
           },
           "sequence": {
            "type": "integer",
            "description": "Order of template in campaign"
           },
           "emailCampaignId": {
            "type": "string"
           },
           "createdAt": {
            "type": "string",
            "format": "date-time"
           }
          }
         }
        },
        "example": [
         {
          "_id": "507f1f77bcf86cd799439012",
          "name": "Welcome Email",
          "type": "initial",
          "subjectTemplate": "Welcome to {{company.name}}, {{contact.firstName}}!",
          "bodyTemplate": "<p>Hi {{contact.firstName}},</p><p>Welcome to our platform!</p>",
          "fromTemplate": "{{emailAccount.fullName}} <{{emailAccount.email}}>",
          "sendingPeriod": 0,
          "sequence": 1,
          "emailCampaignId": "507f1f77bcf86cd799439011",
          "createdAt": "2024-01-01T00:00:00.000Z"
         },
         {
          "_id": "507f1f77bcf86cd799439013",
          "name": "Follow Up",
          "type": "followup",
          "subjectTemplate": "Following up on our previous conversation",
          "bodyTemplate": "<p>Hi {{contact.firstName}},</p><p>Just following up...</p>",
          "fromTemplate": "{{emailAccount.fullName}} <{{emailAccount.email}}>",
          "sendingPeriod": 3,
          "sequence": 2,
          "emailCampaignId": "507f1f77bcf86cd799439011",
          "createdAt": "2024-01-01T00:00:00.000Z"
         }
        ]
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_campaign"
   },
   "post": {
    "summary": "Create email template",
    "description": "Creates a new email template with body, subject, and sending period configuration. Templates support Twig templating variables.",
    "tags": [
     "Email Templates"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "bodyTemplate",
         "fromTemplate",
         "subjectTemplate",
         "type",
         "name",
         "websiteId",
         "emailCampaignId",
         "sendingPeriod"
        ],
        "properties": {
         "name": {
          "type": "string",
          "description": "Template name for identification",
          "minLength": 1,
          "maxLength": 100
         },
         "type": {
          "type": "string",
          "enum": [
           "initial",
           "followup",
           "sequence"
          ],
          "description": "Type of email template"
         },
         "bodyTemplate": {
          "type": "string",
          "description": "HTML email body with Twig variables (e.g., {{contact.firstName}}, {{company.name}})"
         },
         "subjectTemplate": {
          "type": "string",
          "description": "Email subject line with Twig variables",
          "maxLength": 200
         },
         "fromTemplate": {
          "type": "string",
          "description": "From field template with variables",
          "maxLength": 100
         },
         "sendingPeriod": {
          "type": "integer",
          "description": "Number of days to wait before sending this template",
          "minimum": 0,
          "maximum": 365
         },
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Website ID to associate template with"
         },
         "emailCampaignId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Email campaign ID to add template to"
         },
         "sequence": {
          "type": "integer",
          "description": "Order of template in campaign sequence",
          "minimum": 1
         }
        }
       },
       "example": {
        "name": "Welcome Email",
        "type": "initial",
        "bodyTemplate": "<p>Hi {{contact.firstName}},</p><p>Welcome to {{company.name}}! We're excited to help you grow your business.</p><p>Best regards,<br>{{emailAccount.fullName}}</p>",
        "subjectTemplate": "Welcome to {{company.name}}, {{contact.firstName}}!",
        "fromTemplate": "{{emailAccount.fullName}} <{{emailAccount.email}}>",
        "sendingPeriod": 0,
        "websiteId": "601733dbcedff50114a599f6",
        "emailCampaignId": "507f1f77bcf86cd799439011",
        "sequence": 1
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Email template created successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "emailTemplate": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "type": {
             "type": "string"
            },
            "bodyTemplate": {
             "type": "string"
            },
            "subjectTemplate": {
             "type": "string"
            },
            "fromTemplate": {
             "type": "string"
            },
            "sendingPeriod": {
             "type": "integer"
            },
            "sequence": {
             "type": "integer"
            },
            "emailCampaignId": {
             "type": "string"
            },
            "createdAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        },
        "example": {
         "emailTemplate": {
          "_id": "507f1f77bcf86cd799439012",
          "name": "Welcome Email",
          "type": "initial",
          "bodyTemplate": "<p>Hi {{contact.firstName}},</p><p>Welcome to {{company.name}}!</p>",
          "subjectTemplate": "Welcome to {{company.name}}, {{contact.firstName}}!",
          "fromTemplate": "{{emailAccount.fullName}} <{{emailAccount.email}}>",
          "sendingPeriod": 0,
          "sequence": 1,
          "emailCampaignId": "507f1f77bcf86cd799439011",
          "createdAt": "2024-01-01T00:00:00.000Z"
         }
        }
       }
      }
     },
     "400": {
      "description": "Template rendering error - invalid Twig syntax",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Template validation failed"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error or template validation failed",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          },
          "errors": {
           "type": "object",
           "description": "Template-specific validation errors"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "add_campaign_step"
   }
  },
  "/admin/email-templates-reorder": {
   "put": {
    "summary": "Reorder template sequence",
    "description": "Changes the order of email templates within a campaign to control sending sequence",
    "tags": [
     "Email Templates"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "campaignId",
         "emailTemplates"
        ],
        "properties": {
         "campaignId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Email campaign ID containing the templates"
         },
         "emailTemplates": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string",
             "description": "Template ID"
            },
            "sequence": {
             "type": "integer",
             "description": "New sequence number"
            }
           }
          },
          "description": "Array of templates with new sequence order",
          "minItems": 1
         }
        }
       },
       "example": {
        "campaignId": "507f1f77bcf86cd799439011",
        "emailTemplates": [
         {
          "_id": "507f1f77bcf86cd799439012",
          "sequence": 2
         },
         {
          "_id": "507f1f77bcf86cd799439013",
          "sequence": 1
         },
         {
          "_id": "507f1f77bcf86cd799439014",
          "sequence": 3
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Template sequence reordered successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Templates sequence reoredered successfully"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing campaignId or emailTemplates array",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "reorder_campaign_steps"
   }
  },
  "/admin/filters/{id}": {
   "delete": {
    "summary": "Delete filter",
    "description": "Permanently deletes a saved filter",
    "tags": [
     "Filters"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Filter ID to delete",
      "example": "507f1f77bcf86cd799439030"
     }
    ],
    "responses": {
     "200": {
      "description": "Filter deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "404": {
      "description": "Filter not found or couldn't be deleted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "We couldn't delete the filter"
        }
       }
      }
     },
     "405": {
      "description": "Validation error - missing filter ID",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "delete_filter"
   },
   "patch": {
    "summary": "Update a saved filter (e.g. toggle favorite)",
    "description": "Updates an existing saved filter. Currently supports toggling the\n`isFavorite` flag. When `isFavorite` is set to true, all other filters\nbelonging to the same website are atomically cleared so only one\nfavorite segment exists per website.\n",
    "tags": [
     "Filters"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "isFavorite": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Updated filter"
     }
    },
    "x-mcp-tool": "update_filter"
   }
  },
  "/admin/filters": {
   "get": {
    "summary": "Get saved filters for website",
    "description": "Retrieves all saved filters for a specific website to quickly access common lead queries",
    "tags": [
     "Filters"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Website ID to get filters for",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved filters",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "_id": {
            "type": "string"
           },
           "name": {
            "type": "string",
            "description": "Display name for the filter"
           },
           "url": {
            "type": "string",
            "description": "URL with query parameters for the filter"
           },
           "website": {
            "type": "string",
            "description": "Associated website ID"
           },
           "createdAt": {
            "type": "string",
            "format": "date-time"
           },
           "updatedAt": {
            "type": "string",
            "format": "date-time"
           }
          }
         }
        },
        "example": [
         {
          "_id": "507f1f77bcf86cd799439030",
          "name": "High-Value Prospects",
          "url": "/admin/leads?score=high&industry=technology",
          "website": "601733dbcedff50114a599f6",
          "createdAt": "2024-01-01T00:00:00.000Z",
          "updatedAt": "2024-01-01T00:00:00.000Z"
         },
         {
          "_id": "507f1f77bcf86cd799439031",
          "name": "Recent Visitors",
          "url": "/admin/leads?days=7&status=new",
          "website": "601733dbcedff50114a599f6",
          "createdAt": "2024-01-01T00:00:00.000Z",
          "updatedAt": "2024-01-01T00:00:00.000Z"
         }
        ]
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - invalid or missing websiteId",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "list_filters"
   },
   "post": {
    "summary": "Create new filter with name and URL",
    "description": "Creates a saved filter to quickly access specific lead queries and views",
    "tags": [
     "Filters"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "name",
         "url"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Website ID to associate the filter with"
         },
         "name": {
          "type": "string",
          "description": "Display name for the filter",
          "minLength": 1,
          "maxLength": 100,
          "example": "High-Value Prospects"
         },
         "url": {
          "type": "string",
          "description": "URL with query parameters defining the filter criteria",
          "example": "/admin/leads?score=high&industry=technology&dateFrom=2024-01-01"
         }
        }
       },
       "example": {
        "websiteId": "601733dbcedff50114a599f6",
        "name": "Enterprise Technology Leads",
        "url": "/admin/leads?industry=technology&company_size=large&score=high"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Filter created successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "url": {
           "type": "string",
           "description": "URL with dateFrom and dateTo parameters removed for reusability"
          },
          "website": {
           "type": "string"
          },
          "createdAt": {
           "type": "string",
           "format": "date-time"
          },
          "updatedAt": {
           "type": "string",
           "format": "date-time"
          }
         }
        },
        "example": {
         "_id": "507f1f77bcf86cd799439032",
         "name": "Enterprise Technology Leads",
         "url": "/admin/leads?industry=technology&company_size=large&score=high",
         "website": "601733dbcedff50114a599f6",
         "createdAt": "2024-01-02T00:00:00.000Z",
         "updatedAt": "2024-01-02T00:00:00.000Z"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required fields",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error during filter creation"
     }
    },
    "x-mcp-tool": "create_filter"
   }
  },
  "/admin/intent-topics": {
   "delete": {
    "summary": "Unsubscribe from an intent topic",
    "description": "Permanently removes a website's subscription to an intent topic. No further leads will be\ndelivered for this topic after deletion.\n\n**Important:** existing leads that already carry this topic in their `intentTopics` array\nare **not** deleted — they remain in your dashboard for historical reference.\n\nIf you only want to temporarily stop delivery, use `PATCH /admin/intent-topics` with\n`paused: true` instead — this preserves counters and can be reversed.\n\nParameters may be passed as query params or in the request body.\n",
    "tags": [
     "Intent Topics"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "websiteId",
      "schema": {
       "type": "string"
      },
      "description": "ID of the website (can also be sent in the request body)"
     },
     {
      "in": "query",
      "name": "topicSlug",
      "schema": {
       "type": "string"
      },
      "description": "Slug of the topic to unsubscribe from (can also be sent in the request body)"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "websiteId": {
          "type": "string",
          "example": "507f1f77bcf86cd799439011"
         },
         "topicSlug": {
          "type": "string",
          "example": "crm-software-buyers"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Subscription deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "result": {
           "type": "object",
           "properties": {
            "deleted": {
             "type": "boolean",
             "example": true
            },
            "topicSlug": {
             "type": "string",
             "example": "crm-software-buyers"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid websiteId"
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "403": {
      "description": "Intent Signals feature not enabled for this website"
     },
     "404": {
      "description": "Subscription not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "delete_intent_topic"
   },
   "get": {
    "summary": "List intent topic subscriptions",
    "description": "Returns all 3rd-party intent topic subscriptions for the given website, each enriched with\na 7-day surge count so the UI can display \"↑↑ N\" activity badges.\n\n**What are intent topics?**\nIntent topics deliver leads that are actively researching a subject (e.g. \"CRM Software Buyers\")\nbased on 3rd-party data — even if those companies have never visited your website.\nEach subscription has a daily limit that controls how many matching leads are delivered per day.\n\nThis endpoint returns a 200 with `featureEnabled: false` (and an empty result array) if\nthe feature has not been enabled for the website — no error is surfaced to the UI.\n",
    "tags": [
     "Intent Topics"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website"
     }
    ],
    "responses": {
     "200": {
      "description": "Subscriptions retrieved successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "result": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/IntentTopicSubscription"
           }
          },
          "totalActive": {
           "type": "integer",
           "description": "Count of subscriptions that are not paused"
          },
          "featureEnabled": {
           "type": "boolean",
           "description": "Present and `false` when the feature is not enabled for this website"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid websiteId"
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "list_intent_topics"
   },
   "patch": {
    "summary": "Update an intent topic subscription",
    "description": "Mutates an existing subscription. Supports pausing/resuming delivery and changing the daily limit\n— both can be sent in the same request.\n\n- **Pause** (`paused: true`) — stops new leads being delivered for this topic. Existing leads\n  and counters are preserved. Use this instead of DELETE when you want to temporarily disable.\n- **Resume** (`paused: false`) — resumes delivery from the next daily delivery.\n- **Change limit** (`userDailyLimit: N`) — updates the cap on leads delivered per day (1–5000).\n\nAt least one of `paused` or `userDailyLimit` must be provided.\n",
    "tags": [
     "Intent Topics"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "topicSlug"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "ID of the website",
          "example": "507f1f77bcf86cd799439011"
         },
         "topicSlug": {
          "type": "string",
          "description": "Slug of the topic subscription to update",
          "example": "crm-software-buyers"
         },
         "paused": {
          "type": "boolean",
          "description": "`true` to pause delivery, `false` to resume"
         },
         "userDailyLimit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5000,
          "description": "New daily delivery cap for this topic"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Subscription updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "result": {
           "$ref": "#/components/schemas/IntentTopicSubscription"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid websiteId or no updatable fields provided"
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "403": {
      "description": "Intent Signals feature not enabled for this website"
     },
     "404": {
      "description": "Subscription not found (topic not subscribed)"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "update_intent_topic"
   },
   "post": {
    "summary": "Subscribe to an intent topic",
    "description": "Subscribes a website to a 3rd-party intent topic so that matching leads are delivered daily.\n\n**Idempotent** — calling this again for an already-subscribed topic will unpause it and\nupdate the daily limit if provided, rather than creating a duplicate.\n\nThe `topicSlug` must exist in the global catalog (`GET /admin/intent-topics/catalog`).\nOn subscribe, the system snapshots the topic's audience profile (role keywords, industry\nconstraints) and `availabilityPerDay` so your subscription is not affected by future\ncatalog changes.\n\n`userDailyLimit` controls the maximum leads delivered per day. It defaults to 20 and is\ncapped at 5000. Set it lower if you want to control credit consumption.\n",
    "tags": [
     "Intent Topics"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "topicSlug"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "ID of the website",
          "example": "507f1f77bcf86cd799439011"
         },
         "topicSlug": {
          "type": "string",
          "description": "Slug of the topic to subscribe to (from the catalog)",
          "example": "crm-software-buyers"
         },
         "userDailyLimit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5000,
          "default": 20,
          "description": "Maximum leads to deliver per day for this topic. Exceeding availability is allowed — actual delivery is bounded by what's available."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Subscription created or unpaused successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "result": {
           "$ref": "#/components/schemas/IntentTopicSubscription"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid websiteId"
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "403": {
      "description": "Intent Signals feature not enabled for this website"
     },
     "404": {
      "description": "Topic slug not found in the catalog"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "subscribe_to_intent_topic"
   }
  },
  "/admin/intent-topics/catalog": {
   "get": {
    "summary": "Get available intent topics catalog",
    "description": "Returns the full list of 3rd-party intent topics available for subscription.\nEach entry describes the topic's audience profile (target role keywords and optional\nindustry constraints) and the estimated number of matching leads per day.\n\n**How to use:**\n1. Call this endpoint to browse available topics.\n2. Pick the `topicSlug` values you want and subscribe via `POST /admin/intent-topics`.\n3. The subscribed topics will begin delivering matching leads daily.\n",
    "tags": [
     "Intent Topics"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "Catalog retrieved successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "result": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/IntentTopicCatalogEntry"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_intent_topics_catalog"
   }
  },
  "/admin/lead-scoring/{id}": {
   "delete": {
    "summary": "Delete scoring model",
    "description": "Deletes a lead scoring model if it's not the last one for the website (at least one model must remain)",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Lead scoring model ID to delete",
      "example": "507f1f77bcf86cd799439040"
     }
    ],
    "responses": {
     "200": {
      "description": "Lead scoring model deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Model not found, invalid ID, or cannot delete last model",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "modelNotFound": {
          "value": {
           "status": "Lead scoring model was not found"
          }
         },
         "invalidId": {
          "value": {
           "status": "Invalid Id"
          }
         },
         "validation": {
          "value": {
           "status": [
            {
             "msg": "id Is Required"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "delete_lead_scoring_model"
   },
   "get": {
    "summary": "Get single model with scoring criteria",
    "description": "Retrieves a specific lead scoring model with all its configuration and criteria",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Lead scoring model ID",
      "example": "507f1f77bcf86cd799439040"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved lead scoring model",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "response": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "active": {
             "type": "boolean"
            },
            "website": {
             "type": "object",
             "properties": {
              "_id": {
               "type": "string"
              },
              "domain": {
               "type": "string"
              },
              "name": {
               "type": "string"
              }
             }
            },
            "user": {
             "type": "string"
            },
            "criteria": {
             "type": "object",
             "properties": {
              "revenue": {
               "type": "object",
               "properties": {
                "enabled": {
                 "type": "boolean"
                },
                "min": {
                 "type": "number"
                },
                "max": {
                 "type": "number"
                },
                "score": {
                 "type": "number"
                }
               }
              },
              "employees": {
               "type": "object",
               "properties": {
                "enabled": {
                 "type": "boolean"
                },
                "min": {
                 "type": "number"
                },
                "max": {
                 "type": "number"
                },
                "score": {
                 "type": "number"
                }
               }
              },
              "industry": {
               "type": "object",
               "properties": {
                "enabled": {
                 "type": "boolean"
                },
                "values": {
                 "type": "array",
                 "items": {
                  "type": "string"
                 }
                },
                "score": {
                 "type": "number"
                }
               }
              },
              "jobTitle": {
               "type": "object",
               "properties": {
                "enabled": {
                 "type": "boolean"
                },
                "values": {
                 "type": "array",
                 "items": {
                  "type": "string"
                 }
                },
                "score": {
                 "type": "number"
                }
               }
              },
              "location": {
               "type": "object",
               "description": "Geographic location criteria"
              },
              "visitBehavior": {
               "type": "object",
               "description": "Website visit behavior criteria"
              }
             }
            },
            "aiMatching": {
             "type": "object",
             "properties": {
              "enabled": {
               "type": "boolean"
              },
              "values": {
               "type": "string",
               "description": "AI matching criteria with domain replacement"
              }
             }
            },
            "createdAt": {
             "type": "string",
             "format": "date-time"
            },
            "updatedAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        },
        "example": {
         "response": {
          "_id": "507f1f77bcf86cd799439040",
          "name": "Enterprise Prospects",
          "active": true,
          "website": {
           "_id": "601733dbcedff50114a599f6",
           "domain": "example.com",
           "name": "Example Corp"
          },
          "criteria": {
           "revenue": {
            "enabled": true,
            "min": 1000000,
            "max": null,
            "score": 25
           },
           "employees": {
            "enabled": true,
            "min": 100,
            "max": null,
            "score": 20
           },
           "industry": {
            "enabled": true,
            "values": [
             "Technology",
             "Software"
            ],
            "score": 30
           }
          },
          "aiMatching": {
           "enabled": true,
           "values": "Companies interested in example.com's technology solutions"
          },
          "createdAt": "2024-01-01T00:00:00.000Z",
          "updatedAt": "2024-01-01T00:00:00.000Z"
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Invalid model ID or model not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_lead_scoring_model"
   }
  },
  "/admin/lead-scoring": {
   "get": {
    "summary": "Get all scoring models for website",
    "description": "Retrieves all lead scoring models configured for a specific website with pagination",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Website ID to get scoring models for",
      "example": "601733dbcedff50114a599f6"
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 1
      },
      "description": "Page number for pagination"
     },
     {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 50,
       "maximum": 100
      },
      "description": "Number of models per page"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved lead scoring models",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "results": {
           "type": "object",
           "properties": {
            "scores": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "_id": {
                "type": "string"
               },
               "name": {
                "type": "string",
                "description": "Name of the scoring model"
               },
               "active": {
                "type": "boolean",
                "description": "Whether the model is active"
               },
               "website": {
                "type": "string",
                "description": "Associated website ID"
               },
               "user": {
                "type": "string",
                "description": "User who created the model"
               },
               "criteria": {
                "type": "object",
                "description": "Scoring criteria configuration"
               },
               "aiMatching": {
                "type": "object",
                "properties": {
                 "enabled": {
                  "type": "boolean"
                 },
                 "values": {
                  "type": "string",
                  "description": "AI matching criteria"
                 }
                }
               },
               "createdAt": {
                "type": "string",
                "format": "date-time"
               },
               "updatedAt": {
                "type": "string",
                "format": "date-time"
               }
              }
             }
            },
            "totalPages": {
             "type": "integer"
            },
            "currentPage": {
             "type": "integer"
            },
            "totalScores": {
             "type": "integer"
            }
           }
          }
         }
        },
        "example": {
         "results": {
          "scores": [
           {
            "_id": "507f1f77bcf86cd799439040",
            "name": "Enterprise Prospects",
            "active": true,
            "website": "601733dbcedff50114a599f6",
            "user": "507f1f77bcf86cd799439011",
            "aiMatching": {
             "enabled": true,
             "values": "Technology companies with 100+ employees"
            },
            "createdAt": "2024-01-01T00:00:00.000Z",
            "updatedAt": "2024-01-01T00:00:00.000Z"
           }
          ],
          "totalPages": 1,
          "currentPage": 1,
          "totalScores": 1
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - invalid websiteId format"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "list_lead_scoring_models"
   },
   "post": {
    "summary": "Create scoring model",
    "description": "Creates a new lead scoring model with default criteria and initializes scoring for existing leads",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "websiteId"
        ],
        "properties": {
         "name": {
          "type": "string",
          "description": "Name of the scoring model (must be unique per website)",
          "minLength": 1,
          "maxLength": 100,
          "example": "Enterprise Technology Prospects"
         },
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Website ID to associate the model with",
          "example": "601733dbcedff50114a599f6"
         }
        }
       },
       "example": {
        "name": "High-Value SaaS Prospects",
        "websiteId": "601733dbcedff50114a599f6"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Lead scoring model created successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "result": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "active": {
             "type": "boolean",
             "default": true
            },
            "website": {
             "type": "string"
            },
            "user": {
             "type": "string"
            },
            "criteria": {
             "type": "object",
             "description": "Default empty criteria object"
            },
            "aiMatching": {
             "type": "object",
             "properties": {
              "enabled": {
               "type": "boolean",
               "default": false
              },
              "values": {
               "type": "string",
               "default": ""
              }
             }
            },
            "createdAt": {
             "type": "string",
             "format": "date-time"
            },
            "updatedAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        },
        "example": {
         "result": {
          "_id": "507f1f77bcf86cd799439041",
          "name": "High-Value SaaS Prospects",
          "active": true,
          "website": "601733dbcedff50114a599f6",
          "user": "507f1f77bcf86cd799439011",
          "criteria": {},
          "aiMatching": {
           "enabled": false,
           "values": ""
          },
          "createdAt": "2024-01-02T00:00:00.000Z",
          "updatedAt": "2024-01-02T00:00:00.000Z"
         }
        }
       }
      }
     },
     "400": {
      "description": "Duplicate model name for website",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "You cannot have two score models with the same name!"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required fields",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "create_lead_scoring_model"
   }
  },
  "/admin/leads-table": {
   "get": {
    "summary": "Get paginated leads table with advanced filtering",
    "description": "Retrieves a paginated list of leads with comprehensive filtering options including location, industry, company size, and engagement metrics",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website"
     },
     {
      "in": "query",
      "name": "dateFrom",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Start date for filtering leads (MM/DD/YYYY)",
      "example": "11/08/2025"
     },
     {
      "in": "query",
      "name": "dateTo",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "End date for filtering leads (MM/DD/YYYY)",
      "example": "12/08/2025"
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "integer",
       "minimum": 1,
       "default": 1
      },
      "description": "Page number for pagination (defaults to 1)"
     },
     {
      "in": "query",
      "name": "visitorLocation",
      "schema": {
       "type": "string"
      },
      "description": "Filter by visitor country location"
     },
     {
      "in": "query",
      "name": "visitorLocationState",
      "schema": {
       "type": "string"
      },
      "description": "Filter by visitor state/region"
     },
     {
      "in": "query",
      "name": "visitorCity",
      "schema": {
       "type": "string"
      },
      "description": "Filter by visitor city"
     },
     {
      "in": "query",
      "name": "industries",
      "schema": {
       "type": "string"
      },
      "description": "Filter by industries (comma-separated)"
     },
     {
      "in": "query",
      "name": "sectors",
      "schema": {
       "type": "string"
      },
      "description": "Filter by sectors"
     },
     {
      "in": "query",
      "name": "tag",
      "schema": {
       "type": "string"
      },
      "description": "Filter by tag"
     },
     {
      "in": "query",
      "name": "visits_lower_bound",
      "schema": {
       "type": "integer"
      },
      "description": "Minimum number of visits"
     },
     {
      "in": "query",
      "name": "visits_upper_bound",
      "schema": {
       "type": "integer"
      },
      "description": "Maximum number of visits"
     },
     {
      "in": "query",
      "name": "domain",
      "schema": {
       "type": "string"
      },
      "description": "Filter by company domain"
     },
     {
      "in": "query",
      "name": "sort",
      "schema": {
       "type": "string",
       "enum": [
        "lastVisit",
        "visits",
        "employees",
        "revenue",
        "leadScore"
       ]
      },
      "description": "Field to sort by"
     },
     {
      "in": "query",
      "name": "order",
      "schema": {
       "type": "string",
       "enum": [
        "asc",
        "desc"
       ]
      },
      "description": "Sort order"
     },
     {
      "in": "query",
      "name": "employees_lower_bound",
      "schema": {
       "type": "integer"
      },
      "description": "Minimum number of employees"
     },
     {
      "in": "query",
      "name": "employees_upper_bound",
      "schema": {
       "type": "integer"
      },
      "description": "Maximum number of employees"
     },
     {
      "in": "query",
      "name": "revenue_lower_bound",
      "schema": {
       "type": "number"
      },
      "description": "Minimum annual revenue"
     },
     {
      "in": "query",
      "name": "revenue_upper_bound",
      "schema": {
       "type": "number"
      },
      "description": "Maximum annual revenue"
     },
     {
      "in": "query",
      "name": "pageVisited",
      "schema": {
       "type": "string"
      },
      "description": "Filter by specific page visited"
     },
     {
      "in": "query",
      "name": "utmMedium",
      "schema": {
       "type": "string"
      },
      "description": "UTM medium parameter"
     },
     {
      "in": "query",
      "name": "utmTerm",
      "schema": {
       "type": "string"
      },
      "description": "UTM term parameter"
     },
     {
      "in": "query",
      "name": "utmName",
      "schema": {
       "type": "string"
      },
      "description": "UTM campaign name"
     },
     {
      "in": "query",
      "name": "utmSource",
      "schema": {
       "type": "string"
      },
      "description": "UTM source parameter"
     },
     {
      "in": "query",
      "name": "exactVisitor",
      "schema": {
       "type": "boolean"
      },
      "description": "Filter for exact/identified visitors only"
     },
     {
      "in": "query",
      "name": "tech",
      "schema": {
       "type": "string"
      },
      "description": "Filter by technology stack"
     },
     {
      "in": "query",
      "name": "leadscore_lower",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 100
      },
      "description": "Minimum lead score"
     },
     {
      "in": "query",
      "name": "leadscore_upper",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "maximum": 100
      },
      "description": "Maximum lead score"
     },
     {
      "in": "query",
      "name": "hasPhoneNumber",
      "schema": {
       "type": "boolean"
      },
      "description": "Filter for leads with phone numbers"
     },
     {
      "in": "query",
      "name": "type",
      "schema": {
       "type": "string",
       "enum": [
        "public",
        "private",
        "education",
        "government",
        "nonprofit",
        "personal"
       ]
      },
      "description": "Filter by company type"
     },
     {
      "in": "query",
      "name": "visitorType",
      "schema": {
       "type": "string",
       "enum": [
        "suggested-contact",
        "exact-visitor",
        "not-found"
       ]
      },
      "description": "Filter by how the visitor was identified: `suggested-contact` (company matched, contacts suggested), `exact-visitor` (individual identified), `not-found` (no contact data)"
     },
     {
      "in": "query",
      "name": "hqLocation",
      "schema": {
       "type": "string"
      },
      "description": "Filter by company HQ country (distinct from the visitor's IP-based location)"
     },
     {
      "in": "query",
      "name": "hqLocationState",
      "schema": {
       "type": "string"
      },
      "description": "Filter by company HQ state/region"
     },
     {
      "in": "query",
      "name": "hqCity",
      "schema": {
       "type": "string"
      },
      "description": "Filter by company HQ city"
     },
     {
      "in": "query",
      "name": "alexa_lower_bound",
      "schema": {
       "type": "integer"
      },
      "description": "Minimum Alexa rank (lower = more popular)"
     },
     {
      "in": "query",
      "name": "alexa_upper_bound",
      "schema": {
       "type": "integer"
      },
      "description": "Maximum Alexa rank"
     },
     {
      "in": "query",
      "name": "listId",
      "schema": {
       "type": "string"
      },
      "description": "Filter leads to companies in a specific saved list (pass the list ID)"
     },
     {
      "in": "query",
      "name": "hubspotStatus",
      "schema": {
       "type": "string"
      },
      "description": "Filter by HubSpot CRM sync status (e.g. `synced`, `pending`, `error`)"
     },
     {
      "in": "query",
      "name": "pipedriveStatus",
      "schema": {
       "type": "string"
      },
      "description": "Filter by Pipedrive CRM sync status"
     },
     {
      "in": "query",
      "name": "zohoStatus",
      "schema": {
       "type": "string"
      },
      "description": "Filter by Zoho CRM sync status"
     },
     {
      "in": "query",
      "name": "signalSource",
      "schema": {
       "type": "string",
       "enum": [
        "visit",
        "topic",
        "both",
        "all"
       ]
      },
      "description": "Filter leads by how they were sourced. **3rd-party intent data context:**\n- `visit` – only leads that arrived through your tracking pixel (website visitors)\n- `topic` – only leads delivered via a subscribed 3rd-party intent topic (companies researching a topic, even if they never visited your site)\n- `both` – leads that have both a website visit AND an intent topic signal\n- `all` (default) – all leads regardless of source\n"
     },
     {
      "in": "query",
      "name": "topicSlug",
      "schema": {
       "type": "string"
      },
      "description": "Filter leads to those matching a specific intent topic subscription (e.g. `crm-software-buyers`). Use `GET /admin/intent-topics` to list your active subscriptions and their slugs."
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved leads",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "leads": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Lead"
           }
          },
          "totalLeads": {
           "type": "integer",
           "description": "Total number of leads matching filters"
          },
          "totalPages": {
           "type": "integer",
           "description": "Total number of pages"
          },
          "currentPage": {
           "type": "integer",
           "description": "Current page number"
          },
          "activeAutomations": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Automation"
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid request parameters"
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "403": {
      "$ref": "#/components/responses/ForbiddenError"
     },
     "500": {
      "description": "Query too large or server error"
     }
    },
    "x-mcp-tool": "get_leads"
   }
  },
  "/admin/lists/{id}/items": {
   "delete": {
    "summary": "Remove items from list",
    "description": "Removes specific contacts or companies from a list by their IDs",
    "tags": [
     "Lists"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "List ID to remove items from",
      "example": "507f1f77bcf86cd799439020"
     },
     {
      "in": "query",
      "name": "listType",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "contact",
        "company"
       ]
      },
      "description": "Type of list"
     },
     {
      "in": "query",
      "name": "contacts",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Comma-separated string of contact IDs to remove (for contact lists)",
      "example": "63dac298c028100013252e8b,63dac29cc028100013252f1c"
     },
     {
      "in": "query",
      "name": "companies",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Comma-separated string of company IDs to remove (for company lists)",
      "example": "63dac298c028100013252e8b,63dac29cc028100013252f1c"
     }
    ],
    "responses": {
     "200": {
      "description": "Items removed from list successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful deleted"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "List not found, invalid ID, or validation error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "listNotFound": {
          "value": {
           "status": "List was not found"
          }
         },
         "invalidId": {
          "value": {
           "status": "Invalid Id"
          }
         },
         "validation": {
          "value": {
           "status": [
            {
             "msg": "id Is Required"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "remove_list_items"
   }
  },
  "/admin/lists/{id}": {
   "delete": {
    "summary": "Delete list",
    "description": "Permanently deletes a contact or company list and all its associated data",
    "tags": [
     "Lists"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "List ID to delete",
      "example": "507f1f77bcf86cd799439020"
     },
     {
      "in": "query",
      "name": "listType",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "contact",
        "company"
       ]
      },
      "description": "Type of list to delete"
     }
    ],
    "responses": {
     "200": {
      "description": "List deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Invalid list ID or validation error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "invalidId": {
          "value": {
           "status": "Invalid Id"
          }
         },
         "validation": {
          "value": {
           "status": [
            {
             "msg": "id Is Required"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "delete_list"
   },
   "get": {
    "summary": "Get list with paginated items",
    "description": "Retrieves a specific list with its contacts or companies using pagination",
    "tags": [
     "Lists"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "List ID to retrieve",
      "example": "507f1f77bcf86cd799439020"
     },
     {
      "in": "query",
      "name": "listType",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "contact",
        "company"
       ]
      },
      "description": "Type of list"
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 1
      },
      "description": "Page number for pagination"
     },
     {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 50,
       "maximum": 100
      },
      "description": "Number of items per page"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved list with items",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "response": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "website": {
             "type": "string"
            },
            "user": {
             "type": "string"
            },
            "contacts": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "_id": {
                "type": "string"
               },
               "firstName": {
                "type": "string"
               },
               "lastName": {
                "type": "string"
               },
               "businessEmail": {
                "type": "string",
                "format": "email"
               },
               "position": {
                "type": "string"
               },
               "company": {
                "type": "string"
               },
               "phone": {
                "type": "string"
               },
               "verifiedStatus": {
                "type": "string",
                "enum": [
                 "valid",
                 "invalid",
                 "risky",
                 "catch-all",
                 "unknown"
                ]
               }
              }
             },
             "description": "Array of contacts (for contact lists)"
            },
            "companies": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "_id": {
                "type": "string"
               },
               "name": {
                "type": "string"
               },
               "domain": {
                "type": "string"
               },
               "industry": {
                "type": "string"
               },
               "employeeCount": {
                "type": "integer"
               }
              }
             },
             "description": "Array of companies (for company lists)"
            },
            "totalItems": {
             "type": "integer"
            },
            "currentPage": {
             "type": "integer"
            },
            "totalPages": {
             "type": "integer"
            },
            "createdAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        },
        "example": {
         "response": {
          "_id": "507f1f77bcf86cd799439020",
          "name": "Sales Prospects",
          "website": "601733dbcedff50114a599f6",
          "user": "507f1f77bcf86cd799439011",
          "contacts": [
           {
            "_id": "507f1f77bcf86cd799439022",
            "firstName": "John",
            "lastName": "Doe",
            "businessEmail": "john@example.com",
            "position": "Sales Manager",
            "company": "Example Corp",
            "phone": "+1-555-0123",
            "verifiedStatus": "valid"
           }
          ],
          "totalItems": 125,
          "currentPage": 1,
          "totalPages": 3,
          "createdAt": "2024-01-01T00:00:00.000Z"
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error or list not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_list"
   }
  },
  "/admin/lists": {
   "get": {
    "summary": "Get contact/company lists",
    "description": "Retrieves paginated lists of contacts or companies for a specific website",
    "tags": [
     "Lists"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Website ID to get lists for",
      "example": "601733dbcedff50114a599f6"
     },
     {
      "in": "query",
      "name": "listType",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "contact",
        "company"
       ]
      },
      "description": "Type of list to retrieve"
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 1
      },
      "description": "Page number for pagination"
     },
     {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 50,
       "maximum": 100
      },
      "description": "Number of lists per page"
     },
     {
      "in": "query",
      "name": "excludeListItems",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "true",
        "false"
       ],
       "default": "false"
      },
      "description": "Whether to exclude list items from response"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved lists",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "lists": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "_id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "website": {
              "type": "string"
             },
             "user": {
              "type": "string"
             },
             "contacts": {
              "type": "array",
              "items": {
               "type": "object"
              },
              "description": "Array of contacts (for contact lists)"
             },
             "companies": {
              "type": "array",
              "items": {
               "type": "object"
              },
              "description": "Array of companies (for company lists)"
             },
             "totalContacts": {
              "type": "integer",
              "description": "Total number of contacts in list"
             },
             "createdAt": {
              "type": "string",
              "format": "date-time"
             },
             "updatedAt": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        },
        "example": {
         "lists": [
          {
           "_id": "507f1f77bcf86cd799439020",
           "name": "Sales Prospects",
           "website": "601733dbcedff50114a599f6",
           "user": "507f1f77bcf86cd799439011",
           "totalContacts": 125,
           "createdAt": "2024-01-01T00:00:00.000Z",
           "updatedAt": "2024-01-01T00:00:00.000Z"
          },
          {
           "_id": "507f1f77bcf86cd799439021",
           "name": "Marketing Leads",
           "website": "601733dbcedff50114a599f6",
           "user": "507f1f77bcf86cd799439011",
           "totalContacts": 89,
           "createdAt": "2024-01-01T00:00:00.000Z",
           "updatedAt": "2024-01-01T00:00:00.000Z"
          }
         ]
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required parameters"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "list_lists"
   },
   "post": {
    "summary": "Create new list",
    "description": "Creates a new contact or company list for organizing leads and prospects",
    "tags": [
     "Lists"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "listType",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "contact",
        "company"
       ]
      },
      "description": "Type of list to create"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "websiteId"
        ],
        "properties": {
         "name": {
          "type": "string",
          "description": "Name of the list",
          "minLength": 1,
          "maxLength": 100,
          "example": "Q1 Sales Prospects"
         },
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Website ID to associate the list with",
          "example": "601733dbcedff50114a599f6"
         }
        }
       },
       "example": {
        "name": "Enterprise Prospects",
        "websiteId": "601733dbcedff50114a599f6"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "List created successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "list": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "website": {
             "type": "string"
            },
            "user": {
             "type": "string"
            },
            "contacts": {
             "type": "array",
             "items": {
              "type": "object"
             },
             "description": "Empty array for new contact lists"
            },
            "companies": {
             "type": "array",
             "items": {
              "type": "object"
             },
             "description": "Empty array for new company lists"
            },
            "createdAt": {
             "type": "string",
             "format": "date-time"
            },
            "updatedAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        },
        "example": {
         "list": {
          "_id": "507f1f77bcf86cd799439023",
          "name": "Enterprise Prospects",
          "website": "601733dbcedff50114a599f6",
          "user": "507f1f77bcf86cd799439011",
          "contacts": [],
          "createdAt": "2024-01-02T00:00:00.000Z",
          "updatedAt": "2024-01-02T00:00:00.000Z"
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error - missing required fields",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "create_list"
   }
  },
  "/admin/lists/export-csv/{listId}": {
   "post": {
    "summary": "Export list to CSV",
    "description": "Exports a contact or company list to CSV format and emails it to the user",
    "tags": [
     "Lists"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "listId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "List ID to export",
      "example": "507f1f77bcf86cd799439020"
     },
     {
      "in": "query",
      "name": "listType",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "contact",
        "company"
       ]
      },
      "description": "Type of list to export"
     }
    ],
    "responses": {
     "200": {
      "description": "Export initiated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "You will receive the CSV file shortly"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "List not found or validation error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "listNotFound": {
          "value": {
           "status": "List was not found"
          }
         },
         "validation": {
          "value": {
           "status": [
            {
             "msg": "listId Is Required"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error during export"
     }
    },
    "x-mcp-tool": "export_list_csv"
   }
  },
  "/admin/location/cities": {
   "get": {
    "summary": "Search cities for lead filtering and targeting",
    "description": "## Overview\nSearch for cities across all countries or within a specific country. This endpoint is primarily used for:\n- Filtering leads by visitor city location\n- Setting up location-based targeting criteria\n- Building location filters in the leads table\n\n## How City Search Works\n\n### Global Search (No Country Filter)\nWhen searching without a country parameter:\n- Searches across all countries in the database\n- Returns up to `limit` results (default: 50, max: 200)\n- Results include both city name and country\n- Useful for autocomplete when country is unknown\n\n### Country-Specific Search\nWhen `country` parameter is provided:\n- Searches only within that specific country\n- Faster response time (smaller dataset)\n- No limit applied (returns all matching cities)\n- Recommended when country is already known\n\n## Search Behavior\n\n- **Case-insensitive**: Searches work regardless of capitalization\n- **Prefix matching**: Searches match cities starting with the query\n- **Minimum length**: Query must be at least 2 characters\n- **Example**: \"san\" matches \"San Francisco\", \"San Diego\", \"Santiago\"\n\n## Common Use Cases\n\n**Use Case 1: Lead Filtering UI**\n```javascript\n// User types \"New Y\" in city filter\nGET /admin/location/cities?q=New+Y&limit=10\n// Returns: New York (USA), New York Mills (USA), etc.\n```\n\n**Use Case 2: Country-Specific Targeting**\n```javascript\n// User wants to find cities in United Kingdom starting with \"Man\"\nGET /admin/location/cities?q=Man&country=United+Kingdom\n// Returns: Manchester, Mansfield, etc.\n```\n\n**Use Case 3: Location-Based Lead Segmentation**\n```javascript\n// Find all cities matching \"Los\" to build a segment\nGET /admin/location/cities?q=Los&limit=20\n// Returns: Los Angeles, Los Cabos, Los Santos, etc.\n```\n\n## Performance Tips\n\n- **Use country filter**: When country is known, always include it for faster searches\n- **Limit results**: Use lower limit values (10-20) for autocomplete UI\n- **Debounce**: Debounce user input to avoid excessive API calls\n- **Cache results**: Client-side caching of common searches improves UX\n",
    "tags": [
     "Location"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "q",
      "required": true,
      "schema": {
       "type": "string",
       "minLength": 2
      },
      "description": "Search query for city name (minimum 2 characters).\n- Case-insensitive prefix matching\n- Examples: \"san\", \"New Y\", \"lon\"\n",
      "example": "San"
     },
     {
      "in": "query",
      "name": "country",
      "schema": {
       "type": "string"
      },
      "description": "Optional country filter to narrow search results.\n- Must match country name exactly (case-insensitive)\n- When provided, ignores `limit` parameter\n- Examples: \"United States\", \"United Kingdom\", \"Canada\"\n",
      "example": "United States"
     },
     {
      "in": "query",
      "name": "limit",
      "schema": {
       "type": "integer",
       "default": 50,
       "minimum": 1,
       "maximum": 200
      },
      "description": "Maximum number of results to return (only applies to global search).\n- Default: 50\n- Maximum: 200\n- Ignored when `country` parameter is provided\n- Recommended: 10-20 for autocomplete UI\n",
      "example": 20
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved matching cities.\nResults are sorted alphabetically by city name.\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "cities": {
           "type": "array",
           "description": "Array of city objects matching the search query",
           "items": {
            "type": "object",
            "properties": {
             "country": {
              "type": "string",
              "description": "Country name where the city is located",
              "example": "United States"
             },
             "city": {
              "type": "string",
              "description": "City name",
              "example": "San Francisco"
             }
            }
           }
          }
         }
        },
        "examples": {
         "globalSearch": {
          "summary": "Global Search Results",
          "value": {
           "cities": [
            {
             "country": "United States",
             "city": "San Francisco"
            },
            {
             "country": "United States",
             "city": "San Diego"
            },
            {
             "country": "Mexico",
             "city": "San Miguel de Allende"
            }
           ]
          }
         },
         "countrySpecific": {
          "summary": "Country-Specific Search",
          "value": {
           "cities": [
            {
             "country": "United Kingdom",
             "city": "London"
            },
            {
             "country": "United Kingdom",
             "city": "Londonderry"
            }
           ]
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid query parameter - query string too short.\nQuery must be at least 2 characters long.\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string",
           "example": "Query must be at least 2 characters long"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "500": {
      "description": "Internal server error during city search",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string",
           "example": "Failed to search cities"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "search_locations"
   }
  },
  "/admin/location/countries": {
   "get": {
    "summary": "Get list of all available countries for location filtering",
    "description": "## Overview\nRetrieves the complete list of countries that have city data available.\nThis endpoint is used for:\n- Populating country dropdown filters in the leads table\n- Enabling country-based lead segmentation\n- Restricting city searches to specific countries\n- Building location-based targeting criteria\n\n## How Countries Work\n\n### Data Source\n- Only includes countries with city data available\n\n### Response Characteristics\n- **Static list**: Countries don't change frequently\n- **Alphabetically sorted**: Countries ordered A-Z\n- **Full country names**: Returns complete names (e.g., \"United States\", not \"US\")\n- **No pagination**: Returns all countries in single response\n\n## Common Use Cases\n\n**Use Case 1: Country Filter Dropdown**\n```javascript\n// Load countries for filter dropdown on page load\nGET /admin/location/countries\n// Use response to populate <select> or autocomplete\n```\n\n**Use Case 2: Country-Specific City Search**\n```javascript\n// First, get list of countries\nGET /admin/location/countries\n// Then search cities within selected country\nGET /admin/location/cities?q=San&country=United+States\n```\n\n**Use Case 3: Location-Based Segmentation**\n```javascript\n// Get countries to build multi-country segment\nGET /admin/location/countries\n// Filter leads by multiple countries: US, Canada, UK\n```\n\n## Performance & Caching\n\n- **Cache recommended**: Response rarely changes, safe to cache client-side\n- **Cache duration**: 24-48 hours is safe\n- **Fast response**: served from memory, instant response\n- **Low bandwidth**: Small payload (~2-5KB)\n\n## Integration Notes\n\n### Frontend Integration\n- Call once on application load\n- Keep it in your app state\n- Reuse across all location filters\n- No need to refetch on route changes\n\n### Country Name Format\n- Use exact country name for subsequent API calls\n- Country names are case-sensitive in some endpoints\n- Store as returned (don't modify capitalization)\n",
    "tags": [
     "Location"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved list of all available countries.\nCountries are sorted alphabetically.\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "countries": {
           "type": "array",
           "description": "Array of country names with available city data",
           "items": {
            "type": "string",
            "description": "Full country name",
            "example": "United States"
           }
          }
         }
        },
        "example": {
         "countries": [
          "Afghanistan",
          "Albania",
          "Australia",
          "Austria",
          "Belgium",
          "Brazil",
          "Canada",
          "China",
          "Denmark",
          "France",
          "Germany",
          "India",
          "Ireland",
          "Italy",
          "Japan",
          "Mexico",
          "Netherlands",
          "New Zealand",
          "Norway",
          "Poland",
          "Portugal",
          "Singapore",
          "South Africa",
          "Spain",
          "Sweden",
          "Switzerland",
          "United Kingdom",
          "United States"
         ]
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "500": {
      "description": "Internal server error while fetching countries",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string",
           "example": "Failed to fetch countries"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "search_locations"
   }
  },
  "/admin/location/states": {
   "get": {
    "summary": "Get US states for location filtering",
    "description": "## Overview\nRetrieves the list of US states, optionally filtered by a search query.\nThis endpoint is specifically for United States state filtering and is used for:\n- Populating US state dropdown filters in leads table\n- Filtering leads by visitor state location\n- Building US-specific location targeting\n- State-based lead segmentation\n\n## How State Filtering Works\n\n### All States (No Query)\nWhen called without the `q` parameter:\n- Returns complete list of all 50 US states + DC\n- Alphabetically sorted\n- Full state names (e.g., \"California\", not \"CA\")\n- Fast response (no database query)\n\n### Filtered States (With Query)\nWhen `q` parameter is provided:\n- Filters states matching the search term\n- Case-insensitive partial matching\n- Matches anywhere in state name\n- Example: \"new\" matches \"New York\", \"New Jersey\", \"New Mexico\", \"New Hampshire\"\n\n## Search Behavior\n\n- **Case-insensitive**: Works regardless of capitalization\n- **Partial matching**: Matches substring anywhere in name\n- **No minimum length**: Query can be any length (even 1 character)\n- **No limit**: Returns all matching states\n\n## Common Use Cases\n\n**Use Case 1: State Filter Dropdown (Full List)**\n```javascript\n// Load all states for dropdown on page load\nGET /admin/location/states\n// Returns all 50 states + DC\n```\n\n**Use Case 2: State Autocomplete Search**\n```javascript\n// User types \"cal\" in state filter\nGET /admin/location/states?q=cal\n// Returns: California (and any others with \"cal\")\n```\n\n**Use Case 3: Multi-State Segment**\n```javascript\n// Find all \"New\" states for targeting\nGET /admin/location/states?q=new\n// Returns: New York, New Jersey, New Mexico, New Hampshire\n```\n\n**Use Case 4: Region-Based Filtering**\n```javascript\n// Find states containing \"north\" or \"south\"\nGET /admin/location/states?q=north\nGET /admin/location/states?q=south\n```\n\n## Performance & Caching\n\n- **Cache recommended**: States list is static, safe to cache\n- **Cache duration**: Indefinitely safe (states don't change)\n- **Fast response**: No database query, instant response\n- **Tiny payload**: ~1-2KB\n\n## Integration Notes\n\n### US-Specific Endpoint\n- **Only for United States**: Does not include states/provinces from other countries\n- For other countries, use `/admin/location/cities` with country filter\n\n### State Name Format\n- Returns full state names (e.g., \"California\", \"New York\")\n- Use exact name in subsequent API calls\n- No abbreviations (CA, NY, etc.) - full names only\n\n### Related Endpoints\n- Use `/admin/location/cities?country=United States&q=...` for cities within states\n- Use `/admin/location/countries` for country-level filtering\n",
    "tags": [
     "Location"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "q",
      "schema": {
       "type": "string"
      },
      "description": "Optional search query to filter states.\n- Case-insensitive partial matching\n- Matches anywhere in state name\n- Examples: \"new\", \"california\", \"north\"\n- If omitted, returns all states\n",
      "example": "new"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved US states.\nStates are sorted alphabetically.\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "states": {
           "type": "array",
           "description": "Array of US state names",
           "items": {
            "type": "string",
            "description": "Full state name",
            "example": "California"
           }
          }
         }
        },
        "examples": {
         "allStates": {
          "summary": "All US States (No Query)",
          "value": {
           "states": [
            "Alabama",
            "Alaska",
            "Arizona",
            "Arkansas",
            "California",
            "Colorado",
            "Connecticut",
            "Delaware",
            "District of Columbia",
            "Florida",
            "Georgia",
            "Hawaii",
            "Idaho",
            "Illinois",
            "Indiana",
            "Iowa",
            "Kansas",
            "Kentucky",
            "Louisiana",
            "Maine",
            "Maryland",
            "Massachusetts",
            "Michigan",
            "Minnesota",
            "Mississippi",
            "Missouri",
            "Montana",
            "Nebraska",
            "Nevada",
            "New Hampshire",
            "New Jersey",
            "New Mexico",
            "New York",
            "North Carolina",
            "North Dakota",
            "Ohio",
            "Oklahoma",
            "Oregon",
            "Pennsylvania",
            "Rhode Island",
            "South Carolina",
            "South Dakota",
            "Tennessee",
            "Texas",
            "Utah",
            "Vermont",
            "Virginia",
            "Washington",
            "West Virginia",
            "Wisconsin",
            "Wyoming"
           ]
          }
         },
         "filteredStates": {
          "summary": "Filtered States (Query=\"new\")",
          "value": {
           "states": [
            "New Hampshire",
            "New Jersey",
            "New Mexico",
            "New York"
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "500": {
      "description": "Internal server error while fetching states",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string",
           "example": "Failed to fetch states"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "search_locations"
   }
  },
  "/admin/members": {
   "delete": {
    "summary": "Remove a person from your account",
    "description": "Needs the **team** permission. Only an Owner can remove another Owner, and the last Owner cannot be removed.",
    "tags": [
     "Members"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "userId",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Removed"
     },
     "403": {
      "description": "Not allowed"
     },
     "404": {
      "description": "User not found"
     },
     "409": {
      "description": "Last Owner cannot be removed"
     }
    },
    "x-mcp-tool": "remove_member"
   },
   "get": {
    "summary": "List the people on your account",
    "description": "Needs the **team** permission. Each person comes back with `role`\n(Owner or Member), `permissions`, `preset`, `allWebsites` and their\n`websites` (website access list). `legacyRole` is set while the old Admin /\nEditor / Viewer value is still on the record.\nA website-scoped caller only sees people who share one of their websites.\n",
    "tags": [
     "Members"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "accountId",
      "schema": {
       "type": "string"
      },
      "description": "Ignored — always your own account."
     }
    ],
    "responses": {
     "200": {
      "description": "Members"
     }
    },
    "x-mcp-tool": "list_members"
   },
   "put": {
    "summary": "Change a member's role, permissions or websites",
    "description": "Two roles exist: **Owner** (everything) and **Member** (only the\npermissions you tick, on the websites you choose).\n\nSend any of `role`, `preset`, `permissions`, `websites`, `allWebsites`\nin the body (or `role` / `userId` in the query, as before).\n\n**Still sending the old roles?** `Admin`, `Editor` and `Viewer` are\naccepted and translated to a Member with the matching preset — nothing\nbreaks, but please move to `permissions`. See\nhttps://help.happierleads.com/kb/happierleads/article/how-to-manage-team-permissions.\n\nRules: you need the **team** permission; only an Owner can make or\nchange an Owner; the last Owner cannot be demoted; a Member can only\ngrant permissions and websites they hold themselves.\n",
    "tags": [
     "Members"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "userId",
      "schema": {
       "type": "string"
      }
     },
     {
      "in": "query",
      "name": "role",
      "schema": {
       "type": "string",
       "enum": [
        "Owner",
        "Member",
        "Admin",
        "Editor",
        "Viewer"
       ]
      },
      "deprecated": true,
      "description": "Legacy query form — Admin/Editor/Viewer are translated to a preset. Deprecated and will be removed; send role/preset/permissions in the body."
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "userId": {
          "type": "string"
         },
         "role": {
          "type": "string",
          "enum": [
           "Owner",
           "Member"
          ]
         },
         "preset": {
          "type": "string",
          "enum": [
           "full",
           "sales",
           "developer",
           "viewer",
           "team",
           "client"
          ]
         },
         "permissions": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Permission ids from GET /admin/permissions/catalog"
         },
         "allWebsites": {
          "type": "boolean",
          "description": "Every current and future website"
         },
         "websites": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Website ids (replaces the member's website list)"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The updated member"
     },
     "403": {
      "description": "Not allowed (see message)"
     },
     "404": {
      "description": "User not found"
     },
     "409": {
      "description": "Last Owner cannot be demoted"
     }
    },
    "x-mcp-tool": "update_member"
   }
  },
  "/admin/members/websites": {
   "delete": {
    "summary": "Remove member from website",
    "description": "Removes a member's access to a specific website",
    "tags": [
     "Members"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "userId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "User ID to remove access for",
      "example": "507f1f77bcf86cd799439050"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Website ID to remove access from",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "responses": {
     "200": {
      "description": "Member access removed from website successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "description": "Insufficient permissions (only Owners/Admins can remove access)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "You do not have permission"
        }
       }
      }
     },
     "404": {
      "description": "Access entry not found or removal failed",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Failed"
        }
       }
      }
     },
     "405": {
      "description": "Validation error - missing required parameters",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "update_member"
   },
   "post": {
    "summary": "Add member to website",
    "description": "Grants a member access to a specific website",
    "tags": [
     "Members"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "userId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "Website ID to grant access to",
          "example": "601733dbcedff50114a599f6"
         },
         "userId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "User ID to grant access",
          "example": "507f1f77bcf86cd799439050"
         }
        }
       },
       "example": {
        "websiteId": "601733dbcedff50114a599f6",
        "userId": "507f1f77bcf86cd799439050"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Member added to website successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "websiteACLId": {
           "type": "string",
           "description": "ID of the created website access entry"
          }
         }
        },
        "example": {
         "websiteACLId": "507f1f77bcf86cd799439051"
        }
       }
      }
     },
     "401": {
      "description": "Insufficient permissions (only Owners/Admins can add members)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "You do not have permission"
        }
       }
      }
     },
     "405": {
      "description": "Validation error, member already has access, or invalid IDs",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "aclExists": {
          "value": {
           "status": "Member already has access to this website"
          }
         },
         "invalidId": {
          "value": {
           "status": "Invalid Id"
          }
         },
         "validation": {
          "value": {
           "status": [
            {
             "msg": "websiteId Is Required"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error while granting access"
     }
    },
    "x-mcp-tool": "update_member"
   }
  },
  "/admin/prospector/people/search": {
   "post": {
    "summary": "Search people",
    "description": "Find people in the Happierleads contact database by job title, seniority, department, industry, company headquarters location, company size and technology. Free — searching never returns emails or phone numbers; use /admin/prospector/people/reveal for those. One search per second.",
    "tags": [
     "Prospector"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key (a website key only searches for its own website)"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "query"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "The website the search is for (GET /admin/websites)"
         },
         "query": {
          "type": "object",
          "description": "Every filter is optional",
          "properties": {
           "titles": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "example": [
             "CEO",
             "Founder"
            ]
           },
           "seniorities": {
            "type": "array",
            "items": {
             "type": "string"
            }
           },
           "departments": {
            "type": "array",
            "items": {
             "type": "string"
            }
           },
           "industries": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "example": [
             "Computer Software"
            ]
           },
           "locations": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "description": "Company headquarters",
            "example": [
             "United States"
            ]
           },
           "employeesMin": {
            "type": "integer",
            "example": 10
           },
           "employeesMax": {
            "type": "integer",
            "example": 200
           },
           "technologies": {
            "type": "array",
            "items": {
             "type": "string"
            }
           },
           "count": {
            "type": "integer",
            "description": "Per page (default 25)",
            "example": 25
           },
           "page": {
            "type": "integer",
            "description": "Next page"
           }
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "{ people: [...], total, note }"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "403": {
      "description": "Plan without Prospector"
     },
     "429": {
      "description": "More than one search per second",
      "or the plan's search limit is used up": null
     }
    },
    "x-mcp-tool": "search_people"
   }
  },
  "/admin/prospector/people/reveal": {
   "post": {
    "summary": "Reveal a person's email and phone",
    "description": "Returns the email and phone we hold for one person from a search. 1 credit when we hold an email or phone; nothing is charged when we hold neither (status no-contact-details).",
    "tags": [
     "Prospector"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "profileId"
        ],
        "properties": {
         "websiteId": {
          "type": "string"
         },
         "profileId": {
          "type": "string",
          "description": "people[].profileId from a search"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "{ businessEmail, emailStatus, phone, creditsCharged, status, remainingCredits }"
     },
     "402": {
      "description": "Not enough credits"
     }
    },
    "x-mcp-tool": "reveal_contact"
   }
  },
  "/admin/prospector/auto-searches": {
   "get": {
    "summary": "List Auto Searches",
    "description": "The Auto Searches of one website with status, preferences, people per day and delivery counters.",
    "tags": [
     "Prospector"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{ autoSearches: [...] }"
     }
    },
    "x-mcp-tool": "list_auto_searches"
   },
   "post": {
    "summary": "Create an Auto Search",
    "description": "Creates an Auto Search and starts it. Every day new people matching the preferences are verified and added to the website's leads, 1 credit per lead delivered, up to perDay a day, until it is paused.",
    "tags": [
     "Prospector"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "name",
         "prefs"
        ],
        "properties": {
         "websiteId": {
          "type": "string"
         },
         "name": {
          "type": "string",
          "example": "US SaaS founders"
         },
         "description": {
          "type": "string"
         },
         "prefs": {
          "type": "array",
          "description": "From POST /admin/prospector/auto-searches/profile",
          "items": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "enum": [
              "job",
              "seniority",
              "department",
              "industry",
              "emp",
              "revenue",
              "funding",
              "round",
              "tech",
              "hq"
             ]
            },
            "values": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "weight": {
             "type": "string",
             "enum": [
              "Must",
              "High",
              "Prefer",
              "Bonus"
             ]
            }
           }
          }
         },
         "excludes": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "field": {
             "type": "string",
             "enum": [
              "cname",
              "domain",
              "pname"
             ]
            },
            "values": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           }
          }
         },
         "perDay": {
          "type": "integer",
          "enum": [
           25,
           50,
           100,
           200,
           500
          ],
          "default": 100
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "{ autoSearch }"
     },
     "403": {
      "description": "Plan without Prospector"
     }
    },
    "x-mcp-tool": "create_auto_search"
   }
  },
  "/admin/prospector/auto-searches/profile": {
   "post": {
    "summary": "Build Auto Search preferences from a description",
    "description": "Turns a plain-English description of your ideal customer into preferences. Nothing is saved or charged.",
    "tags": [
     "Prospector"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "description"
        ],
        "properties": {
         "websiteId": {
          "type": "string"
         },
         "description": {
          "type": "string",
          "example": "Founders of US SaaS companies with 10-200 employees"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "{ name, prefs }"
     },
     "422": {
      "description": "Could not turn the description into preferences"
     }
    },
    "x-mcp-tool": "build_auto_search_profile"
   }
  },
  "/admin/prospector/auto-searches/{autoSearchId}/{action}": {
   "post": {
    "summary": "Pause or resume an Auto Search",
    "tags": [
     "Prospector"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "in": "path",
      "name": "autoSearchId",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "in": "path",
      "name": "action",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "pause",
        "resume"
       ]
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "{ autoSearch }"
     },
     "404": {
      "description": "Not an Auto Search of this website"
     }
    },
    "x-mcp-tool": "pause_auto_search"
   }
  },
  "/admin/permissions/catalog": {
   "get": {
    "summary": "The team permission catalog",
    "description": "Every permission a Member can be given (grouped), the presets, and\nwhat stays Owner-only. The dashboards render Team settings from this,\nso API callers should read permission ids from here rather than\nhard-coding them. Guide: https://help.happierleads.com/kb/happierleads/article/how-to-manage-team-permissions\n",
    "tags": [
     "Members"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "responses": {
     "200": {
      "description": "{ groups, presets, roles, ownerOnly }"
     }
    },
    "x-mcp-tool": "get_permissions_catalog"
   }
  },
  "/admin/invite": {
   "post": {
    "summary": "Invite Users to Your Team",
    "description": "**How Invites Work:**\n\n1. **Permission Check:** the caller needs the **team** permission (Owners always have it)\n\n2. **Invitation Limit:** Each account can invite a limited number of users\n   - Each successful invite uses one from that allowance\n\n3. **Duplicate Prevention:** People who already have a login in your team are skipped\n   - Only new emails are invited\n\n4. **Account setup:** Each invited person joins your account and sets their own\n   password from the invitation link.\n\n5. **Website Access (Optional):**\n   - You can specify which websites the invited user can access\n   - Leave empty to grant no specific website access\n\n6. **Invitation Email:**\n   - When invitation emails are on (account settings), the email is sent automatically\n   - When they are off, the response returns the invitation links for you to share\n\n**Roles and permissions (since October 2026):**\n- **Owner:** everything, including billing, white-label and adding other Owners.\n- **Member:** exactly the `permissions` you tick, on the `websites` you choose\n  (or `allWebsites: true`). Presets: `full`, `sales`, `developer`, `viewer`,\n  and for white-label accounts `team` and `client`.\n- The old roles `Admin`, `Editor`, `Viewer` still work and map to a preset.\n  Full list and migration notes:\n  https://help.happierleads.com/kb/happierleads/article/how-to-manage-team-permissions\n- You need the **team** permission to invite; only an Owner can invite an Owner;\n  a Member can only grant permissions and websites they hold themselves.\n",
    "tags": [
     "Admin - Team Management"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InviteRequest"
       },
       "examples": {
        "inviteOneUser": {
         "summary": "Invite a single user",
         "value": {
          "invites": [
           {
            "email": "john@example.com",
            "preset": "full",
            "allWebsites": true
           }
          ]
         }
        },
        "inviteTwoUsers": {
         "summary": "Invite two users with different roles",
         "value": {
          "invites": [
           {
            "email": "john@example.com",
            "preset": "sales",
            "websites": [
             "507f1f77bcf86cd799439011",
             "507f1f77bcf86cd799439012"
            ]
           },
           {
            "email": "dev@agency.com",
            "permissions": [
             "pixel"
            ],
            "websites": [
             "507f1f77bcf86cd799439011"
            ]
           }
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Invitations sent successfully",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InviteSuccessResponse"
        },
        "examples": {
         "withEmailNotification": {
          "summary": "Success (with email notification enabled)",
          "value": {
           "status": "Invites Sent"
          }
         },
         "withoutEmailNotification": {
          "summary": "Success (with email notification disabled)",
          "value": {
           "status": "Invites Sent",
           "invitationLinks": [
            "https://app.example.com/reset-password?isInvite=true&resetId=abc-123-def",
            "https://app.example.com/reset-password?isInvite=true&resetId=xyz-789-uvw"
           ]
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "You do not have permission (Viewer/Editor cannot invite)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InviteErrorResponse"
        },
        "example": {
         "status": "You do not have permission"
        }
       }
      }
     },
     "405": {
      "description": "Validation error or user already exists or no remaining invitations",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InviteErrorResponse"
        },
        "examples": {
         "noInvitations": {
          "summary": "No remaining invitations",
          "value": {
           "status": [
            {
             "msg": "You have no remaining invitations"
            }
           ]
          }
         },
         "alreadyExists": {
          "summary": "User already exists",
          "value": {
           "status": "Invitation already exists"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error during invitation process",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InviteErrorResponse"
        },
        "example": {
         "status": "Inviting the new member faild!"
        }
       }
      }
     }
    },
    "x-mcp-tool": "invite_members"
   }
  },
  "/admin/websites/{id}": {
   "delete": {
    "summary": "Delete website",
    "description": "Marks a website as deleted and handles account cleanup. Users can now delete all websites, including their last one.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Website ID to delete",
      "example": "507f1f77bcf86cd799439016"
     }
    ],
    "responses": {
     "200": {
      "description": "Website deleted successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Workspace successfully deleted"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "404": {
      "description": "Insufficient permissions or protected website",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "examples": {
         "noPermission": {
          "value": {
           "status": "You don't have enough rights to delete the website!"
          }
         },
         "protected": {
          "value": {
           "status": "You are not allowed to removed those accounts."
          }
         },
         "notFound": {
          "value": {
           "status": "Something went wrong"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Validation error - missing website ID",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Server error during deletion"
     }
    },
    "x-mcp-tool": "delete_website"
   },
   "put": {
    "summary": "Update website configuration and tracking settings",
    "description": "## Overview\nUpdates various website configuration settings including tracking options, webhooks, GDPR compliance,\nemail notifications, and visitor identification settings. This is the main endpoint for managing\nwebsite behavior after creation.\n\n## Configuration Categories\n\n### 1. Domain & URL Settings\n\n**url** - Full website URL with protocol\n- Updates the primary website URL\n- Example: `\"https://example.com\"`\n- Used for tracking script validation\n\n**domain** - Website domain (without protocol)\n- Automatically cleaned (removes https://)\n- Example: `\"example.com\"` or `\"www.example.com\"`\n- Used for visitor domain matching\n\n### 2. Webhook Configuration\n\n**webhook** - External webhook URL for lead notifications\n- Receives POST requests when new leads captured\n- Saving a new URL re-activates delivery to it\n- Webhook payload includes full lead data\n- Supports HTTPS endpoints only\n\n### 3. GDPR Compliance\n\n**GDPRSuppression** - Enable GDPR data suppression\n- `true`: Suppresses PII for EU visitors\n- `false`: Full data collection (default)\n- Affects: email addresses, names, phone numbers\n- Auto-detects EU visitors by IP geolocation\n\n### 4. Email Digest Notifications\n\n**emailDigestFrequency** - How often to send lead digests\n- `\"daily\"`: Send digest every day at 9 AM\n- `\"weekly\"`: Send digest every Monday at 9 AM\n- `\"never\"`: Disable digest emails\n- Digests include: new leads count, top companies, engagement metrics\n\n**emailDigestRecipients** - Who receives digest emails\n- Array of email addresses\n- Maximum 10 recipients recommended\n- Example: `[\"admin@company.com\", \"sales@company.com\"]`\n- Recipients don't need to be users in the system\n\n### 5. Visitor Identification Settings\n\n**identifySettings** - Level of visitor data collection\n- `\"both\"`: Collect company AND personal data (default)\n- `\"company-level-data\"`: Company info only (no personal data)\n- `\"personal-level-data\"`: Personal info only (no company data)\n- Affects: lead enrichment, data storage, GDPR compliance\n\n**trackExactVisitors** - Enable individual visitor tracking\n- `true`: Track named visitors\n- `false`: Company-level tracking only\n- Provides: Names, titles, contact info of individual visitors\n\n**trackCompanyWithSuggestedContacts** - Include contact suggestions\n- `true`: Provide suggested contacts for each company lead\n- `false`: Company data only, no contact suggestions\n- Enhances leads with: decision-makers, key contacts, LinkedIn profiles\n- Requires: Additional credits for contact enrichment\n\n### 6. Email Tracking Features\n\n**emailTrackingEnabled** - Enable email open/click tracking\n- `true`: Track email opens and link clicks\n- `false`: Disable email tracking (default)\n- Used for: outreach campaigns, email warmup, engagement metrics\n- Requires: Email account integration\n\n### 7. Company Information (for AI Features)\n\n**companyInfo** - Your company details for AI personalization\n```javascript\n{\n  companyName: \"Your Company Name\",\n  companyDescription: \"What your company does\",\n  icp: [  // Ideal Customer Profile\n    {\n      targetCompanyDescription: \"B2B SaaS companies\",\n      targetPeopleDescription: \"Marketing directors and CMOs\"\n    }\n  ]\n}\n```\n- Used for: AI lead scoring, personalized outreach, lead qualification\n- Helps AI identify high-value leads matching your ICP\n\n### 8. Company Exclusions (Filtering)\n\n**companyExclusions** - Filter out unwanted companies\n```javascript\n{\n  industries: [\"Gambling\", \"Tobacco\"],\n  employeeSizes: [\"1-10\", \"11-50\"],  // Exclude small companies\n  companyTypes: [\"Non-profit\", \"Government\"],\n  sectors: [\"Retail\", \"Food Service\"]\n}\n```\n- Automatically excludes leads matching criteria\n- Saves credits by not tracking irrelevant visitors\n- Applied during lead capture, not retroactively\n\n## Common Use Cases\n\n**Use Case 1: Enable Webhook Notifications**\n```javascript\nPUT /admin/websites/{id}\n{\n  \"webhook\": \"https://your-app.com/webhooks/leads\",\n  \"emailDigestFrequency\": \"never\"  // Use webhook instead of emails\n}\n```\n\n**Use Case 2: GDPR-Compliant Configuration**\n```javascript\nPUT /admin/websites/{id}\n{\n  \"GDPRSuppression\": true,\n  \"identifySettings\": \"company-level-data\"  // No personal data\n}\n```\n\n**Use Case 3: Sales Team Email Digests**\n```javascript\nPUT /admin/websites/{id}\n{\n  \"emailDigestFrequency\": \"daily\",\n  \"emailDigestRecipients\": [\n    \"sales-team@company.com\",\n    \"ceo@company.com\"\n  ]\n}\n```\n\n**Use Case 4: B2B Enterprise Focus**\n```javascript\nPUT /admin/websites/{id}\n{\n  \"companyExclusions\": {\n    \"employeeSizes\": [\"1-10\", \"11-50\"],  // Only 50+ employees\n    \"industries\": [\"Retail\", \"Food Service\"]\n  },\n  \"trackCompanyWithSuggestedContacts\": true,  // Get decision-makers\n  \"companyInfo\": {\n    \"companyName\": \"B2B SaaS Platform\",\n    \"companyDescription\": \"Enterprise sales automation\",\n    \"icp\": [{\n      \"targetCompanyDescription\": \"B2B tech companies, 50-500 employees\",\n      \"targetPeopleDescription\": \"VP Sales, CRO, Sales Directors\"\n    }]\n  }\n}\n```\n\n**Use Case 5: Update Website Domain**\n```javascript\nPUT /admin/websites/{id}\n{\n  \"url\": \"https://newdomain.com\",\n  \"domain\": \"newdomain.com\"\n}\n```\n\n## Important Notes\n\n- **Partial Updates**: Only include fields you want to change\n- **Null Values**: Send `null` explicitly to clear optional fields\n- **Validation**: Send only the documented values for enum fields\n- **Immediate Effect**: Changes apply to new leads immediately (not retroactive)\n",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Website ID to update",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string",
          "format": "uri",
          "description": "Full website URL with protocol (https://). Logged for audit trail.",
          "example": "https://example.com"
         },
         "domain": {
          "type": "string",
          "description": "Website domain without protocol. Automatically cleaned and stored.",
          "example": "example.com"
         },
         "webhook": {
          "type": "string",
          "format": "uri",
          "description": "HTTPS webhook URL for real-time lead notifications. Resets failed attempt counter.",
          "example": "https://your-app.com/webhooks/leads"
         },
         "GDPRSuppression": {
          "type": "boolean",
          "description": "Enable GDPR compliance mode (suppresses PII for EU visitors)",
          "example": true
         },
         "emailDigestFrequency": {
          "type": "string",
          "enum": [
           "daily",
           "weekly",
           "never"
          ],
          "description": "How often to send lead digest emails",
          "example": "daily"
         },
         "emailDigestRecipients": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "email"
          },
          "description": "Email addresses to receive digest notifications (max 10 recommended)",
          "example": [
           "admin@example.com",
           "sales@example.com"
          ]
         },
         "identifySettings": {
          "type": "string",
          "enum": [
           "both",
           "personal-level-data",
           "company-level-data"
          ],
          "description": "Level of visitor data collection and enrichment",
          "example": "both"
         },
         "trackExactVisitors": {
          "type": "boolean",
          "description": "Enable individual visitor tracking",
          "example": true
         },
         "trackCompanyWithSuggestedContacts": {
          "type": "boolean",
          "description": "Include suggested decision-maker contacts for each company lead",
          "example": true
         },
         "emailTrackingEnabled": {
          "type": "boolean",
          "description": "Enable email open and click tracking for outreach campaigns",
          "example": false
         },
         "companyInfo": {
          "type": "object",
          "description": "Your company information for AI lead scoring and personalization",
          "properties": {
           "companyName": {
            "type": "string",
            "example": "Acme Corp"
           },
           "companyDescription": {
            "type": "string",
            "example": "B2B SaaS platform for sales automation"
           },
           "icp": {
            "type": "array",
            "description": "Ideal Customer Profile definitions",
            "items": {
             "type": "object",
             "properties": {
              "targetCompanyDescription": {
               "type": "string",
               "example": "B2B tech companies, 50-500 employees"
              },
              "targetPeopleDescription": {
               "type": "string",
               "example": "VP Sales, CRO, Sales Directors"
              }
             }
            }
           }
          }
         },
         "companyExclusions": {
          "type": "object",
          "description": "Automatically exclude companies matching these criteria",
          "properties": {
           "industries": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "example": [
             "Gambling",
             "Tobacco"
            ]
           },
           "employeeSizes": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "example": [
             "1-10",
             "11-50"
            ]
           },
           "companyTypes": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "example": [
             "Non-profit",
             "Government"
            ]
           },
           "sectors": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "example": [
             "Retail",
             "Food Service"
            ]
           }
          }
         }
        }
       },
       "examples": {
        "webhookSetup": {
         "summary": "Configure Webhook Notifications",
         "value": {
          "webhook": "https://your-app.com/webhooks/leads",
          "emailDigestFrequency": "never"
         }
        },
        "gdprCompliance": {
         "summary": "GDPR-Compliant Setup",
         "value": {
          "GDPRSuppression": true,
          "identifySettings": "company-level-data"
         }
        },
        "enterpriseFocus": {
         "summary": "Enterprise B2B Configuration",
         "value": {
          "trackCompanyWithSuggestedContacts": true,
          "companyExclusions": {
           "employeeSizes": [
            "1-10",
            "11-50"
           ]
          },
          "companyInfo": {
           "companyName": "Enterprise SaaS",
           "companyDescription": "B2B sales platform",
           "icp": [
            {
             "targetCompanyDescription": "Tech companies 50-500 employees",
             "targetPeopleDescription": "VP Sales, CRO"
            }
           ]
          }
         }
        },
        "industryExclusions": {
         "summary": "Exclude Specific Industries and Company Sizes",
         "value": {
          "companyExclusions": {
           "industries": [
            "Accounting"
           ],
           "employeeSizes": [
            "10k-120k"
           ],
           "companyTypes": [],
           "sectors": []
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Website settings updated successfully. Changes apply immediately to new leads.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "successful"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Invalid website ID or validation error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "invalidId": {
          "summary": "Invalid Website ID",
          "value": {
           "status": "Invalid Id"
          }
         },
         "validationError": {
          "summary": "Validation Errors",
          "value": {
           "status": [
            {
             "msg": "id Is Required",
             "param": "id"
            }
           ]
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal server error during website update",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "Database update failed"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "update_website"
   }
  },
  "/admin/website/analytics": {
   "get": {
    "summary": "Get aggregated analytics for a website (last 30 days)",
    "description": "Retrieves aggregated analytics including industries, company sizes, and job titles\nfor the last 30 days. Used for homepage dashboard pie charts and insights.\n",
    "tags": [
     "Websites",
     "Analytics"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website"
     },
     {
      "in": "query",
      "name": "days",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 30
      },
      "description": "Number of days to aggregate (default 30)"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved analytics",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "industries": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "name": {
              "type": "string"
             },
             "count": {
              "type": "integer"
             }
            }
           }
          },
          "companySizes": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "range": {
              "type": "string"
             },
             "count": {
              "type": "integer"
             }
            }
           }
          },
          "jobTitles": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "title": {
              "type": "string"
             },
             "count": {
              "type": "integer"
             }
            }
           }
          },
          "topCountries": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "country": {
              "type": "string"
             },
             "count": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     }
    },
    "x-mcp-tool": "get_website_analytics"
   }
  },
  "/admin/website/daily-stats": {
   "get": {
    "summary": "Get daily statistics for a website (last 30 days) - REAL-TIME",
    "description": "Retrieves daily lead identification statistics for the last 30 days.\nCounts are live (real-time).\nUsed for homepage dashboard trend visualization.\n",
    "tags": [
     "Websites",
     "Analytics"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website"
     },
     {
      "in": "query",
      "name": "days",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 30
      },
      "description": "Number of days to fetch (default 30)"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved daily statistics",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "stats": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "date": {
              "type": "string",
              "format": "date"
             },
             "leadsIdentified": {
              "type": "integer"
             },
             "leadsProspected": {
              "type": "integer"
             },
             "emailsSent": {
              "type": "integer"
             },
             "emailsScheduled": {
              "type": "integer"
             },
             "avgIcpScore": {
              "type": "number",
              "nullable": true,
              "description": "Average ICP score for the day (0-100)"
             },
             "leadsWithIcpScore": {
              "type": "integer",
              "description": "Number of leads with ICP scores"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     }
    },
    "x-mcp-tool": "get_website_daily_stats"
   }
  },
  "/admin/website": {
   "get": {
    "summary": "Get website details with tracking script",
    "description": "Retrieves comprehensive website information including configuration, limits, and integrations.\n\n**Important:** The response includes a ready-to-use `trackingScript` field containing your website's tracking pixel.\nSimply copy this script and paste it into your website's `<head>` section to start tracking visitors.\n",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved website details",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "url": {
           "type": "string"
          },
          "domain": {
           "type": "string"
          },
          "status": {
           "type": "string",
           "enum": [
            "active",
            "inactive",
            "deleted"
           ]
          },
          "limits": {
           "type": "object",
           "properties": {
            "credits": {
             "type": "integer"
            },
            "emailAccounts": {
             "type": "integer"
            }
           }
          },
          "remaining": {
           "type": "object",
           "properties": {
            "credits": {
             "type": "integer"
            },
            "emailAccounts": {
             "type": "integer"
            }
           }
          },
          "GDPRSuppression": {
           "type": "boolean",
           "description": "GDPR compliance setting"
          },
          "emailDigestFrequency": {
           "type": "string",
           "enum": [
            "daily",
            "weekly",
            "never"
           ]
          },
          "emailDigestRecipients": {
           "type": "array",
           "items": {
            "type": "string",
            "format": "email"
           }
          },
          "trackExactVisitors": {
           "type": "boolean"
          },
          "emailTrackingEnabled": {
           "type": "boolean"
          },
          "trackingScript": {
           "type": "string",
           "description": "Ready-to-use tracking script with website's clientId"
          },
          "createdAt": {
           "type": "string",
           "format": "date-time"
          },
          "updatedAt": {
           "type": "string",
           "format": "date-time"
          }
         }
        },
        "example": {
         "_id": "601733dbcedff50114a599f6",
         "name": "My Company Website",
         "url": "https://example.com",
         "domain": "example.com",
         "status": "active",
         "limits": {
          "credits": 1000,
          "emailAccounts": 5
         },
         "remaining": {
          "credits": 750,
          "emailAccounts": 3
         },
         "GDPRSuppression": true,
         "emailDigestFrequency": "daily",
         "emailDigestRecipients": [
          "admin@example.com"
         ],
         "trackExactVisitors": true,
         "emailTrackingEnabled": true,
         "trackingScript": "<script defer fetchpriority=\"low\" data-cfasync=\"false\" src=\"https://rest.pagemetry.com/v3/script?clientId=jBp2o5N2WYxHvG9HZbKCsR\"></script>",
         "createdAt": "2024-01-01T00:00:00.000Z",
         "updatedAt": "2024-01-01T00:00:00.000Z"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Invalid website ID or validation error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "invalidId": {
          "value": {
           "status": "Invalid Id"
          }
         },
         "noWebsite": {
          "value": {
           "status": "No website found"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_website"
   }
  },
  "/admin/websites": {
   "get": {
    "summary": "Get paginated list of websites for the current user",
    "description": "Retrieves a paginated list of websites with optimized data for admin display",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "page",
      "schema": {
       "type": "integer",
       "default": 1
      },
      "description": "Page number (starts from 1)"
     },
     {
      "in": "query",
      "name": "limit",
      "schema": {
       "type": "integer",
       "default": 50,
       "maximum": 100
      },
      "description": "Number of websites per page"
     },
     {
      "in": "query",
      "name": "search",
      "schema": {
       "type": "string"
      },
      "description": "Search term to filter websites by domain name"
     },
     {
      "in": "query",
      "name": "status",
      "schema": {
       "type": "string",
       "enum": [
        "all",
        "unverified",
        "verified",
        "removed"
       ],
       "default": "all"
      },
      "description": "Filter websites by status (defaults to 'all' which excludes only deleted)"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved websites list",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "websites": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "_id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "url": {
              "type": "string"
             },
             "domain": {
              "type": "string"
             },
             "clientId": {
              "type": "string"
             },
             "validationUrl": {
              "type": "string"
             },
             "status": {
              "type": "string"
             },
             "createdAt": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          },
          "pagination": {
           "type": "object",
           "properties": {
            "total": {
             "type": "integer"
            },
            "page": {
             "type": "integer"
            },
            "limit": {
             "type": "integer"
            },
            "totalPages": {
             "type": "integer"
            },
            "hasNext": {
             "type": "boolean"
            },
            "hasPrev": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     }
    },
    "x-mcp-tool": "list_websites"
   },
   "post": {
    "summary": "Create a new website workspace for visitor tracking",
    "description": "Creates a new website workspace with visitor tracking capabilities.\n\n## Website Name\nThe `name` field is **optional**:\n- Leave it empty and it will default to \"New Website\"\n- You can provide your own internal ID or reference name\n- Websites cannot be looked up by name\n- Name is for organization only and not used in tracking\n\n## Website Lifecycle & Status Transitions\n\nWebsites progress through several status states:\n\n### Status: `unverified` (Initial State)\n- Created by this endpoint\n- Tracking script not yet detected\n- No visitors tracked\n- **Next Step**: Install tracking script on your website\n\n### Status: `verified` (Active Tracking)\n- First visitor successfully tracked\n- Automatically transitions from `unverified` on first hit\n- Visitors being tracked and leads generated\n- **Action**: Normal operation - leads visible in dashboard\n\n### Status: `removed` (Script Uninstalled)\n- Tracking script removed from website\n- Detected after prolonged inactivity\n- Historical leads preserved\n- **Action**: Reinstall script to reactivate\n",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "Website/workspace name for organization and identification.\n- Optional: Defaults to \"New Website\" if not provided\n- Can be updated later via website update endpoint\n- Used for display purposes only (not in tracking script)\n- Recommended: Use descriptive names like \"Main Website\", \"Landing Pages\", \"Blog\"\n",
          "minLength": 1,
          "maxLength": 100,
          "example": "My E-commerce Store"
         },
         "domain": {
          "type": "string",
          "description": "The website's domain (optional; may be empty, the pixel install screen asks for it).",
          "example": "acme.com"
         }
        }
       },
       "examples": {
        "withName": {
         "summary": "Create with custom name",
         "value": {
          "name": "E-commerce Store"
         }
        },
        "withoutName": {
         "summary": "Create with default name",
         "value": {}
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Website created successfully with:\n- Unique website ID for API calls\n- Default status: \"unverified\"\n- Credit and email limits inherited from your account\n- Access for you and the account owner\n- Uses one website from your plan's allowance\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "websiteId": {
           "type": "string",
           "description": "ID of the newly created website.\nUse this ID for:\n- Retrieving tracking script: GET /admin/websites/{websiteId}\n- Updating configuration: PUT /admin/websites/{websiteId}\n- Managing integrations: POST /admin/websites/{websiteId}/integrations\n",
           "pattern": "^[0-9a-fA-F]{24}$",
           "example": "507f1f77bcf86cd799439016"
          }
         }
        },
        "examples": {
         "success": {
          "summary": "Successful Creation",
          "value": {
           "websiteId": "507f1f77bcf86cd799439016"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "User account not found or not properly configured",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "User account not found or not properly configured"
        }
       }
      }
     },
     "401": {
      "description": "Permission denied or account limit reached.\n- Viewers cannot create websites (role restriction)\n- Account has reached maximum websites allowed (upgrade required)\n",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "examples": {
         "noPermission": {
          "summary": "Viewer Role Restriction",
          "value": {
           "status": "You do not have permission to create a website!"
          }
         },
         "limitReached": {
          "summary": "Website Quota Exceeded",
          "value": {
           "status": "You cannot add more websites, please upgrade"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "User or account not found in database",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "examples": {
         "userNotFound": {
          "value": {
           "status": "User not found"
          }
         },
         "accountNotFound": {
          "value": {
           "status": "Account not found"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal server error during website creation process",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "error": {
           "type": "string",
           "description": "Short error summary"
          }
         }
        },
        "examples": {
         "creationFailed": {
          "summary": "Website Creation Failed",
          "value": {
           "status": "Failed to create website"
          }
         },
         "serverError": {
          "summary": "Unexpected Server Error",
          "value": {
           "status": "Internal server error",
           "error": "Unexpected error"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "add_website"
   }
  },
  "/admin/websites/blacklist": {
   "get": {
    "summary": "Get blacklisted countries",
    "description": "Retrieves list of countries that are blacklisted for a specific website",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "ID of the website",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "responses": {
     "200": {
      "description": "Successfully retrieved blacklisted countries",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "_id": {
           "type": "string"
          },
          "websiteId": {
           "type": "string"
          },
          "countryCode": {
           "type": "string",
           "description": "ISO country code(s) - can be comma-separated",
           "example": "CN,RU,IR"
          },
          "createdAt": {
           "type": "string",
           "format": "date-time"
          },
          "updatedAt": {
           "type": "string",
           "format": "date-time"
          }
         }
        },
        "example": {
         "_id": "507f1f77bcf86cd799439015",
         "websiteId": "601733dbcedff50114a599f6",
         "countryCode": "CN,RU,IR,KP",
         "createdAt": "2024-01-01T00:00:00.000Z",
         "updatedAt": "2024-01-01T00:00:00.000Z"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Invalid website ID or validation error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "invalidId": {
          "value": {
           "status": "Invalid Id"
          }
         },
         "noWebsite": {
          "value": {
           "status": "No website found"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "get_country_blacklist"
   },
   "post": {
    "summary": "Add countries to blacklist",
    "description": "## Overview\nAdds one or more countries to the website blacklist. Visitors from blacklisted countries\nwill be excluded from lead tracking and identification.\n\n## How It Works\n- Accepts an array of ISO 3166-1 alpha-2 country codes (e.g., \"US\", \"BD\", \"CN\")\n- Creates a new blacklist entry if one doesn't exist for the website\n- Updates the existing blacklist if one already exists (replaces the country list)\n- Changes take effect immediately for new visitors\n\n## Common Use Cases\n\n**Exclude Specific Countries:**\n```javascript\nPOST /admin/websites/blacklist\n{\n  \"websiteId\": \"601733dbcedff50114a599f6\",\n  \"countryCode\": [\"BD\", \"CN\", \"RU\"]\n}\n```\n\n**Blacklist Single Country:**\n```javascript\nPOST /admin/websites/blacklist\n{\n  \"websiteId\": \"601733dbcedff50114a599f6\",\n  \"countryCode\": [\"BD\"]\n}\n```\n\n## Important Notes\n- This replaces the entire blacklist (not additive)\n- To remove all blacklisted countries, send an empty array\n- Country codes must be valid ISO 3166-1 alpha-2 codes (2 uppercase letters)\n",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "countryCode"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{24}$",
          "description": "ID of the website",
          "example": "6853c2eeab7628001232038e"
         },
         "countryCode": {
          "type": "array",
          "items": {
           "type": "string",
           "pattern": "^[A-Z]{2}$"
          },
          "description": "Array of ISO 3166-1 alpha-2 country codes to blacklist",
          "example": [
           "BD",
           "CN",
           "RU"
          ]
         }
        }
       },
       "examples": {
        "singleCountry": {
         "summary": "Blacklist Single Country",
         "value": {
          "websiteId": "6853c2eeab7628001232038e",
          "countryCode": [
           "BD"
          ]
         }
        },
        "multipleCountries": {
         "summary": "Blacklist Multiple Countries",
         "value": {
          "websiteId": "6853c2eeab7628001232038e",
          "countryCode": [
           "BD",
           "CN",
           "RU",
           "KP",
           "IR"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Countries added to blacklist successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Successful"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "405": {
      "description": "Validation error or invalid website ID",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array",
             "items": {
              "type": "object"
             }
            }
           ]
          }
         }
        },
        "examples": {
         "invalidId": {
          "value": {
           "status": "Invalid Id"
          }
         },
         "validation": {
          "value": {
           "status": [
            {
             "msg": "countryCode Is Required",
             "param": "countryCode"
            }
           ]
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "set_country_blacklist"
   }
  },
  "/admin/websites/{id}/tags": {
   "patch": {
    "summary": "Replace the tag list on a website",
    "description": "Sets the operator-defined labels used to group websites in the\nWebsites list. Send the complete desired list — this replaces rather\nthan merges. Tags are trimmed, de-duplicated case-insensitively, capped\nat 24 characters each and 12 per website.\n",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "tags"
        ],
        "properties": {
         "tags": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "example": [
           "agency",
           "priority"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Tags updated"
     },
     "400": {
      "description": "tags must be an array of strings"
     },
     "403": {
      "description": "Insufficient rights"
     },
     "404": {
      "description": "Website not found"
     }
    },
    "x-mcp-tool": "set_website_tags"
   }
  },
  "/admin/websites/set-limits/{websiteId}": {
   "put": {
    "summary": "Set a website's leads (credits) and email accounts",
    "description": "How many leads (credits) and email accounts one website gets. Use it for every website you run\nfor a client: right after creating it, and whenever their plan changes.\n\n- **First time:** the allowance and what is left are both set to the new numbers.\n- **Upgrade:** the extra leads are added to what is left now (limit 1,000 with 500 left → 2,000 gives 1,500 left).\n- **Downgrade:** what is left is capped at the new number.\n- **`resetCredits: true`:** refills what is left to the full allowance right now (use it when a client pays).\n- **`credits: 0`:** no new leads (tracking stops); their leads and settings are kept.\n\nBoth `credits` and `emailAccounts` are required. Trial or paid mode and the monthly refill date are set with\n`PUT /admin/websites/toggle-limits/{websiteId}`.\n",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Website ID to update limits for",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "credits",
         "emailAccounts"
        ],
        "properties": {
         "credits": {
          "type": "integer",
          "description": "Maximum number of credits (leads/visitors) allowed. Set to 0 to disable tracking.",
          "minimum": 0,
          "maximum": 100000,
          "example": 1000
         },
         "emailAccounts": {
          "type": "integer",
          "description": "Maximum number of email accounts allowed for integrations. Set to 0 to disable email features.",
          "minimum": 0,
          "maximum": 100,
          "example": 5
         },
         "resetCredits": {
          "type": "boolean",
          "description": "Refill what is left to the full allowance right now.",
          "example": true
         }
        }
       },
       "examples": {
        "upgrade": {
         "summary": "Upgrade to Pro Plan",
         "value": {
          "credits": 5000,
          "emailAccounts": 10
         }
        },
        "trial": {
         "summary": "Trial Plan Setup",
         "value": {
          "credits": 100,
          "emailAccounts": 2
         }
        },
        "enterprise": {
         "summary": "Enterprise Plan",
         "value": {
          "credits": 50000,
          "emailAccounts": 50
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Limits updated; what is left is adjusted as described above.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "website": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string",
             "description": "Website unique identifier"
            },
            "name": {
             "type": "string",
             "description": "Website name"
            },
            "status": {
             "type": "string",
             "enum": [
              "unverified",
              "verified",
              "paused",
              "removed"
             ],
             "description": "Current website status"
            },
            "websiteLimitsEnabled": {
             "type": "boolean",
             "description": "Whether limits are enforced"
            },
            "limits": {
             "type": "object",
             "properties": {
              "credits": {
               "type": "integer",
               "description": "Maximum credits allowed"
              },
              "emailAccounts": {
               "type": "integer",
               "description": "Maximum email accounts allowed"
              }
             }
            },
            "remaining": {
             "type": "object",
             "properties": {
              "credits": {
               "type": "integer",
               "description": "Available credits (auto-calculated)"
              },
              "emailAccounts": {
               "type": "integer",
               "description": "Available email account slots"
              }
             }
            },
            "refreshOn": {
             "type": "string",
             "format": "date-time",
             "nullable": true,
             "description": "Date when limits will auto-refresh"
            },
            "trialEnds": {
             "type": "string",
             "format": "date-time",
             "nullable": true,
             "description": "Trial expiration date"
            },
            "updatedAt": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        },
        "examples": {
         "success": {
          "summary": "Successful Update",
          "value": {
           "website": {
            "_id": "601733dbcedff50114a599f6",
            "name": "My Website",
            "status": "verified",
            "websiteLimitsEnabled": true,
            "limits": {
             "credits": 1500,
             "emailAccounts": 10
            },
            "remaining": {
             "credits": 1500,
             "emailAccounts": 10
            },
            "refreshOn": "2024-02-01T00:00:00.000Z",
            "trialEnds": null,
            "updatedAt": "2024-01-02T00:00:00.000Z"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/UnauthorizedError"
     },
     "404": {
      "description": "Website not found - Invalid websiteId provided",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Website not found"
        }
       }
      }
     },
     "405": {
      "description": "Validation error - Missing required fields (credits or emailAccounts)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "msg": {
              "type": "string"
             },
             "param": {
              "type": "string"
             }
            }
           }
          }
         }
        },
        "example": {
         "status": [
          {
           "msg": "Credits is required",
           "param": "credits"
          }
         ]
        }
       }
      }
     },
     "500": {
      "description": "Server error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "Could not update the limits"
        }
       }
      }
     }
    },
    "x-mcp-tool": "set_website_limits"
   }
  },
  "/admin/websites/toggle-limits/{websiteId}": {
   "put": {
    "summary": "Put a website on trial or paid, and set its monthly refill date",
    "description": "A website runs either as a **trial** (ends on `trialExpireDate`) or **paid** (its leads refill to the full\nallowance every month on `refreshOnDate`, then the date moves on a month). Never both at once.\n\n- **Start a trial:** `{ \"trialEnabled\": true, \"trialExpireDate\": \"…\", \"enableWebsiteLimits\": true }`.\n  When the trial ends its leads go to 0 by themselves.\n- **Paid (or trial → paid):** `{ \"trialEnabled\": false, \"activeWebsite\": true, \"enableWebsiteLimits\": true, \"refreshOnDate\": \"<next billing date>\" }`,\n  then set the plan's leads with `PUT /admin/websites/set-limits/{websiteId}` and `resetCredits: true`.\n- **Cancel:** `{ \"activeWebsite\": false }` stops the monthly refill (set the leads to 0 with set-limits first).\n\nA normal monthly renewal needs no call.\n",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{24}$"
      },
      "description": "Website ID",
      "example": "601733dbcedff50114a599f6"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "trialEnabled": {
          "type": "boolean",
          "description": "Enable or disable trial mode.\n- `true`: Sets website to trial mode (requires `trialExpireDate`)\n- `false`: Clears trial mode (sets `trialEnds` to null)\n"
         },
         "trialExpireDate": {
          "type": "string",
          "format": "date-time",
          "description": "When the trial expires. Required when `trialEnabled` is true.",
          "example": "2026-06-01T00:00:00.000Z"
         },
         "activeWebsite": {
          "type": "boolean",
          "description": "Enable or disable active/paid mode.\n- `true`: Sets website to active mode (requires `refreshOnDate`)\n- `false`: Clears active mode (sets `refreshOn` to null)\n"
         },
         "refreshOnDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date when credits will automatically reset. Required when `activeWebsite` is true.\nTypically set to the next billing cycle date.\n",
          "example": "2026-06-01T00:00:00.000Z"
         },
         "enableWebsiteLimits": {
          "type": "boolean",
          "description": "Enable or disable website-level limits.\n- `true`: Website uses its own limits (from `limits` field)\n- `false`: Website uses account-level limits (unlimited at website level)\n"
         }
        }
       },
       "examples": {
        "setupTrial": {
         "summary": "Set up a new trial",
         "description": "A trial that ends on a date",
         "value": {
          "trialEnabled": true,
          "trialExpireDate": "2026-06-01T00:00:00.000Z",
          "enableWebsiteLimits": true
         }
        },
        "convertToPaid": {
         "summary": "Convert trial to paid",
         "description": "End trial and set up monthly billing reset",
         "value": {
          "trialEnabled": false,
          "activeWebsite": true,
          "refreshOnDate": "2026-06-01T00:00:00.000Z"
         }
        },
        "setupActive": {
         "summary": "Set up active website with billing reset",
         "description": "Configure a paid website with monthly credit reset",
         "value": {
          "activeWebsite": true,
          "refreshOnDate": "2026-06-01T00:00:00.000Z",
          "enableWebsiteLimits": true
         }
        },
        "disableLimits": {
         "summary": "Disable website limits",
         "description": "Make website use account-level limits (unlimited)",
         "value": {
          "enableWebsiteLimits": false
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Website mode updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "website": {
           "type": "object",
           "properties": {
            "_id": {
             "type": "string"
            },
            "trialEnds": {
             "type": "string",
             "format": "date-time",
             "nullable": true,
             "description": "Trial expiration date (null if not in trial mode)"
            },
            "refreshOn": {
             "type": "string",
             "format": "date-time",
             "nullable": true,
             "description": "Next credit reset date (null if not in active mode)"
            },
            "websiteLimitsEnabled": {
             "type": "boolean",
             "description": "Whether website-level limits are enforced"
            },
            "limits": {
             "type": "object",
             "properties": {
              "credits": {
               "type": "integer",
               "nullable": true
              },
              "emailAccounts": {
               "type": "integer",
               "nullable": true
              }
             }
            },
            "remaining": {
             "type": "object",
             "properties": {
              "credits": {
               "type": "integer",
               "nullable": true
              },
              "emailAccounts": {
               "type": "integer",
               "nullable": true
              }
             }
            }
           }
          },
          "message": {
           "type": "string",
           "description": "Optional message (e.g., \"No changes detected\")"
          }
         }
        },
        "examples": {
         "trialSetup": {
          "summary": "Trial mode enabled",
          "value": {
           "website": {
            "_id": "601733dbcedff50114a599f6",
            "trialEnds": "2026-06-01T00:00:00.000Z",
            "refreshOn": null,
            "websiteLimitsEnabled": true,
            "limits": {
             "credits": 100,
             "emailAccounts": 2
            },
            "remaining": {
             "credits": 100,
             "emailAccounts": 2
            }
           }
          }
         },
         "activeSetup": {
          "summary": "Active mode with billing reset",
          "value": {
           "website": {
            "_id": "601733dbcedff50114a599f6",
            "trialEnds": null,
            "refreshOn": "2026-06-01T00:00:00.000Z",
            "websiteLimitsEnabled": true,
            "limits": {
             "credits": 1000,
             "emailAccounts": 10
            },
            "remaining": {
             "credits": 1000,
             "emailAccounts": 10
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid request - conflicting modes",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        },
        "example": {
         "status": "You cannot have two modes at the same time"
        }
       }
      }
     },
     "404": {
      "description": "Website not found",
      "content": {
       "application/json": {
        "example": {
         "status": "Website not found"
        }
       }
      }
     },
     "405": {
      "description": "Validation error",
      "content": {
       "application/json": {
        "example": {
         "status": [
          {
           "msg": "WebsiteId is required",
           "param": "websiteId"
          }
         ]
        }
       }
      }
     },
     "500": {
      "description": "Internal server error"
     }
    },
    "x-mcp-tool": "set_website_billing_mode"
   }
  },
  "/v3/enrich": {
   "get": {
    "summary": "Company Firmographic Enrichment",
    "description": "Returns comprehensive firmographic data about a company including name, industry, size, revenue, location, and social profiles",
    "tags": [
     "Company Enrichment"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "domain",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The domain you want to enrich (e.g., example.com)",
      "example": "example.com"
     },
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your API Private Key from your account settings"
     }
    ],
    "responses": {
     "200": {
      "description": "Company data successfully retrieved",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Company"
        },
        "example": {
         "_id": "621439bbe045875388d164f6",
         "domain": "example.com",
         "name": "Example Inc",
         "yearFounded": 2020,
         "companyType": "Private Company",
         "sector": "IT",
         "industry": "SaaS",
         "country": "United Kingdom",
         "countryCode": "GB",
         "estimatedAnnualRevenue": "$1M - $4M",
         "employeesRange": "1 - 15",
         "alexaRank": 245070,
         "linkedinPage": "https://linkedin.com/company/example-inc",
         "tags": [],
         "summary": "Example Inc helps businesses identify their website visitors",
         "facebook": null
        }
       }
      }
     },
     "404": {
      "description": "Invalid API key"
     },
     "405": {
      "description": "Limit reached or validation error"
     }
    },
    "x-mcp-tool": "enrich_domain"
   }
  },
  "/v3/warmup/health": {
   "get": {
    "summary": "Get email account health and reputation",
    "description": "Check the health and reputation of an email account based on sending patterns,\nspam reports, and other deliverability factors.\n\n**Health Score:**\n- **100-90 (Excellent)**: Perfect reputation, excellent deliverability\n- **89-70 (Good)**: Good reputation, normal deliverability\n- **69-50 (Fair)**: Moderate reputation, watch closely\n- **49-30 (Poor)**: Poor reputation, take action\n- **29-0 (Critical)**: Critical issues, warmup auto-disabled\n\n**What affects health:**\n- Spam report rate\n- Bounce rate\n- Warmup email volume\n- Account age\n- Sending patterns\n\n**When to check:**\n- Before starting campaigns\n- After spam reports\n- Weekly monitoring\n- After changing settings\n",
    "tags": [
     "Warmup API"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "emailAccountId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email account ID",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "responses": {
     "200": {
      "description": "Health status retrieved successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "health": {
           "type": "object",
           "properties": {
            "reputation": {
             "type": "string",
             "enum": [
              "excellent",
              "good",
              "fair",
              "poor",
              "critical"
             ],
             "description": "Overall reputation level",
             "example": "good"
            },
            "score": {
             "type": "number",
             "description": "Health score (0-100)",
             "minimum": 0,
             "maximum": 100,
             "example": 85
            },
            "spamRate": {
             "type": "string",
             "description": "Spam rate percentage",
             "example": "0.50"
            },
            "bounceRate": {
             "type": "string",
             "description": "Bounce rate percentage",
             "example": "1.20"
            },
            "issues": {
             "type": "array",
             "description": "List of detected issues",
             "items": {
              "type": "string"
             },
             "example": [
              "Low email volume - increase gradually"
             ]
            },
            "totalSent": {
             "type": "number",
             "description": "Total emails sent",
             "example": 1250
            },
            "spamReports": {
             "type": "number",
             "description": "Number of spam reports",
             "example": 6
            },
            "bounces": {
             "type": "number",
             "description": "Number of bounced emails",
             "example": 15
            }
           }
          },
          "recommendations": {
           "type": "array",
           "description": "Actionable recommendations",
           "items": {
            "type": "string"
           },
           "example": [
            "Continue warmup for 2 more weeks",
            "Monitor spam rate closely",
            "Consider reducing daily volume"
           ]
          },
          "warmupStatus": {
           "type": "object",
           "properties": {
            "enabled": {
             "type": "boolean",
             "example": true
            },
            "autoDisabled": {
             "type": "boolean",
             "description": "Whether warmup was auto-disabled due to critical health",
             "example": false
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Validation error"
     },
     "403": {
      "description": "Unauthorized access"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_warmup_health"
   }
  },
  "/v3/warmup/status": {
   "get": {
    "summary": "Get warmup status and statistics",
    "description": "Retrieve comprehensive warmup status including configuration, statistics,\nand progress information for an email account.\n\n**Returned Information:**\n- Current warmup settings (intensity, daily limit)\n- Warmup statistics (emails sent/received)\n- Progress tracking (current week, volume)\n- Last activity timestamps\n- Daily volume tracking\n\n**Use this endpoint to:**\n- Monitor warmup progress\n- Track email sending volume\n- Verify warmup is active\n- Get current configuration\n",
    "tags": [
     "Warmup API"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "emailAccountId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email account ID",
      "example": "507f1f77bcf86cd799439011"
     }
    ],
    "responses": {
     "200": {
      "description": "Status retrieved successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "account": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string",
             "example": "507f1f77bcf86cd799439011"
            },
            "email": {
             "type": "string",
             "example": "user@example.com"
            },
            "connected": {
             "type": "boolean",
             "example": true
            }
           }
          },
          "warmup": {
           "type": "object",
           "properties": {
            "enabled": {
             "type": "boolean",
             "example": true
            },
            "settings": {
             "type": "object",
             "properties": {
              "intensity": {
               "type": "string",
               "example": "normal"
              },
              "dailyLimit": {
               "type": "number",
               "example": 20
              },
              "currentWeek": {
               "type": "number",
               "description": "Current week in warmup schedule",
               "example": 3
              },
              "currentDailyVolume": {
               "type": "number",
               "description": "Actual volume for current day",
               "example": 15
              },
              "rampUpStartDate": {
               "type": "string",
               "format": "date-time"
              }
             }
            },
            "stats": {
             "type": "object",
             "properties": {
              "totalSent": {
               "type": "number",
               "description": "Total warmup emails sent",
               "example": 234
              },
              "totalReceived": {
               "type": "number",
               "description": "Total warmup emails received",
               "example": 198
              },
              "lastSentAt": {
               "type": "string",
               "format": "date-time"
              }
             }
            },
            "lastActivity": {
             "type": "object",
             "properties": {
              "lastWarmupSend": {
               "type": "string",
               "format": "date-time",
               "description": "Last time warmup email was sent"
              },
              "lastWarmupCleanup": {
               "type": "string",
               "format": "date-time",
               "description": "Last time cleanup was performed"
              },
              "lastHealthCheck": {
               "type": "string",
               "format": "date-time",
               "description": "Last health check timestamp"
              }
             }
            },
            "dailyProgress": {
             "type": "object",
             "properties": {
              "current": {
               "type": "number",
               "description": "Emails sent today",
               "example": 15
              },
              "limit": {
               "type": "number",
               "description": "Today's limit based on ramp-up schedule",
               "example": 18
              },
              "percentage": {
               "type": "number",
               "description": "Percentage of daily limit reached",
               "example": 83.33
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Validation error"
     },
     "403": {
      "description": "Unauthorized access"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "get_warmup_stats"
   }
  },
  "/v3/warmup/disable": {
   "post": {
    "summary": "Disable email warmup for an account",
    "description": "Disable email warmup for an email account. This will stop all warmup activities\nincluding sending and receiving warmup emails.\n\n**When to disable:**\n- Account has reached good reputation (typically after 4-6 weeks)\n- Temporarily pausing email sending\n- Troubleshooting deliverability issues\n\n**What happens:**\n- Stops sending warmup emails\n- Stops cleanup activities\n- Preserves warmup statistics\n- Can be re-enabled anytime\n",
    "tags": [
     "Warmup API"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "emailAccountId"
        ],
        "properties": {
         "emailAccountId": {
          "type": "string",
          "description": "The email account ID to disable warmup for",
          "example": "507f1f77bcf86cd799439011"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Warmup disabled successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "message": {
           "type": "string",
           "example": "Email warmup disabled successfully"
          },
          "account": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string",
             "example": "507f1f77bcf86cd799439011"
            },
            "email": {
             "type": "string",
             "example": "user@example.com"
            },
            "warmupEnabled": {
             "type": "boolean",
             "example": false
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Validation error"
     },
     "403": {
      "description": "Unauthorized access"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "toggle_warmup"
   }
  },
  "/v3/warmup/enable": {
   "post": {
    "summary": "Enable email warmup for an account",
    "description": "Enable email warmup to gradually build your email reputation and improve deliverability.\n\n**What is Email Warmup?**\nEmail warmup is the process of gradually increasing your email sending volume to build\na positive sender reputation with ISPs. This helps ensure your emails land in inboxes,\nnot spam folders.\n\n**How it works:**\n- Sends warmup emails between your connected accounts\n- Gradually increases daily volume over time\n- Automatically reads and marks emails as important\n- Cleans up warmup emails to keep inboxes tidy\n- Monitors account health and reputation\n\n**Benefits:**\n- Improved email deliverability\n- Better sender reputation\n- Reduced spam folder placement\n- Automatic reputation management\n",
    "tags": [
     "Warmup API"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "emailAccountId"
        ],
        "properties": {
         "emailAccountId": {
          "type": "string",
          "description": "The email account ID to enable warmup for",
          "example": "507f1f77bcf86cd799439011"
         },
         "intensity": {
          "type": "string",
          "enum": [
           "conservative",
           "normal",
           "aggressive"
          ],
          "description": "Warmup intensity (affects ramp-up speed)",
          "default": "normal",
          "example": "normal"
         },
         "dailyLimit": {
          "type": "number",
          "description": "Maximum warmup emails per day (will gradually ramp up to this)",
          "minimum": 5,
          "maximum": 100,
          "default": 20,
          "example": 20
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Warmup enabled successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "message": {
           "type": "string",
           "example": "Email warmup enabled successfully"
          },
          "account": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string",
             "example": "507f1f77bcf86cd799439011"
            },
            "email": {
             "type": "string",
             "example": "user@example.com"
            },
            "warmupEnabled": {
             "type": "boolean",
             "example": true
            },
            "warmupSettings": {
             "type": "object",
             "properties": {
              "intensity": {
               "type": "string",
               "example": "normal"
              },
              "dailyLimit": {
               "type": "number",
               "example": 20
              },
              "currentWeek": {
               "type": "number",
               "example": 1
              },
              "rampUpStartDate": {
               "type": "string",
               "format": "date-time",
               "example": "2025-01-14T10:00:00.000Z"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Validation error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "error"
          },
          "errors": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Unauthorized access"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "toggle_warmup"
   }
  },
  "/v3/warmup/settings": {
   "put": {
    "summary": "Update email warmup settings",
    "description": "Update warmup configuration for an email account.\n\n**Intensity Levels:**\n- **Conservative**: Slow ramp-up, safest for new domains (5-10 emails/day start)\n- **Normal**: Balanced approach, recommended for most users (10-20 emails/day start)\n- **Aggressive**: Fast ramp-up, for established domains (15-30 emails/day start)\n\n**Daily Limit:**\n- Sets the maximum warmup emails per day\n- Actual volume will ramp up gradually to this limit over weeks\n- Recommended: 20-40 for most users, up to 100 for high-volume senders\n\n**Note:** Changes take effect on the next warmup cycle\n",
    "tags": [
     "Warmup API"
    ],
    "security": [
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "emailAccountId"
        ],
        "properties": {
         "emailAccountId": {
          "type": "string",
          "description": "The email account ID",
          "example": "507f1f77bcf86cd799439011"
         },
         "intensity": {
          "type": "string",
          "enum": [
           "conservative",
           "normal",
           "aggressive"
          ],
          "description": "Warmup intensity level",
          "example": "normal"
         },
         "dailyLimit": {
          "type": "number",
          "description": "Maximum warmup emails per day",
          "minimum": 5,
          "maximum": 100,
          "example": 25
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Settings updated successfully",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "success"
          },
          "message": {
           "type": "string",
           "example": "Warmup settings updated successfully"
          },
          "settings": {
           "type": "object",
           "properties": {
            "intensity": {
             "type": "string",
             "example": "normal"
            },
            "dailyLimit": {
             "type": "number",
             "example": 25
            },
            "currentWeek": {
             "type": "number",
             "example": 3
            },
            "currentDailyVolume": {
             "type": "number",
             "example": 15
            },
            "rampUpStartDate": {
             "type": "string",
             "format": "date-time"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Validation error"
     },
     "403": {
      "description": "Unauthorized access"
     },
     "404": {
      "description": "Email account not found"
     },
     "500": {
      "description": "Server error"
     }
    },
    "x-mcp-tool": "update_warmup_settings"
   }
  },
  "/utilities/verify-website": {
   "post": {
    "summary": "Verify tracking script installation on website",
    "description": "Verifies that the tracking script is properly installed and working on the specified website.\n\nThe website must belong to your account.\n\n**How it checks:**\n1. Loads your page and looks for the tracking script\n2. Checks for real visits from your site in the last 24 hours\n\n**On Success:** the website status becomes \"verified\" and tracking starts.\n\n**On Failure:** the status becomes \"unverified\" (or \"removed\" if it was verified before)\nand the response explains what to check for your installation platform.\n\nThe website URL is updated to the hostname you send.\n",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     },
     {
      "bearerAuth": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "id",
         "websiteURL"
        ],
        "properties": {
         "id": {
          "type": "string",
          "description": "Website ID",
          "example": "601733dbcedff50114a599f6"
         },
         "websiteURL": {
          "type": "string",
          "description": "Website URL to verify (with or without protocol)",
          "example": "example.com"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Website successfully verified",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "verified": {
           "type": "boolean",
           "example": true
          },
          "verificationMethod": {
           "type": "string",
           "description": "How the install was confirmed - the script was found on the page, or real visits were seen",
           "enum": [
            "script",
            "recent-activity"
           ],
           "example": "script"
          }
         }
        },
        "example": {
         "verified": true,
         "verificationMethod": "script"
        }
       }
      }
     },
     "400": {
      "description": "Verification failed - tracking script not detected",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "verified": {
           "type": "boolean",
           "example": false
          },
          "reason": {
           "type": "string",
           "description": "Detailed explanation of why verification failed",
           "example": "The tracking pixel isn't showing up on example.com. Check if you didn't install it to the wrong GTM account or forget to publish the script"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "No credentials sent"
     },
     "404": {
      "description": "Website not found (or not on your account)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "Website not found"
          }
         }
        }
       }
      }
     },
     "405": {
      "description": "Validation error - missing required fields",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "oneOf": [
            {
             "type": "string"
            },
            {
             "type": "array"
            }
           ]
          }
         }
        },
        "examples": {
         "missingId": {
          "value": {
           "status": [
            {
             "msg": "Website Id Is Required",
             "param": "id",
             "location": "body"
            }
           ]
          }
         },
         "missingUrl": {
          "value": {
           "status": "website url is required"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal server error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "Internal Server Error"
          }
         }
        }
       }
      }
     }
    },
    "x-mcp-tool": "verify_website"
   }
  },
  "/v3/leads": {
   "get": {
    "summary": "List website leads",
    "description": "List the identified visitors (leads) of one website whose last visit falls in a date range, newest first: the exact person (exactPerson: name, email, phone, LinkedIn, position), their company, visitor location, pages viewed, visits, UTM data, tags and lead scores. Use get_lead for one lead's full page history, get_lead_comments for notes, export_leads_csv for a full file. websiteId comes from list_websites. Read-only. 50 leads per page; totalLeads, totalPages and currentPage tell you where you are, and paginationCapped=true means narrow the dates or filters to reach every lead. Hidden leads are never listed. When nothing matches, emptyStateReason says why (not_verified, too_restrictive_filters, no_leads_in_date_range, no_leads_ever). Results may be up to 60 seconds old.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website id (24 hex characters) from list_websites."
      },
      "description": "Website id (24 hex characters) from list_websites."
     },
     {
      "in": "query",
      "name": "dateFrom",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Start of the range, matched on the lead's last visit date (whole day). Accepts YYYY-MM-DD, MM/DD/YYYY, a full ISO 8601 timestamp or epoch milliseconds."
      },
      "description": "Start of the range, matched on the lead's last visit date (whole day). Accepts YYYY-MM-DD, MM/DD/YYYY, a full ISO 8601 timestamp or epoch milliseconds."
     },
     {
      "in": "query",
      "name": "dateTo",
      "required": true,
      "schema": {
       "type": "string",
       "description": "End of the range (inclusive, whole day). Same formats as dateFrom."
      },
      "description": "End of the range (inclusive, whole day). Same formats as dateFrom."
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "number",
       "description": "Page number, 1-based, 50 leads per page. Default 1; pages beyond 100 return page 100."
      },
      "description": "Page number, 1-based, 50 leads per page. Default 1; pages beyond 100 return page 100."
     },
     {
      "in": "query",
      "name": "domain",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Free-text search across company name and domain, person names and emails, e.g. \"acme.example\" or \"Jane Smith\"."
      },
      "description": "Free-text search across company name and domain, person names and emails, e.g. \"acme.example\" or \"Jane Smith\"."
     },
     {
      "in": "query",
      "name": "industries",
      "required": false,
      "schema": {
       "type": "string",
       "description": "One industry to match (case-insensitive, partial match), e.g. \"Software\". A single value, not a list."
      },
      "description": "One industry to match (case-insensitive, partial match), e.g. \"Software\". A single value, not a list."
     },
     {
      "in": "query",
      "name": "sectors",
      "required": false,
      "schema": {
       "type": "string",
       "description": "One company sector to match (case-insensitive, partial match)."
      },
      "description": "One company sector to match (case-insensitive, partial match)."
     },
     {
      "in": "query",
      "name": "visitorLocation",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Visitor country as a two-letter ISO code, e.g. \"US\", \"GB\" (case-insensitive)."
      },
      "description": "Visitor country as a two-letter ISO code, e.g. \"US\", \"GB\" (case-insensitive)."
     },
     {
      "in": "query",
      "name": "visitorLocationState",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Visitor state/region, e.g. \"California\". When set without visitorLocation, results are limited to US visitors."
      },
      "description": "Visitor state/region, e.g. \"California\". When set without visitorLocation, results are limited to US visitors."
     },
     {
      "in": "query",
      "name": "tag",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Tag name (not id) to filter by, e.g. \"HOT\"; tag names are stored in upper case and matched case-insensitively. Names come from list_tags."
      },
      "description": "Tag name (not id) to filter by, e.g. \"HOT\"; tag names are stored in upper case and matched case-insensitively. Names come from list_tags."
     },
     {
      "in": "query",
      "name": "visits_lower_bound",
      "required": false,
      "schema": {
       "type": "number",
       "description": "Minimum number of visits (sessions). Default 0."
      },
      "description": "Minimum number of visits (sessions). Default 0."
     },
     {
      "in": "query",
      "name": "visits_upper_bound",
      "required": false,
      "schema": {
       "type": "number",
       "description": "Maximum number of visits (sessions). Leave it out to include every lead, however many visits."
      },
      "description": "Maximum number of visits (sessions). Leave it out to include every lead, however many visits."
     },
     {
      "in": "query",
      "name": "employeesMin",
      "required": false,
      "schema": {
       "type": "number",
       "description": "Smallest company headcount to include, e.g. 10."
      },
      "description": "Smallest company headcount to include, e.g. 10."
     },
     {
      "in": "query",
      "name": "employeesMax",
      "required": false,
      "schema": {
       "type": "number",
       "description": "Largest company headcount to include, e.g. 200."
      },
      "description": "Largest company headcount to include, e.g. 200."
     },
     {
      "in": "query",
      "name": "tech",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Technology the company uses, case-insensitive partial match, e.g. \"HubSpot\", or a JSON array string of several: '[\"HubSpot\",\"Shopify\"]'."
      },
      "description": "Technology the company uses, case-insensitive partial match, e.g. \"HubSpot\", or a JSON array string of several: '[\"HubSpot\",\"Shopify\"]'."
     },
     {
      "in": "query",
      "name": "exactVisitor",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "true to list only leads where the exact person was identified (name and contact details), false for all leads. Leave it out for all leads."
      },
      "description": "true to list only leads where the exact person was identified (name and contact details), false for all leads. Leave it out for all leads."
     },
     {
      "in": "query",
      "name": "utmSource",
      "required": false,
      "schema": {
       "type": "string",
       "description": "JSON array string of [operator, value] pairs, e.g. '[[\"contains\",\"google\"]]'. Operators: contains, not-contains, starts-with, ends-with. A plain string (not JSON) makes the call fail."
      },
      "description": "JSON array string of [operator, value] pairs, e.g. '[[\"contains\",\"google\"]]'. Operators: contains, not-contains, starts-with, ends-with. A plain string (not JSON) makes the call fail."
     },
     {
      "in": "query",
      "name": "utmMedium",
      "required": false,
      "schema": {
       "type": "string",
       "description": "JSON array string of [operator, value] pairs, e.g. '[[\"contains\",\"cpc\"]]'. Same operators as utmSource."
      },
      "description": "JSON array string of [operator, value] pairs, e.g. '[[\"contains\",\"cpc\"]]'. Same operators as utmSource."
     },
     {
      "in": "query",
      "name": "pageVisited",
      "required": false,
      "schema": {
       "type": "string",
       "description": "JSON array string of [operator, value] pairs matched against visited page paths, e.g. '[[\"contains\",\"pricing\"]]' or '[[\"not-contains\",\"careers\"]]'. Operators: contains, not-contains, starts-with (value without the leading slash), ends-with. A plain string makes the call fail."
      },
      "description": "JSON array string of [operator, value] pairs matched against visited page paths, e.g. '[[\"contains\",\"pricing\"]]' or '[[\"not-contains\",\"careers\"]]'. Operators: contains, not-contains, starts-with (value without the leading slash), ends-with. A plain string makes the call fail."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_leads"
   }
  },
  "/v3/leads/{leadId}": {
   "get": {
    "summary": "Get lead details",
    "description": "Get one lead's company profile and visit history: company (name, domain, industry, sector, type, founded year, location, employee range, estimated revenue, LinkedIn/Facebook pages), tags, UTM values, pageVisits[] (url, path, timeSpentMs/timeSpentSeconds, visitCount, sorted by time spent) and summary (totalVisits, lastVisit, totalTimeOnSiteMs, referrer), plus CRM record ids when the lead was pushed. leadId is the _id of a row from get_leads. exactPerson is the identified person (firstName, lastName, fullName, businessEmail, personalEmail, email, phone, position, linkedinUrl), or null when only the company is known; exactPersonType says Exact Visitor or Suggested Contact. Use get_lead_ai_summary for a short written read of the visit, get_lead_automation_history for automation runs. Read-only.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead id (the _id of a row returned by get_leads)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_lead"
   }
  },
  "/v3/leads/{leadId}/summary": {
   "get": {
    "summary": "AI visit summary for a lead",
    "description": "Get a short AI-written summary (about 50 words) of what this visitor did on your website, based on their company, country and the pages they viewed, ending with one verdict: 'Ready to Buy', 'Research' or 'Just Browsing'. Returned as aISummary (text, may contain <br> tags). leadId comes from get_leads. Use get_lead for the raw page-visit data. Generated fresh on each call, so wording can differ between calls. Changes nothing in the account.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead id (the _id of a row returned by get_leads)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_lead_ai_summary"
   }
  },
  "/v3/leads/{leadId}/automation-history": {
   "get": {
    "summary": "Lead automation history",
    "description": "List every automation run recorded for one lead, newest first, as automationLogs[] with status, message (the result or error text), automation (the automation id, see list_automations) and executedAt. Use it to check whether a lead reached Slack, a CRM, a webhook or an email campaign and why a run failed. leadId comes from get_leads. To run automations again use retrigger_automations or rerun_automation_for_lead. Read-only.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead id (the _id of a row returned by get_leads)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_lead_automation_history"
   }
  },
  "/v3/leads/{leadId}/hide": {
   "post": {
    "summary": "Hide or unhide a lead",
    "description": "Hide a lead from the leads list (hide=true, the default) or bring a hidden lead back (hide=false). Hidden leads no longer appear in get_leads. Hiding is reversible and keeps the lead's data; it does not give back the credit the lead used. To remove a lead for good use delete_lead. leadId comes from get_leads. Returns status 'Successful'; hiding an already hidden lead returns an error 'Lead is already hidden.'",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead id (the _id of a row returned by get_leads)."
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "hide": {
          "type": "boolean",
          "description": "true (default) hides the lead; false makes a hidden lead visible again."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "hide_lead"
   }
  },
  "/v3/leads/delete": {
   "post": {
    "summary": "Delete leads permanently",
    "description": "Permanently delete one or more leads. This cannot be undone, the credits they used are not given back, and the companies of the deleted leads are added to the website's blocked company domains (the Exclude list in Qualify), so new leads from those companies stop appearing. To only take a lead off the list, use hide_lead instead. leadIds come from get_leads. Confirm with the user before calling. Returns deletedCount, the number of leads actually deleted (leads outside your account are skipped).",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "leadIds"
        ],
        "properties": {
         "leadIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Array of lead ids (the _id values from get_leads), e.g. [\"66f1...\", \"66f2...\"]. Use leads from one website per call."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "delete_lead"
   }
  },
  "/v3/leads/export": {
   "post": {
    "summary": "Export leads to CSV",
    "description": "Queue a CSV export of a website's leads whose last visit falls in the date range. The file is built in the background: the user gets an email with the download link and it is listed under Downloads in the dashboard for 30 days; this tool does not return the file itself. Each finished export uses one of the plan's CSV downloads; it fails when the plan has no CSV downloads or none are left. websiteId from list_websites. For leads you want to read in the conversation, use get_leads. Returns status 'queued' and job (id, status, stage, progress, rowCount, fileName, expiresAt).",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "dateFrom",
         "dateTo"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website id (24 hex characters) from list_websites."
         },
         "dateFrom": {
          "type": "string",
          "description": "Start of the range (last visit date). Accepts YYYY-MM-DD, MM/DD/YYYY, ISO 8601 or epoch milliseconds."
         },
         "dateTo": {
          "type": "string",
          "description": "End of the range, inclusive. Same formats as dateFrom."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "export_leads_csv"
   }
  },
  "/v3/tags": {
   "get": {
    "summary": "List tags",
    "description": "List the tags available on a website: the website's own tags plus the built-in default tags. Each tag has _id (use it as tagId in tag_lead / remove_tags_from_lead), text (the name, in upper case; use it for the tag filter in get_leads) and colour. websiteId comes from list_websites. Create a new tag with create_tag. Returns { tags: [...] }. Read-only.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website id (24 hex characters) from list_websites."
      },
      "description": "Website id (24 hex characters) from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_tags"
   },
   "post": {
    "summary": "Create a tag",
    "description": "Create a new tag on a website so you can label leads with tag_lead. The name is stored in upper case and must be unique on the website (a duplicate returns 'Tag text already exist'). websiteId comes from list_websites. Check list_tags first to reuse an existing tag. Returns status 'Successful' and tagId.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "name"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website id (24 hex characters) from list_websites."
         },
         "name": {
          "type": "string",
          "description": "Tag name, e.g. \"Hot account\" (saved as \"HOT ACCOUNT\")."
         },
         "color": {
          "type": "string",
          "description": "Hex colour as #RRGGBB, e.g. \"#059669\". Default \"#1E4EFF\". Any other format is refused."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "create_tag"
   }
  },
  "/v3/leads/{leadId}/tags/{tagId}": {
   "post": {
    "summary": "Tag a lead",
    "description": "Attach an existing tag to a lead. Get the tagId from list_tags, or make a new tag with create_tag first; leadId comes from get_leads. Adding a tag starts any of the website's automations that trigger on a tag being added, which can push the lead to a CRM, Slack, a webhook or an email campaign. Fails with 'Tag Id already exist' when the lead already has the tag. Remove a tag with remove_tags_from_lead. Returns status 'Successful'.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead id (the _id of a row returned by get_leads)."
     },
     {
      "in": "path",
      "name": "tagId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Tag id (24 hex characters) from list_tags or the tagId returned by create_tag."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "tag_lead"
   },
   "delete": {
    "summary": "Remove a tag from a lead",
    "description": "Remove one tag from a lead. The tag itself stays available for other leads. leadId comes from get_leads; tagId comes from list_tags (or the lead's tags in get_lead). Add a tag with tag_lead. Returns status 'Successful', or 'Failed' (404) when nothing was removed.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead id (the _id of a row returned by get_leads)."
     },
     {
      "in": "path",
      "name": "tagId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Id of the tag to remove (from list_tags)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "remove_tags_from_lead"
   }
  },
  "/v3/leads/{leadId}/comments": {
   "get": {
    "summary": "Get lead comments",
    "description": "Get the comments (team notes) on a lead. Each comment has _id (commentId for update_lead_comment / delete_lead_comment), content, the author's firstName, lastName, userEmail, role and picture, and createdAt. leadId comes from get_leads. Add one with add_lead_comment. Returns { comments: [...] }. Read-only.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead id (the _id of a row returned by get_leads)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_lead_comments"
   },
   "post": {
    "summary": "Add a comment to a lead",
    "description": "Add a note to a lead, visible to everyone on the account's team, signed with the connected user's name. leadId comes from get_leads. Read existing notes with get_lead_comments; edit with update_lead_comment. Each call adds a new comment. Returns status 'Successful' and commentId.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead id (the _id of a row returned by get_leads)."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "content"
        ],
        "properties": {
         "content": {
          "type": "string",
          "description": "The comment text (plain text)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "add_lead_comment"
   }
  },
  "/v3/comments/{commentId}": {
   "put": {
    "summary": "Edit a lead comment",
    "description": "Replace the text of an existing lead comment. Only the user who wrote the comment can edit it; others get 'You do not have permission'. The previous text is not kept. commentId is the _id from get_lead_comments. Returns status 'Successful'.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "commentId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Comment id (the _id from get_lead_comments)."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "content"
        ],
        "properties": {
         "content": {
          "type": "string",
          "description": "The new comment text; replaces the old text entirely."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_lead_comment"
   },
   "delete": {
    "summary": "Delete a lead comment",
    "description": "Permanently delete a comment from a lead. Only the user who wrote the comment can delete it; others get 'You do not have permission'. commentId is the _id from get_lead_comments. Confirm with the user before calling. Returns status 'Successful'.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "commentId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Comment id (the _id from get_lead_comments)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "delete_lead_comment"
   }
  },
  "/v3/recordings": {
   "get": {
    "summary": "List session recordings",
    "description": "List session recordings (replays of what a visitor did on your website), newest first, up to 100. Pass clientId to list a website's recordings, or email to list one identified visitor's recordings. Each recording has session_id, client_id, lead_email, started_at, ended_at, duration_ms, page_count, first_page and finalized. Recordings exist only when session recording is enabled for the website. clientId comes from get_website or get_tracking_pixel; the email is the lead's exactPerson email from get_leads. To watch one, pass its session_id and client_id to get_recording_url. At least one of clientId or email is required. Read-only.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "clientId",
      "required": false,
      "schema": {
       "type": "string",
       "description": "The website's clientId (16-32 characters) from get_website or get_tracking_pixel."
      },
      "description": "The website's clientId (16-32 characters) from get_website or get_tracking_pixel."
     },
     {
      "in": "query",
      "name": "email",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Email address of an identified visitor (from get_leads). When given, the list is the recordings for this email."
      },
      "description": "Email address of an identified visitor (from get_leads). When given, the list is the recordings for this email."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_lead_recordings"
   }
  },
  "/v3/recordings/{sessionId}/url": {
   "get": {
    "summary": "Get recording playback link",
    "description": "Get a signed playback link for one session recording. The link expires after 5 minutes, so open or share it right away and request a new one later. sessionId is session_id and clientId is client_id from get_lead_recordings (clientId also from get_website). The session must be among the website's 100 most recent recordings, otherwise access is refused. Returns url. Read-only.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "sessionId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Recording id (session_id from get_lead_recordings), 16-64 characters."
     },
     {
      "in": "query",
      "name": "clientId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "The website's clientId that owns the recording (client_id from get_lead_recordings, or from get_website)."
      },
      "description": "The website's clientId that owns the recording (client_id from get_lead_recordings, or from get_website)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_recording_url"
   }
  },
  "/v3/prospector/companies/search": {
   "post": {
    "summary": "Search companies",
    "description": "Searches the company database by name or domain keyword, industry, HQ country, headcount, revenue and technologies. Use it to build company target lists. For people at those companies use search_people. For the companies visiting your own website use get_leads. Searching uses no credits, but each search that returns results counts against the plan's search limit, and the call returns 400 ('You have reached your limit.' or 'You have no credit.') when the account is out. It can return 503 provider_unavailable; retry after a minute. Returns { total, companies[], note }. Rows have employees (real headcount), employeesRange, country, countryCode (ISO alpha-2), revenueRange (bounds null when unknown), industries and industry (the one your filter matched). When you set employeesMin or employeesMax, every row is inside the range, and total may be an estimate (totalIsEstimate).",
    "tags": [
     "Prospector"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "query"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites. The search runs under this website."
         },
         "query": {
          "type": "object",
          "description": "Search filters as one flat object. Every field is optional; combine them to narrow the search.",
          "properties": {
           "keywords": {
            "type": "string",
            "description": "Company name or domain keyword, e.g. \"acme\" or \"acme.example\"."
           },
           "industries": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "description": "Industry names, e.g. [\"Marketing and Advertising\", \"Computer Software\"]."
           },
           "locations": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "description": "Company HQ countries by full name, e.g. [\"United States\", \"Germany\"]. Continents (\"Europe\", \"Asia\") are also accepted."
           },
           "employeesMin": {
            "type": "number",
            "description": "Minimum headcount (whole number). Applied to the real employee count."
           },
           "employeesMax": {
            "type": "number",
            "description": "Maximum headcount (whole number). Applied to the real employee count."
           },
           "revenueMin": {
            "type": "number",
            "description": "Minimum annual revenue (number). Defaults to 0."
           },
           "revenueMax": {
            "type": "number",
            "description": "Maximum annual revenue (number)."
           },
           "technologies": {
            "type": "array",
            "items": {
             "type": "string"
            },
            "description": "Technologies the company uses, e.g. [\"HubSpot\", \"Shopify\"]."
           },
           "page": {
            "type": "number",
            "description": "Page number, starting at 1. Default 1."
           },
           "count": {
            "type": "number",
            "description": "Results per page. Default 25."
           }
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "search_companies"
   }
  },
  "/v3/prospector/people/find-email": {
   "post": {
    "summary": "Find contact email",
    "description": "Looks for a business email for one search_people contact by trying likely address patterns at their company and verifying each one. Use it only when reveal_contact found no email for that person. depth 'popular' tries the common patterns and costs 50 credits. 'deep' tries more patterns and costs 100 credits. Credits are charged whether or not an address is found. Confirm the cost with the user before calling.",
    "tags": [
     "Prospector"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "profileId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites (the same one used for search_people)."
         },
         "profileId": {
          "type": "string",
          "description": "profileId from a search_people row."
         },
         "depth": {
          "type": "string",
          "enum": [
           "popular",
           "deep"
          ],
          "description": "'popular' (default, 50 credits) or 'deep' (100 credits)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "find_contact_email"
   }
  },
  "/v3/ai-scouts": {
   "get": {
    "summary": "List AI Scouts",
    "description": "Lists the AI Scouts of one website: name, description, status (running or paused), people per day, minimum fit, the sources it reads (readsFrom) and how many people each delivered, plus the website's daily AI Scout limit. Free. Use it to find a scoutId.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_ai_scouts"
   },
   "post": {
    "summary": "Create an AI Scout",
    "description": "Creates an AI Scout and runs it right away. Every day it reads its sources (Google, YouTube, review sites), finds the people behind them, scores how well they fit and adds those above the minimum fit as leads under Leads › AI Scout, 1 credit per lead, up to the people per day and the website's daily limit. Not on LTD plans.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "description"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "name": {
          "type": "string",
          "description": "Optional. A short name; made from the description when left out."
         },
         "description": {
          "type": "string",
          "description": "Who to find, in a sentence or two: roles, industries, company size, where they talk (podcasts, YouTube, review sites)."
         },
         "perDay": {
          "type": "number",
          "enum": [
           10,
           25,
           50,
           100
          ],
          "description": "People per day to deliver: 10, 25, 50 or 100."
         },
         "minFit": {
          "type": "number",
          "minimum": 10,
          "maximum": 95,
          "description": "Minimum fit score (10-95, default 70): people below it are skipped."
         },
         "sources": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "kind": {
             "type": "string",
             "enum": [
              "google",
              "youtube_search",
              "youtube_playlist",
              "youtube_creators",
              "g2_category"
             ],
             "description": "google, youtube_search, youtube_playlist, youtube_creators or g2_category."
            },
            "ref": {
             "type": "string",
             "description": "The search words, the playlist or channel link, or the G2 category link."
            },
            "label": {
             "type": "string",
             "description": "Optional. How the source is shown in the dashboard."
            },
            "active": {
             "type": "boolean",
             "description": "false to keep the source but stop reading it."
            }
           },
           "required": [
            "kind",
            "ref"
           ]
          },
          "description": "Optional. Where the scout reads: Google searches, YouTube searches, playlists or creators, G2 categories. Made from the description when left out; get them first with plan_ai_scout."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "create_ai_scout"
   }
  },
  "/v3/ai-scouts/plan": {
   "post": {
    "summary": "Plan an AI Scout",
    "description": "Turns a description of who to find (\"founders of B2B SaaS companies who talk about outbound on podcasts\") into a scout name and the sources it would read. Nothing is saved or charged. Show it to the user, then pass it to create_ai_scout. Returns 400 when the description is too short.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "description"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "description": {
          "type": "string",
          "description": "Who to find, in a sentence or two."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "plan_ai_scout"
   }
  },
  "/v3/ai-scouts/daily-limit": {
   "put": {
    "summary": "Set the AI Scout daily limit",
    "description": "Sets how many AI Scout leads (= credits) the website may receive per day across all its scouts, 1 to 500. Returns the limit with how many were used and are left today.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "dailyLimit"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "dailyLimit": {
          "type": "number",
          "minimum": 1,
          "maximum": 500,
          "description": "Leads per day across all scouts, 1-500."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_ai_scout_daily_limit"
   }
  },
  "/v3/ai-scouts/{scoutId}": {
   "get": {
    "summary": "Get an AI Scout",
    "description": "One AI Scout with its sources, how many people it found, qualified and delivered, and the latest people it picked with why they fit. Free.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "scoutId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "AI Scout ID from list_ai_scouts."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_ai_scout"
   },
   "patch": {
    "summary": "Update an AI Scout",
    "description": "Changes an AI Scout's name, description, people per day, minimum fit or sources. Only the fields you pass change.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "scoutId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "AI Scout ID from list_ai_scouts."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "name": {
          "type": "string",
          "description": "A short name; made from the description when left out."
         },
         "description": {
          "type": "string",
          "description": "Who to find, in a sentence or two: roles, industries, company size, where they talk (podcasts, YouTube, review sites)."
         },
         "perDay": {
          "type": "number",
          "enum": [
           10,
           25,
           50,
           100
          ],
          "description": "People per day to deliver: 10, 25, 50 or 100."
         },
         "minFit": {
          "type": "number",
          "minimum": 10,
          "maximum": 95,
          "description": "Minimum fit score (10-95, default 70): people below it are skipped."
         },
         "sources": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "kind": {
             "type": "string",
             "enum": [
              "google",
              "youtube_search",
              "youtube_playlist",
              "youtube_creators",
              "g2_category"
             ],
             "description": "google, youtube_search, youtube_playlist, youtube_creators or g2_category."
            },
            "ref": {
             "type": "string",
             "description": "The search words, the playlist or channel link, or the G2 category link."
            },
            "label": {
             "type": "string",
             "description": "Optional. How the source is shown in the dashboard."
            },
            "active": {
             "type": "boolean",
             "description": "false to keep the source but stop reading it."
            }
           },
           "required": [
            "kind",
            "ref"
           ]
          },
          "description": "Where the scout reads: Google searches, YouTube searches, playlists or creators, G2 categories. Made from the description when left out; get them first with plan_ai_scout."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_ai_scout"
   },
   "delete": {
    "summary": "Delete an AI Scout",
    "description": "Deletes an AI Scout: it stops for good and is removed from the list. The leads it already delivered stay in Leads.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "scoutId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "AI Scout ID from list_ai_scouts."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "delete_ai_scout"
   }
  },
  "/v3/ai-scouts/{scoutId}/pause": {
   "post": {
    "summary": "Pause an AI Scout",
    "description": "Pauses an AI Scout: no more people are delivered until it is resumed. The leads it already delivered stay.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "scoutId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "AI Scout ID from list_ai_scouts."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "pause_ai_scout"
   }
  },
  "/v3/ai-scouts/{scoutId}/resume": {
   "post": {
    "summary": "Resume an AI Scout",
    "description": "Resumes a paused AI Scout. It delivers again from its next daily run, 1 credit per lead.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "scoutId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "AI Scout ID from list_ai_scouts."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "resume_ai_scout"
   }
  },
  "/v3/ai-scouts/{scoutId}/run": {
   "post": {
    "summary": "Run an AI Scout now",
    "description": "Starts a run of an AI Scout now instead of waiting for its daily run. New people appear under Leads › AI Scout within minutes, 1 credit per lead, within the daily limits.",
    "tags": [
     "AI Scout"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "scoutId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "AI Scout ID from list_ai_scouts."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "run_ai_scout"
   }
  },
  "/v3/web-scraping": {
   "get": {
    "summary": "Get Web Scraping keywords",
    "description": "Web Scraping looks for your keywords on websites across the open web — in the page text or in the scripts a site loads — and adds the companies that match, with their people, as leads under Leads › Web Scraping. A keyword can be a phrase your buyers write about themselves (\"ships worldwide\") or a domain such as a competitor's tracker (competitor-tool.com). Returns whether it is on, the keywords and their match mode, the daily limit, contacts-only, leads today and in total, and leads per keyword over the last 7 days. Free.",
    "tags": [
     "Web Scraping"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_web_scraping"
   },
   "put": {
    "summary": "Update Web Scraping keywords",
    "description": "Turns Web Scraping on or off and sets its keywords (exact or fuzzy match, each can be paused), the daily limit (1-500 leads, 1 credit each) and contacts-only (only companies where we found a person). Passing keywords replaces the whole list: get_web_scraping first and send the full list. Not on LTD plans.",
    "tags": [
     "Web Scraping"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "enabled": {
          "type": "boolean",
          "description": "On or off."
         },
         "keywords": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "value": {
             "type": "string",
             "description": "A phrase your buyers write on their own site, or a domain that appears in a script URL."
            },
            "matchMode": {
             "type": "string",
             "enum": [
              "exact",
              "fuzzy"
             ],
             "description": "exact (the phrase as written) or fuzzy (close variants too)."
            },
            "paused": {
             "type": "boolean",
             "description": "true to keep the keyword but stop searching for it."
            }
           },
           "required": [
            "value"
           ]
          },
          "description": "The full keyword list: value (a phrase your buyers write, or a domain in a script such as a competitor's tracker), matchMode (exact or fuzzy), paused."
         },
         "dailyLimit": {
          "type": "number",
          "minimum": 1,
          "maximum": 500,
          "description": "Leads per day, 1-500."
         },
         "contactsOnly": {
          "type": "boolean",
          "description": "Only add companies where a person was found."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_web_scraping"
   }
  },
  "/v3/web-scraping/keyword-suggestions": {
   "post": {
    "summary": "Suggest Web Scraping keywords",
    "description": "Keyword ideas for Web Scraping: phrases the website's buyers would write about themselves on their own sites (never the seller's own category words). Suggestions are cached; regenerate=true asks for new ones. Nothing is saved: add the ones the user picks with update_web_scraping. Not on LTD plans.",
    "tags": [
     "Web Scraping"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "regenerate": {
          "type": "boolean",
          "description": "Ask for new ideas instead of the cached ones."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "suggest_web_scraping_keywords"
   }
  },
  "/v3/tags/{tagId}": {
   "put": {
    "summary": "Update a tag",
    "description": "Renames a tag or changes its colour on this website. Every lead that has the tag keeps it. Pass only what changes. tagId comes from list_tags.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "tagId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Tag ID from list_tags."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "name": {
          "type": "string",
          "description": "New tag name."
         },
         "color": {
          "type": "string",
          "description": "New colour as a hex code, e.g. #1E4EFF."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_tag"
   },
   "delete": {
    "summary": "Delete a tag",
    "description": "Deletes a tag from this website; it is removed from every lead that had it. The leads themselves stay. tagId comes from list_tags.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "tagId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Tag ID from list_tags."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "delete_tag"
   }
  },
  "/v3/leads/{leadId}/notes": {
   "put": {
    "summary": "Update lead notes",
    "description": "Sets the free-form notes on a lead, replacing what was there; an empty string clears them. For a threaded discussion use add_lead_comment instead.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead ID from get_leads."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "notes": {
          "type": "string",
          "description": "The full notes text; empty clears them."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_lead_notes"
   }
  },
  "/v3/leads/{leadId}/company-people": {
   "get": {
    "summary": "Get people at the lead's company",
    "description": "Other people who work at the company of a lead (name, job title, department, seniority, LinkedIn), optionally only one department, to find the right contact when the visitor was not the buyer. Free.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "leadId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Lead ID from get_leads."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     },
     {
      "in": "query",
      "name": "department",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Only this department, e.g. Sales Department."
      },
      "description": "Only this department, e.g. Sales Department."
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 1,
       "description": "Page of results, from 1."
      },
      "description": "Page of results, from 1."
     },
     {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 1,
       "maximum": 100,
       "description": "People per page (1-100)."
      },
      "description": "People per page (1-100)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_company_people"
   }
  },
  "/v3/lists/{listId}/name": {
   "put": {
    "summary": "Rename a list",
    "description": "Renames a contact or company list of this website. Its contacts or companies do not change. listId comes from list_lists.",
    "tags": [
     "Lists"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "listId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "List ID from list_lists."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "listType",
         "name"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "listType": {
          "type": "string",
          "enum": [
           "contact",
           "company"
          ],
          "description": "contact or company."
         },
         "name": {
          "type": "string",
          "description": "The new name."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "rename_list"
   }
  },
  "/v3/automations/{automationId}/runs": {
   "get": {
    "summary": "Get an automation's runs",
    "description": "The runs of one automation, newest first: which lead each run handled, when, and whether it succeeded (and why not). Use it to check that an automation really sent leads to Slack, your CRM or a webhook. Free.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "automationId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Automation ID from list_automations."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     },
     {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 1,
       "maximum": 200,
       "description": "Runs to return (1-200)."
      },
      "description": "Runs to return (1-200)."
     },
     {
      "in": "query",
      "name": "skip",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 0,
       "description": "Runs to skip, for paging."
      },
      "description": "Runs to skip, for paging."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_automation_runs"
   }
  },
  "/v3/lead-scoring/ai-generate": {
   "post": {
    "summary": "AI-generate a scoring model",
    "description": "Have AI build a lead scoring model from the website's own pages (it reads the site to infer the ideal customer) and save it as 'ICP Score - AI Generated'. Only one such model can exist per website; a second call is refused with 'AI Lead scoring model has already been generated!'. Pass description to steer it: the ideal customer as the user describes it takes priority over what the site suggests. For exact rules use create_lead_scoring_model instead. websiteId comes from list_websites. Returns result (the new model with _id and its rules).",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "description"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website id (24 hex characters) from list_websites."
         },
         "description": {
          "type": "string",
          "description": "Plain-English description of the ideal customer, e.g. \"US software companies with 50-500 staff selling to finance teams\". Steers the generated rules."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "ai_generate_scoring_model"
   }
  },
  "/v3/lead-scoring/{modelId}": {
   "put": {
    "summary": "Update a lead scoring model",
    "description": "Change a lead scoring model's name, on/off state and/or rules. Every criterion key you pass in criteria replaces that criterion's whole rule list; criteria you leave out are unchanged, so read the model first with get_lead_scoring_model and send the full list for each criterion you change. Rule changes on a live model queue a re-score of recent leads in the background (rescoring.status 'queued'); removing a domain from companyDomain exclusions also unblocks it. Changes are recorded in the model's history. modelId from list_lead_scoring_models. Returns status 'success', the new revision and a summary of changes.",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "modelId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Scoring model id from list_lead_scoring_models."
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "New model name."
         },
         "active": {
          "type": "boolean",
          "description": "true turns the model on (it scores leads), false turns it off."
         },
         "criteria": {
          "type": "object",
          "description": "Object keyed by criterion name, each value a full list of rules in the shape get_lead_scoring_model returns, e.g. {\"industry\":[{\"values\":[\"Software\"],\"score\":8,\"filter\":\"any\"}],\"revenue\":[{\"values\":{\"min\":1000000,\"max\":null},\"score\":5}]}. score is -10..10; filter is 'any', 'only' or 'excl'. Numeric criteria (revenue, numberVisits, duration, alexaRank) take {min,max}; recency takes {days}; others take a list of strings. Empty or duplicate rules are dropped."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_lead_scoring_model"
   }
  },
  "/v3/lead-scoring/recalculate": {
   "post": {
    "summary": "Re-score leads",
    "description": "Re-run lead scoring for specific leads against the website's current scoring models, and answer any AI qualification questions those leads do not have an answer for yet. Use it after changing a model with update_lead_scoring_model when you want selected leads updated now. AI questions count against the plan's monthly AI qualification allowance; leads that already have every answer are re-scored without any AI use (counted in aiSkipped). websiteId from list_websites, leadIds from get_leads; leadIds must contain at least one id (an empty list is refused). Leads are processed one by one, so keep batches small. Returns processed, failed, total, aiSkipped and updatedLeads[] (_id, scores, aiQualification).",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "leadIds"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website id (24 hex characters) from list_websites."
         },
         "leadIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Array of lead ids from get_leads to re-score. At least one id."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "recalculate_lead_scores"
   }
  },
  "/v3/icp": {
   "get": {
    "summary": "Get ideal customer profile",
    "description": "Returns the ideal customer profile (ICP) saved for a website: the companies the user wants to reach. Read it before update_icp, or when explaining why a lead is or is not a good fit. Lead scoring rules are separate: use list_lead_scoring_models. Returns employeeLowerBound / employeeUpperBound, revenueLowerBound / revenueUpperBound, location[], role[], industries[], sector[], the priority values for each criterion and any AI qualification questions. Returns null when no ICP is saved.",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_icp"
   },
   "put": {
    "summary": "Update ideal customer profile",
    "description": "Changes a website's ideal customer profile: target industries, sectors, HQ locations, headcount and revenue ranges. Only the fields you pass change; the rest keep their saved values. A list you pass replaces the saved list, so read get_icp first and send the full list you want. Costs nothing and only changes settings inside the account. Returns the saved ICP.",
    "tags": [
     "Lead Scoring"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "industries": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Target industries; replaces the saved list, e.g. [\"Computer Software\"]."
         },
         "employeesMin": {
          "type": "number",
          "description": "Smallest company headcount to target (whole number)."
         },
         "employeesMax": {
          "type": "number",
          "description": "Largest company headcount to target (whole number)."
         },
         "locations": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Target countries; replaces the saved list, e.g. [\"United States\", \"United Kingdom\"]."
         },
         "sectors": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Target sectors; replaces the saved list."
         },
         "revenueMin": {
          "type": "number",
          "description": "Smallest annual revenue to target (number)."
         },
         "revenueMax": {
          "type": "number",
          "description": "Largest annual revenue to target (number)."
         },
         "excludedDomains": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Domains to exclude. Not saved today (see notes); use add_to_domain_blacklist to exclude domains."
         },
         "excludedIndustries": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Industries to exclude. Not saved today (see notes)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_icp"
   }
  },
  "/v3/inbox": {
   "get": {
    "summary": "List outreach inbox",
    "description": "List prospects from the outreach master inbox of a website across all campaigns, most recent activity first. Default status inbox shows prospects who replied (including out-of-office) and are not archived. Use get_email_thread to read one conversation, reply_to_prospect to answer and archive_email to clear it. websiteId comes from list_websites. Returns prospects[] (each with _id, recipientEmail, firstName, lastName, status, the sending emailAccount, emailCampaign and emails[]; each emails[].emailId is the emailId the other inbox tools take), totalProspects, currentPage and totalPages.",
    "tags": [
     "Inbox"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website id from list_websites."
      },
      "description": "Website id from list_websites."
     },
     {
      "in": "query",
      "name": "status",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Which view to list: inbox (replied, not archived; default), contacted (an email was sent), scheduled (an email is due and not sent yet) or archived."
      },
      "description": "Which view to list: inbox (replied, not archived; default), contacted (an email was sent), scheduled (an email is due and not sent yet) or archived."
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "number",
       "description": "Page number, starting at 1. Default 1."
      },
      "description": "Page number, starting at 1. Default 1."
     },
     {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
       "type": "number",
       "description": "Prospects per page. Default 20."
      },
      "description": "Prospects per page. Default 20."
     },
     {
      "in": "query",
      "name": "searchQuery",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Optional case-insensitive text matched against first name, last name and email address."
      },
      "description": "Optional case-insensitive text matched against first name, last name and email address."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_inbox_emails"
   }
  },
  "/v3/inbox/{emailId}": {
   "get": {
    "summary": "Read email thread",
    "description": "Read one outreach email conversation: the email that was sent (subject, send time, opens) and every reply under it, incoming and outgoing. emailId comes from get_inbox_emails (prospects[].emails[].emailId). Returns prospectEmail with the prospect's _id, name and recipientEmail, email (the sent email with its replies[]) and emailAccount (the mailbox that sent it). Use reply_to_prospect to answer.",
    "tags": [
     "Inbox"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "emailId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email id from get_inbox_emails, prospects[].emails[].emailId (not the prospect _id)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_email_thread"
   }
  },
  "/v3/inbox/{emailId}/reply": {
   "post": {
    "summary": "Reply to prospect",
    "description": "Send a reply email to a prospect in an existing outreach conversation. It is sent right away from the mailbox that sent the original email, with the subject \"Re: <original subject>\", and is added to the thread. Confirm the text with the user before calling: it is real email and cannot be recalled. emailId comes from get_inbox_emails (prospects[].emails[].emailId); read the conversation first with get_email_thread. Merge fields such as {{ first_name | there }} are filled in. Returns a success status, or an error saying the mailbox could not be reached (504), its login failed (401) or delivery failed (502).",
    "tags": [
     "Inbox"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "emailId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email id from get_inbox_emails, prospects[].emails[].emailId."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "body"
        ],
        "properties": {
         "body": {
          "type": "string",
          "description": "The reply text. Merge fields with a fallback, e.g. {{ first_name | there }}, are filled in."
         },
         "emailAccountId": {
          "type": "string",
          "description": "Not used: the reply always goes from the mailbox that sent the original email."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "reply_to_prospect"
   }
  },
  "/v3/inbox/{emailId}/archive": {
   "post": {
    "summary": "Archive inbox email",
    "description": "Archive one email conversation in the outreach master inbox so it leaves the inbox view; it stays visible with get_inbox_emails status archived. It changes nothing for the prospect and sends nothing. emailId comes from get_inbox_emails (prospects[].emails[].emailId). Returns a success status.",
    "tags": [
     "Inbox"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "emailId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Email id from get_inbox_emails, prospects[].emails[].emailId."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "archive_email"
   }
  },
  "/v3/linkedin/accounts": {
   "get": {
    "summary": "List LinkedIn accounts",
    "description": "List the LinkedIn accounts connected to a website through the browser extension, newest first. Use list_linkedin_campaigns for the LinkedIn connection-request campaigns themselves. websiteId comes from list_websites. Returns accounts[]; per account read status (unpaired or paired) and connectionState: connected (extension seen in the last 6 hours), stale (seen before that), never_seen, cooldown (paused for a while by LinkedIn limits), unpaired. Not available with a website-scoped key.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website id from list_websites."
      },
      "description": "Website id from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_linkedin_accounts"
   }
  },
  "/v3/linkedin/campaigns": {
   "get": {
    "summary": "List LinkedIn campaigns",
    "description": "List the LinkedIn connection-request campaigns of a website, newest first, with each campaign's status (draft, active, paused, completed), stats and progress ({ pct, terminalCount, total }). The prospect list itself is not included. Use list_linkedin_accounts for the LinkedIn accounts that send them and list_campaigns for email campaigns. websiteId comes from list_websites and is required even though the schema marks it optional. Returns campaigns[].",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Website id from list_websites. Required by the server."
      },
      "description": "Website id from list_websites. Required by the server."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_linkedin_campaigns"
   }
  },
  "/v3/outreach-domains": {
   "get": {
    "summary": "List outreach domains",
    "description": "List every outreach domain of a website, picked or bought, with its status, setup progress, mailboxes and expiry. Use get_domain_setup_status for a compact progress view after a purchase. websiteId comes from list_websites. Per domain read domain, status (picked = in the cart, not bought), progress, timestamps, error, paymentError, price / renewalPrice, the registration (expiresAt, autoRenew) and mailboxes[] (email, status). Also returns emailSenderInfo and a summary (total, ready, inFlight, errored, paymentErrored). Not available with a website-scoped key.",
    "tags": [
     "Outreach Domains"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website id from list_websites."
      },
      "description": "Website id from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_outreach_domains"
   },
   "post": {
    "summary": "Pick outreach domain",
    "description": "Add an available domain to a website's picked list (the purchase cart). Nothing is bought or charged: purchase_outreach_domains later buys every picked domain at once. Call search_domain_availability first; the server uses its own quote from that search (re-checked if older than 6 hours) and refuses a domain that is not available. Remove a pick with remove_outreach_domain; see the cart with list_outreach_domains. websiteId comes from list_websites. Returns success and outreachDomains[] (the current unpaid picks), with alreadyAdded: true when the domain was already picked. Not available with a website-scoped key.",
    "tags": [
     "Outreach Domains"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "domain"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website id from list_websites to attach the domain to."
         },
         "domain": {
          "type": "string",
          "description": "Domain name to pick, e.g. getacme.example."
         },
         "replacePicked": {
          "type": "boolean",
          "description": "true to drop the other unpaid picks and keep only this domain. Default false, which adds to the list."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "add_outreach_domain"
   }
  },
  "/v3/outreach-domains/{domain}": {
   "delete": {
    "summary": "Unpick outreach domain",
    "description": "Remove a domain from a website's picked list (purchase cart) before it is bought. Only unpurchased picks can be removed; a bought domain is refused with an error. websiteId comes from list_websites; the domain from add_outreach_domain or list_outreach_domains. Returns success and outreachDomains[] (the remaining picks), or 404 when the domain is not on the list. Not available with a website-scoped key.",
    "tags": [
     "Outreach Domains"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "domain",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Picked domain to remove, e.g. getacme.example."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website id from list_websites."
      },
      "description": "Website id from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "remove_outreach_domain"
   }
  },
  "/v3/outreach-domains/suggestions": {
   "get": {
    "summary": "Suggest outreach domains",
    "description": "Suggest look-alike domain names for cold outreach, built from the website's own domain and keeping its ending (e.g. acme.example gives getacme.example, tryacme.example, useacme.example, goacme.example, acmeapp.example, acmehq.example). Availability is not checked: run search_domain_availability on a name before add_outreach_domain. websiteId comes from list_websites. Returns baseDomain and suggestions[]. Not available with a website-scoped key.",
    "tags": [
     "Outreach Domains"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website id from list_websites. Suggestions are derived from this website's domain."
      },
      "description": "Website id from list_websites. Suggestions are derived from this website's domain."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_domain_suggestions"
   }
  },
  "/v3/outreach-domains/availability": {
   "get": {
    "summary": "Check domain availability",
    "description": "Check whether a domain can be registered for outreach and what it costs. Call it before add_outreach_domain, which uses this quote (valid for 6 hours). Returns domain, available, price and renewalPrice (USD per year, registration quote), premium and a rating of the name. The amount charged at purchase can be higher than this registration quote; the dashboard checkout shows the final total. Endings that require multi-year registration are refused with an error; HTTP 503 means the lookup was busy, try again shortly. Not available with a website-scoped key.",
    "tags": [
     "Outreach Domains"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "domain",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Domain name to check, e.g. getacme.example. A pasted URL is reduced to its domain."
      },
      "description": "Domain name to check, e.g. getacme.example. A pasted URL is reduced to its domain."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "search_domain_availability"
   }
  },
  "/v3/outreach-domains/status": {
   "get": {
    "summary": "Domain setup progress",
    "description": "Check the setup progress of the outreach domains bought for a website (unpaid picks are not shown). Call it after purchase_outreach_domains until every domain is ready. websiteId comes from list_websites. Per domain read status, completedSteps of totalSteps (5: purchased, DNS configured, mail setup, mailboxes created, ready), progressPercent, terminal (true when ready), mailboxCount, awaitingSenderInfo, hasError with retryCount / retriesExhausted / nextRetryAt (failed steps are retried automatically) and paymentError. Also returns hasEmailSenderInfo and a summary (total, ready, inFlight, errored, paymentErrored, awaitingSenderInfo). Not available with a website-scoped key.",
    "tags": [
     "Outreach Domains"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website id from list_websites."
      },
      "description": "Website id from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_domain_setup_status"
   }
  },
  "/v3/blog/articles": {
   "get": {
    "summary": "List blog articles",
    "description": "Lists the articles on a website's hosted blog (Optimize add-on), newest first. Use it to find an articleId for get_blog_article or update_blog_article. Each row has _id, title, slug, url, status (live, draft…), source, category, version, visits, firstAvg / currentAvg (the average ICP match of visitors to the first and current version), versionAvgs, pendingRefinement, publishedAt, issues and locked (locked articles cannot be edited). Errors: 403 without the Optimize add-on or the SEO permission, 404 when the blog is not set up.",
    "tags": [
     "Optimize"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_blog_articles"
   },
   "post": {
    "summary": "Create blog article",
    "description": "Publishes a hand-written article on the website's hosted blog at <blog>/<slug>, or saves it as a draft (Optimize add-on). It goes live publicly at once unless status is 'draft'. It uses one article from the monthly allowance, whether live or draft. With none left it returns 400 'No articles left this month. Add more articles on the Billing page.' Confirm with the user before publishing. To change an existing article use update_blog_article. Returns 201 with { article, url }; url is the public address.",
    "tags": [
     "Optimize"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "title",
         "html"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "title": {
          "type": "string",
          "description": "Article title (H1). Required."
         },
         "html": {
          "type": "string",
          "description": "Article body as HTML. Supported: p, h2, h3, ul/ol, blockquote, img, table. Required."
         },
         "metaDescription": {
          "type": "string",
          "description": "Search-result description, about 150–160 characters."
         },
         "excerpt": {
          "type": "string",
          "description": "Short summary for the blog index. Defaults to the meta description."
         },
         "category": {
          "type": "string",
          "description": "Category name. Default 'Guides'."
         },
         "coverImage": {
          "type": "string",
          "description": "Absolute cover image URL starting with http(s)://; other values are dropped."
         },
         "slug": {
          "type": "string",
          "description": "URL path segment, e.g. \"lead-scoring-guide\". Defaults to the title. A number is added if the slug is already taken."
         },
         "status": {
          "type": "string",
          "enum": [
           "live",
           "draft"
          ],
          "description": "'live' (default) publishes now; 'draft' saves without publishing."
         },
         "faq": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "q": {
             "type": "string",
             "description": "Question text."
            },
            "a": {
             "type": "string",
             "description": "Answer text."
            }
           }
          },
          "description": "FAQ entries shown under the article. Entries missing q or a are dropped."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "create_blog_article"
   }
  },
  "/v3/blog/articles/{articleId}": {
   "get": {
    "summary": "Get blog article",
    "description": "Returns one blog article in full (Optimize add-on): its content blocks, FAQ, every version with its status, the public url and the visits it received. Use it before update_blog_article to see the current text. Get articleId from list_blog_articles. Returns { article, visits, url }, or 404 'Article not found'.",
    "tags": [
     "Optimize"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "articleId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Article _id from list_blog_articles."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_blog_article"
   },
   "put": {
    "summary": "Edit blog article",
    "description": "Edits a blog article by saving a new version at the same URL (Optimize add-on). If the article is live, the new version goes live at once. status 'live' publishes a draft, and status 'draft' takes a live article offline. Only the fields you pass change. Uses one article from the monthly allowance; with none left it returns 400. Locked articles (guest posts, paid placements) are refused. Get articleId from list_blog_articles, and read the current text with get_blog_article first. Confirm with the user before changing a live article. Returns { article, url }.",
    "tags": [
     "Optimize"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "articleId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Article _id from list_blog_articles."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "title": {
          "type": "string",
          "description": "New title."
         },
         "html": {
          "type": "string",
          "description": "New body as HTML (p, h2, h3, ul/ol, blockquote, img, table). Replaces the whole body."
         },
         "metaDescription": {
          "type": "string",
          "description": "New search-result description."
         },
         "excerpt": {
          "type": "string",
          "description": "New short summary for the blog index."
         },
         "category": {
          "type": "string",
          "description": "New category name."
         },
         "coverImage": {
          "type": "string",
          "description": "New absolute cover image URL (http/https); other values clear it."
         },
         "status": {
          "type": "string",
          "enum": [
           "live",
           "draft"
          ],
          "description": "'live' publishes this version now; 'draft' takes the article offline. Leave it out to keep the current state."
         },
         "faq": {
          "type": "array",
          "items": {
           "type": "object"
          },
          "description": "Full new FAQ list of { q, a } objects. Replaces the saved FAQ."
         },
         "summary": {
          "type": "string",
          "description": "What this edit changes, shown in the version history. Default 'Edited by hand'."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_blog_article"
   }
  },
  "/v3/blog/cache/clear": {
   "post": {
    "summary": "Refresh blog cache",
    "description": "Clears every cached copy of the website's hosted blog (Optimize add-on), so visitors get the latest version on their next page load. Use it when a published change does not show yet. It changes no content and costs nothing. Returns { status, site }. Errors: 403 without the Optimize add-on or the SEO permission, 404 when the blog is not set up.",
    "tags": [
     "Optimize"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "clear_blog_cache"
   }
  },
  "/v3/linkedin/campaigns/{linkedinCampaignId}": {
   "get": {
    "summary": "Get a LinkedIn campaign",
    "description": "One LinkedIn campaign of this website: its settings and the people in it with their status (invited, connected, messaged, replied), optionally one status, page by page. Free.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "linkedinCampaignId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "LinkedIn campaign ID from list_linkedin_campaigns."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     },
     {
      "in": "query",
      "name": "status",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Only people with this status."
      },
      "description": "Only people with this status."
     },
     {
      "in": "query",
      "name": "page",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 1,
       "description": "Page of people, from 1."
      },
      "description": "Page of people, from 1."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_linkedin_campaign"
   },
   "delete": {
    "summary": "Delete a LinkedIn campaign",
    "description": "Deletes a LinkedIn campaign and stops everything it would still send. Connections already made on LinkedIn stay.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "linkedinCampaignId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "LinkedIn campaign ID from list_linkedin_campaigns."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "delete_linkedin_campaign"
   }
  },
  "/v3/linkedin/campaigns/{linkedinCampaignId}/timeline": {
   "get": {
    "summary": "Get a LinkedIn campaign timeline",
    "description": "What a LinkedIn campaign did day by day over the last days: invitations sent, accepted, messages sent and replies. Free.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "linkedinCampaignId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "LinkedIn campaign ID from list_linkedin_campaigns."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     },
     {
      "in": "query",
      "name": "days",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 1,
       "maximum": 90,
       "description": "How many days back (1-90)."
      },
      "description": "How many days back (1-90)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_linkedin_campaign_timeline"
   }
  },
  "/v3/linkedin/campaigns/{linkedinCampaignId}/activate": {
   "post": {
    "summary": "Start a LinkedIn campaign",
    "description": "Starts a LinkedIn campaign: it begins sending invitations and messages from the connected LinkedIn account, within the account's daily LinkedIn limits.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "linkedinCampaignId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "LinkedIn campaign ID from list_linkedin_campaigns."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "activate_linkedin_campaign"
   }
  },
  "/v3/linkedin/campaigns/{linkedinCampaignId}/pause": {
   "post": {
    "summary": "Pause a LinkedIn campaign",
    "description": "Pauses a running LinkedIn campaign: nothing more is sent until it is resumed. People already in it keep their place.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "linkedinCampaignId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "LinkedIn campaign ID from list_linkedin_campaigns."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "pause_linkedin_campaign"
   }
  },
  "/v3/linkedin/campaigns/{linkedinCampaignId}/resume": {
   "post": {
    "summary": "Resume a LinkedIn campaign",
    "description": "Resumes a paused LinkedIn campaign: it continues sending invitations and messages where it stopped.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "linkedinCampaignId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "LinkedIn campaign ID from list_linkedin_campaigns."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "resume_linkedin_campaign"
   }
  },
  "/v3/email/spam-check": {
   "post": {
    "summary": "Spam-check an email",
    "description": "Checks an email subject and body for words and patterns that send mail to spam, and returns a score with each issue and how to fix it. Nothing is sent. Use it before add_campaign_step or update_campaign_step.",
    "tags": [
     "Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "subject",
         "body"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "subject": {
          "type": "string",
          "description": "The subject line."
         },
         "body": {
          "type": "string",
          "description": "The email body (text or HTML)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "spam_check_email"
   }
  },
  "/v3/slack/channels": {
   "get": {
    "summary": "List Slack channels",
    "description": "The channels of the Slack workspace connected to this website, to pick one for a Slack automation. Returns an error when Slack is not connected. Free.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_slack_channels"
   }
  },
  "/v3/billing/invoices": {
   "get": {
    "summary": "List invoices",
    "description": "The account's invoices, newest first: date, amount, refunded amount, currency, status (paid, open, void, uncollectible, refunded, partially_refunded), description (what it was for), a link to the PDF and hosted (the invoice's web page, where an open one can be paid). Paged: when hasMore is true, pass nextCursor as startingAfter. Account owners and billing admins only. Free.",
    "tags": [
     "Billing"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     },
     {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 1,
       "maximum": 50,
       "description": "Invoices per page (1-50, default 10)."
      },
      "description": "Invoices per page (1-50, default 10)."
     },
     {
      "in": "query",
      "name": "startingAfter",
      "required": false,
      "schema": {
       "type": "string",
       "description": "For the next page: the nextCursor from the previous answer. Leave empty for the newest invoices."
      },
      "description": "For the next page: the nextCursor from the previous answer. Leave empty for the newest invoices."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_invoices"
   }
  },
  "/v3/billing/auto-topup": {
   "get": {
    "summary": "Get auto top-up",
    "description": "Whether auto top-up is on: when credits run out, a pack of leads is bought automatically at your plan's price per lead, up to a monthly cap in USD. Returns eligible (true only on an active, unpaused paid subscription with a card on file; false on a trial or lifetime plan), enabled, packLeads, capUsd and minCapUsd (the lowest cap allowed: your plan price), perLeadCents and packPriceCents, spentThisCycleCents and refreshOn (when the cycle restarts), lowThreshold (credits left when it buys), recent (the last 10 top-ups), extraLeads (bought leads still unused; they roll over) and monthlyLeadsLeft. Free.",
    "tags": [
     "Billing"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_auto_topup"
   },
   "put": {
    "summary": "Set auto top-up",
    "description": "Turns auto top-up on or off and sets the pack of leads bought each time credits run out and the monthly cap in USD. When on, the card on file is charged automatically up to the cap. Account owners and billing admins only.",
    "tags": [
     "Billing"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "enabled"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "enabled": {
          "type": "boolean",
          "description": "true to buy leads automatically, false to stop."
         },
         "packLeads": {
          "type": "number",
          "minimum": 1,
          "maximum": 100000,
          "description": "Leads bought each time credits run out (1-100,000). Needed the first time you turn it on; the price per lead is your plan's (perLeadCents in get_auto_topup)."
         },
         "capUsd": {
          "type": "number",
          "minimum": 1,
          "description": "Most auto top-up may spend per billing cycle, in USD. At least your plan's monthly price (minCapUsd in get_auto_topup); a lower value is refused. Leave it out to keep the current limit."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_auto_topup"
   }
  },
  "/v3/prospects/resume": {
   "post": {
    "summary": "Resume prospects",
    "description": "Resumes paused prospects so their emails are sent again from their next scheduled step. prospectIds come from get_prospects.",
    "tags": [
     "Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "prospectIds"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "prospectIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Prospect IDs from get_prospects."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "resume_prospects"
   }
  },
  "/v3/prospects/send-now": {
   "post": {
    "summary": "Send to prospects now",
    "description": "Sends the next email of their sequence to the given prospects right away instead of at their scheduled time, within the mailbox limits.",
    "tags": [
     "Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "prospectIds"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "prospectIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Prospect IDs from get_prospects."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "send_prospects_now"
   }
  },
  "/v3/prospects/change-mailbox": {
   "post": {
    "summary": "Move prospects to another mailbox",
    "description": "Moves prospects to another mailbox: their next emails are sent from it. Use it when a mailbox is disconnected or over its limit.",
    "tags": [
     "Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "prospectIds",
         "emailAccountId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "prospectIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Prospect IDs from get_prospects."
         },
         "emailAccountId": {
          "type": "string",
          "description": "Mailbox ID from list_email_accounts."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "change_prospects_mailbox"
   }
  },
  "/v3/prospects/reschedule": {
   "post": {
    "summary": "Reschedule prospects",
    "description": "Recalculates when the next email of each prospect goes out, spread over the coming days within the mailbox limits, e.g. after a pause or a limit change.",
    "tags": [
     "Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "campaignId",
         "prospectIds"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "campaignId": {
          "type": "string",
          "description": "Campaign ID from list_campaigns."
         },
         "prospectIds": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "description": "Prospect IDs from get_prospects."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "reschedule_prospects"
   }
  },
  "/v3/campaigns/{campaignId}/ai-emails": {
   "post": {
    "summary": "Write campaign emails with AI",
    "description": "Writes a sequence of emails for a campaign with AI, from your website, offer and ideal customer, and saves them as the campaign steps. Review them with get_campaign before starting the campaign.",
    "tags": [
     "Campaigns"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "campaignId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Campaign ID from list_campaigns."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "generate_campaign_emails_ai"
   }
  },
  "/v3/domains": {
   "get": {
    "summary": "List sending domains",
    "description": "The domains bought or imported for sending, with their mailboxes, DNS state, expiry date and auto-renew. Free.",
    "tags": [
     "Outreach Domains"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_domains"
   }
  },
  "/v3/domains/{domainId}/auto-renew": {
   "put": {
    "summary": "Set domain auto-renew",
    "description": "Turns automatic yearly renewal of a sending domain on or off. Off: the domain and its mailboxes stop working when it expires.",
    "tags": [
     "Outreach Domains"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "domainId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Domain ID from list_domains."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "autoRenew"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "autoRenew": {
          "type": "boolean",
          "description": "true to renew every year."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_domain_auto_renew"
   }
  },
  "/v3/mailboxes/{emailAccountId}/rename": {
   "post": {
    "summary": "Rename a mailbox",
    "description": "Changes the sender name a mailbox shows, and for mailboxes on our servers the part of the address before the @. The mailbox keeps its warmup and history.",
    "tags": [
     "Mailboxes"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "emailAccountId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Mailbox ID from list_email_accounts."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "fullName": {
          "type": "string",
          "description": "The sender name."
         },
         "localPart": {
          "type": "string",
          "description": "Our mailboxes only: the new part before the @."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "rename_email_account"
   }
  },
  "/v3/mailboxes/{emailAccountId}/reconnect": {
   "post": {
    "summary": "Reconnect a mailbox",
    "description": "Tries the saved SMTP and IMAP settings of a disconnected mailbox again; when they work, the mailbox is connected and its paused prospects continue.",
    "tags": [
     "Mailboxes"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "emailAccountId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Mailbox ID from list_email_accounts."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "reconnect_email_account"
   }
  },
  "/v3/mailboxes/{emailAccountId}/unmark-spam": {
   "post": {
    "summary": "Clear a mailbox spam flag",
    "description": "Clears the flag set when a mailbox looked like it was going to spam, so it sends again. Fix the cause first (warmup, content, DNS) with get_warmup_health.",
    "tags": [
     "Mailboxes"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "emailAccountId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Mailbox ID from list_email_accounts."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "unmark_email_account_spam"
   }
  },
  "/v3/mailboxes/{emailAccountId}/tracking-domain": {
   "delete": {
    "summary": "Remove a tracking domain",
    "description": "Stops using the custom open and click tracking domain of a mailbox; tracking falls back to the shared domain.",
    "tags": [
     "Mailboxes"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "emailAccountId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Mailbox ID from list_email_accounts."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "remove_tracking_domain"
   }
  },
  "/v3/crm/variables": {
   "get": {
    "summary": "List CRM variables",
    "description": "The lead and company fields (name, email, job title, company size, pages visited, score…) that can be mapped to fields in your CRM. Free.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_crm_variables"
   }
  },
  "/v3/crm/{crm}/mappings": {
   "get": {
    "summary": "Get CRM field mappings",
    "description": "The field mappings used when leads are pushed to a CRM: which lead field fills which CRM field, for contacts and companies. Free.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "crm",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The CRM."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     },
     {
      "in": "query",
      "name": "objectType",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "contact",
        "company"
       ],
       "description": "contact or company."
      },
      "description": "contact or company."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_crm_mappings"
   },
   "put": {
    "summary": "Set CRM field mappings",
    "description": "Sets the field mappings for contacts or companies pushed to a CRM. The list you send replaces the current one; get_crm_mappings first and list_crm_variables for the fields.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "crm",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The CRM."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "objectType",
         "mappings"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "objectType": {
          "type": "string",
          "enum": [
           "contact",
           "company"
          ],
          "description": "contact or company."
         },
         "mappings": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "source": {
             "type": "string",
             "description": "Lead field, from list_crm_variables."
            },
            "target": {
             "type": "string",
             "description": "CRM field name."
            }
           }
          },
          "description": "The full list: lead field (source) to CRM field (target)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_crm_mappings"
   }
  },
  "/v3/slack/message-template": {
   "get": {
    "summary": "Get the Slack message template",
    "description": "The template of the message posted to Slack for each lead, with its merge fields. Free.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_slack_message_template"
   },
   "put": {
    "summary": "Set the Slack message template",
    "description": "Changes the template of the message posted to Slack for each lead. Merge fields like {{name}} and {{company}} are filled per lead.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "template"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "template": {
          "type": "string",
          "description": "The message template."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_slack_message_template"
   }
  },
  "/v3/slack/test-message": {
   "post": {
    "summary": "Send a Slack test message",
    "description": "Posts a sample lead message to a Slack channel so you can see how it looks. It is a real Slack message.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "channelName": {
          "type": "string",
          "description": "Channel to post to, e.g. #leads."
         },
         "template": {
          "type": "string",
          "description": "Optional template to try instead of the saved one."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "send_slack_test_message"
   }
  },
  "/v3/webhooks/test": {
   "post": {
    "summary": "Test a webhook",
    "description": "Sends a sample lead, as automations send them, to a URL so you can check your endpoint receives and parses it. Returns the status your endpoint answered.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "webhook"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "webhook": {
          "type": "string",
          "description": "The URL to send the sample lead to."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "test_webhook"
   }
  },
  "/v3/automations/filter-preview": {
   "post": {
    "summary": "Preview an automation filter",
    "description": "Counts the leads of the last days that match a saved filter, and shows a few of them, before you use the filter in an automation. Free.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "filterId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "filterId": {
          "type": "string",
          "description": "Saved filter ID from list_filters."
         },
         "days": {
          "type": "number",
          "minimum": 1,
          "maximum": 90,
          "description": "How many days back (1-90)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "preview_automation_filter"
   }
  },
  "/v3/automations/stats": {
   "get": {
    "summary": "Get automation statistics",
    "description": "For every automation of a website: how many leads it handled, how many failed and when it last ran. Free.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_automation_stats"
   }
  },
  "/v3/exclusions/domains": {
   "post": {
    "summary": "Block a company domain",
    "description": "Adds a company domain to the website exclusions: its visitors are not identified and use no credits. Undo with remove_from_domain_blacklist.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "domain"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "domain": {
          "type": "string",
          "description": "The company domain, e.g. acme.com."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "block_domain"
   }
  },
  "/v3/exclusions/people": {
   "post": {
    "summary": "Block a person",
    "description": "Excludes one person (by email, LinkedIn URL or name) from the leads of a website, e.g. an employee or a customer.",
    "tags": [
     "Leads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "email": {
          "type": "string",
          "description": "Their email."
         },
         "linkedinUrl": {
          "type": "string",
          "description": "Their LinkedIn profile URL."
         },
         "name": {
          "type": "string",
          "description": "Their name."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "block_person"
   }
  },
  "/v3/websites/{websiteId}/lead-quality/purge": {
   "post": {
    "summary": "Purge leads below the bar",
    "description": "Removes the leads already in the table that score below the lead quality bar (get_lead_quality). It can be undone with undo_lead_purge.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "purge_leads_below_bar"
   }
  },
  "/v3/websites/{websiteId}/lead-quality/undo-purge": {
   "post": {
    "summary": "Undo a lead purge",
    "description": "Brings back the leads removed by the last purge_leads_below_bar, with their tags, comments and history as they were.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "undo_lead_purge"
   }
  },
  "/v3/linkedin/keywords": {
   "get": {
    "summary": "List LinkedIn keywords",
    "description": "The keywords watched on LinkedIn (LinkedIn Fans): people who post or comment about them become leads. With their status and leads found. Free.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_linkedin_keywords"
   },
   "post": {
    "summary": "Add a LinkedIn keyword",
    "description": "Starts watching a keyword on LinkedIn: people who post or comment about it become leads.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "keyword"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "keyword": {
          "type": "string",
          "description": "The keyword or phrase."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "add_linkedin_keyword"
   }
  },
  "/v3/linkedin/keywords/{keywordId}": {
   "put": {
    "summary": "Pause or resume a LinkedIn keyword",
    "description": "Pauses or resumes watching one LinkedIn keyword. Paused keywords find no new people; the leads they already found stay.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "keywordId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Keyword ID from list_linkedin_keywords."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "status"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "status": {
          "type": "string",
          "enum": [
           "active",
           "paused"
          ],
          "description": "active or paused."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_linkedin_keyword_status"
   },
   "delete": {
    "summary": "Delete a LinkedIn keyword",
    "description": "Stops watching a LinkedIn keyword for good and removes it from the list. The leads it already found stay.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "keywordId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Keyword ID from list_linkedin_keywords."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "delete_linkedin_keyword"
   }
  },
  "/v3/linkedin/tracked-posts": {
   "get": {
    "summary": "List tracked LinkedIn posts",
    "description": "The LinkedIn posts being tracked: people who react to or comment on them become leads. Free.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_linkedin_tracked_posts"
   },
   "post": {
    "summary": "Track a LinkedIn post",
    "description": "Starts tracking a LinkedIn post (yours or someone else’s): people who react to or comment on it become leads.",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId",
         "url"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "url": {
          "type": "string",
          "description": "The LinkedIn post URL."
         },
         "isOwn": {
          "type": "boolean",
          "description": "true when it is your own post."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "add_linkedin_tracked_post"
   }
  },
  "/v3/linkedin/accounts/{linkedinAccountId}": {
   "patch": {
    "summary": "Update a LinkedIn account",
    "description": "Changes the label of a connected LinkedIn account, or pauses and resumes it (paused: its campaigns send nothing).",
    "tags": [
     "LinkedIn"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "linkedinAccountId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "LinkedIn account ID from list_linkedin_accounts."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "label": {
          "type": "string",
          "description": "A name for the account."
         },
         "status": {
          "type": "string",
          "enum": [
           "active",
           "paused"
          ],
          "description": "active or paused."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_linkedin_account"
   }
  },
  "/v3/account/tracking-settings": {
   "put": {
    "summary": "Update account-wide tracking",
    "description": "Turns tracking options on or off for every website of the account at once: identify people, suggested contacts, personal emails, session recordings. Switching one off applies to every website.",
    "tags": [
     "Account"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         },
         "trackExactVisitors": {
          "type": "boolean",
          "description": "Identify the person, not only the company."
         },
         "trackCompanyWithSuggestedContacts": {
          "type": "boolean",
          "description": "Suggest contacts at companies without an identified person."
         },
         "trackPersonalEmails": {
          "type": "boolean",
          "description": "Keep leads with a personal email."
         },
         "sessionRecordingEnabled": {
          "type": "boolean",
          "description": "Record visits."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_account_tracking_settings"
   }
  },
  "/v3/credits/summary": {
   "get": {
    "summary": "Get the credit summary",
    "description": "Credits used in a billing cycle, by source (website visitors, Prospector, AI Scout, Web Scraping…) and by day (byDay: charges, refunds and duplicates prevented per date, UTC), with the plan limit, what is left and leads bought. For single credit events use get_credit_history. Free.",
    "tags": [
     "Billing"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     },
     {
      "in": "query",
      "name": "cycle",
      "required": false,
      "schema": {
       "type": "number",
       "minimum": 0,
       "maximum": 5,
       "description": "Which billing cycle: 0 = the current one (default), 1 = the one before, up to 5 (the last six cycles are kept; none before the account was created). The answer's cycles list shows each one's dates."
      },
      "description": "Which billing cycle: 0 = the current one (default), 1 = the one before, up to 5 (the last six cycles are kept; none before the account was created). The answer's cycles list shows each one's dates."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_credit_summary"
   }
  },
  "/v3/billing/domains": {
   "get": {
    "summary": "List billed domains",
    "description": "The account's sending domains with their billing: price and renewalPrice (USD a year), expiresAt (renewal date), autoRenew and cancelAtPeriodEnd, setupCompleted and activeDate. source says how the domain came in: bundle (the outreach bundle), premium (bought on its own through the extras checkout) or imported (the customer's own domain: it renews at their registrar and is never billed here). isPremium is separate: true when the registration price is above $14. Free.",
    "tags": [
     "Billing"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_billing_domains"
   }
  },
  "/v3/billing/open-invoices": {
   "get": {
    "summary": "List open invoices",
    "description": "The account invoices that are still unpaid (open or past due): amount, currency, due date, what it is for, the payment status, the PDF link and hosted (the page where it can be paid); at most 5, newest first; plus the next upcoming invoice (amount and the date the period ends), or null on a cancelled or lifetime plan. Free.",
    "tags": [
     "Billing"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_open_invoices"
   }
  },
  "/v3/google-ads/audiences": {
   "get": {
    "summary": "List Google Ads audiences",
    "description": "The Google Ads retargeting audiences of a website: name, linked Google campaign, contacts uploaded and match stats. Free.",
    "tags": [
     "Ads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_google_ads_audiences"
   }
  },
  "/v3/google-ads/audiences/{audienceId}": {
   "get": {
    "summary": "Get a Google Ads audience",
    "description": "One retargeting audience: settings, contacts uploaded, match rate and the stats of its Google campaign. Free.",
    "tags": [
     "Ads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "audienceId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Audience ID from list_google_ads_audiences."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites."
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_google_ads_audience"
   }
  },
  "/v3/google-ads/audiences/{audienceId}/sync-stats": {
   "post": {
    "summary": "Refresh Google Ads audience stats",
    "description": "Fetches the latest impressions, clicks and conversions of an audience’s campaign from Google Ads.",
    "tags": [
     "Ads"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "audienceId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Audience ID from list_google_ads_audiences."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "websiteId"
        ],
        "properties": {
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "sync_google_ads_audience_stats"
   }
  },
  "/v3/crm/push": {
   "post": {
    "summary": "Push contact to CRM",
    "description": "Creates a contact in the website's connected CRM: HubSpot, Pipedrive, Salesforce, Zoho or GoHighLevel. The contact details come from a saved contact with that email if one exists, otherwise from the lead's identified person when you pass leadId. With leadId, the lead is marked as added to the CRM. contactData.email is always required. HubSpot, Zoho and Pipedrive also need ownerId, which you get from list_crm_owners. To set up automatic pushes for every lead, use create_automation instead. It writes to a third-party system, so confirm with the user before calling. Errors: the CRM is not connected for this website, 'No Contact Found', 401 when the CRM login has expired.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "crm",
         "websiteId",
         "contactData"
        ],
        "properties": {
         "leadId": {
          "type": "string",
          "description": "Lead _id from get_leads (optional). Supplies the person's details and links the CRM record to the lead."
         },
         "crm": {
          "type": "string",
          "description": "One of: hubspot, pipedrive, salesforce, zoho, gohighlevel."
         },
         "websiteId": {
          "type": "string",
          "description": "Website ID from list_websites; the CRM must be connected on this website."
         },
         "ownerId": {
          "type": "string",
          "description": "CRM user id to assign the contact to, from list_crm_owners. Required for hubspot, zoho and pipedrive."
         },
         "contactData": {
          "type": "object",
          "description": "Contact fields: email (required), firstName, lastName, position. ownerId may also be given here."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "push_lead_to_crm"
   }
  },
  "/v3/crm/owners": {
   "get": {
    "summary": "List CRM owners",
    "description": "Lists the users in a connected CRM that a contact can be assigned to. Use it to get the ownerId that push_lead_to_crm needs for HubSpot, Zoho and Pipedrive. Reads from the CRM and changes nothing. Returns { data } with the CRM's own user list. Errors: the CRM is not connected for this website, 401 when the CRM login has expired and needs reconnecting.",
    "tags": [
     "Automations"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "query",
      "name": "crm",
      "required": true,
      "schema": {
       "type": "string",
       "description": "One of: hubspot, pipedrive, salesforce, zoho, gohighlevel."
      },
      "description": "One of: hubspot, pipedrive, salesforce, zoho, gohighlevel."
     },
     {
      "in": "query",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string",
       "description": "Website ID from list_websites; the CRM must be connected on this website."
      },
      "description": "Website ID from list_websites; the CRM must be connected on this website."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "list_crm_owners"
   }
  },
  "/v3/websites/{websiteId}/diagnostics": {
   "get": {
    "summary": "Diagnose website",
    "description": "Checks why a website may not be producing leads. Returns processing.isBlocked and shouldExpectLeads, credits (account, website and effective credits, and whether the website has its own allowance), recentActivity (leadsLast48Hours, lastLeadCreatedAt, hasNeverGeneratedLeads) and messages.primary, a one-line status that names the block reason (e.g. trial expired, credits exhausted, account paused). Use it for 'no leads' questions; to check the snippet is installed use verify_website. websiteId comes from list_websites.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_website_diagnostics"
   }
  },
  "/v3/websites/{websiteId}/pixel": {
   "get": {
    "summary": "Get tracking snippet",
    "description": "Returns the JavaScript snippet to install on a website so visitors can be identified, plus websiteId, clientId, status and url. Give trackingScript to the user to add to every page of their site (or their tag manager / site builder). After it is installed, run verify_website. websiteId comes from list_websites or add_website.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites or add_website."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_tracking_pixel"
   }
  },
  "/v3/websites/{websiteId}/credit-history": {
   "get": {
    "summary": "Get website credit history",
    "description": "Returns the credit snapshots stored for one website: each entry has creditsLimit, creditsRemaining, creditsUsed, refreshOn and timestamps. Returns { history: [...] }, newest first, the full list (no paging). Use it for a website that has its own credit allowance. For individual credit charges and refunds use get_credit_history. websiteId comes from list_websites.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites (24-character ID)."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_website_credit_history"
   }
  },
  "/v3/websites/{websiteId}/session-recording": {
   "put": {
    "summary": "Turn session recordings on or off",
    "description": "Turns session recordings on or off for one website. When on, visits are recorded so you can replay what a lead did; when off, no new recordings are made and existing ones stay until they expire.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "enabled"
        ],
        "properties": {
         "enabled": {
          "type": "boolean",
          "description": "true to record visits, false to stop."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_session_recording"
   }
  },
  "/v3/websites/{websiteId}/page-rules": {
   "put": {
    "summary": "Set which pages are tracked",
    "description": "Sets the page rules of a website. In exclude mode visitors on matching pages are not identified (e.g. careers or login pages); in include mode only visitors on matching pages are. The rules you send replace the current ones; an empty list removes them. Rules that could never match are refused with the reason.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "rules"
        ],
        "properties": {
         "mode": {
          "type": "string",
          "enum": [
           "exclude",
           "include"
          ],
          "description": "exclude (default) or include."
         },
         "rules": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "type": {
             "type": "string",
             "enum": [
              "starts-with",
              "ends-with",
              "contains",
              "does-not-contain"
             ],
             "description": "starts-with, ends-with, contains or does-not-contain."
            },
            "url": {
             "type": "string",
             "description": "The part of the page URL to match, e.g. /careers."
            }
           },
           "required": [
            "type",
            "url"
           ]
          },
          "description": "The full list of rules."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_page_tracking_rules"
   }
  },
  "/v3/websites/{websiteId}/lead-quality": {
   "get": {
    "summary": "Get the lead quality bar",
    "description": "Returns the lead quality settings of a website: the minimum ideal-customer score a lead needs to be kept, the bar per source (website visitors, intent, Web Scraping, Prospector, AI Scout), contacts-only options and the audience focus (B2B, B2C or both). Free.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites."
     }
    ],
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "get_lead_quality"
   },
   "put": {
    "summary": "Update the lead quality bar",
    "description": "Changes the lead quality settings of a website. Leads scoring below the bar are not added (and use no credits). Only the fields you pass change; the highest bar is 80 (20 on lifetime-deal plans).",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites."
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "minScore": {
          "type": "number",
          "minimum": 0,
          "maximum": 80,
          "description": "Minimum ideal-customer score for every source (0-80)."
         },
         "bySource": {
          "type": "object",
          "properties": {
           "visitors": {
            "type": "number",
            "minimum": 0,
            "maximum": 80,
            "description": "Minimum score for website visitor leads (0-80); null uses the general bar."
           },
           "intent": {
            "type": "number",
            "minimum": 0,
            "maximum": 80,
            "description": "Minimum score for 3rd-party intent leads (0-80); null uses the general bar."
           },
           "scraping": {
            "type": "number",
            "minimum": 0,
            "maximum": 80,
            "description": "Minimum score for Web Scraping leads (0-80); null uses the general bar."
           },
           "prospector": {
            "type": "number",
            "minimum": 0,
            "maximum": 80,
            "description": "Minimum score for Prospector leads (0-80); null uses the general bar."
           },
           "scout": {
            "type": "number",
            "minimum": 0,
            "maximum": 80,
            "description": "Minimum score for AI Scout leads (0-80); null uses the general bar."
           }
          },
          "description": "Per-source bars that override minScore."
         },
         "contactsOnly": {
          "type": "boolean",
          "description": "Only keep leads with a person to contact."
         },
         "audienceFocus": {
          "type": "string",
          "enum": [
           "B2B",
           "B2C",
           "BOTH"
          ],
          "description": "B2B, B2C or BOTH."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "update_lead_quality"
   }
  },
  "/v3/websites/{websiteId}/limits": {
   "put": {
    "summary": "Set a website's limits",
    "description": "Sets how many of the account's credits and mailboxes one website may use, for accounts that share them between websites (for example one website per client). The credits cannot go above what the account has left.",
    "tags": [
     "Websites"
    ],
    "security": [
     {
      "privateKey": []
     }
    ],
    "parameters": [
     {
      "in": "query",
      "name": "privateKey",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Your master key or a website key"
     },
     {
      "in": "path",
      "name": "websiteId",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Website ID from list_websites."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "credits",
         "emailAccounts"
        ],
        "properties": {
         "credits": {
          "type": "number",
          "minimum": 0,
          "description": "Credits this website may use per cycle."
         },
         "emailAccounts": {
          "type": "number",
          "minimum": 0,
          "description": "Mailboxes this website may connect."
         },
         "resetCredits": {
          "type": "boolean",
          "description": "true refills what is left to the full allowance now (use it when a client pays)."
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The result, as the MCP tool of the same name returns it"
     },
     "400": {
      "description": "Invalid request: the field and the reason"
     },
     "401": {
      "description": "Missing or wrong key"
     },
     "404": {
      "description": "Not found for this website"
     }
    },
    "x-mcp-tool": "set_website_limits"
   }
  }
 }
}
