{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentPulse Edge Intelligence & MCP API",
    "version": "1.2.0",
    "description": "Deterministic B2B Domain Enrichment, 2026 AI Search (AEO / llms.txt / AI Crawler) Readiness Auditing, Clean Web-to-Agent Markdown Extraction, and Live DNS/DMARC/SaaS Footprint Inspection at the Cloudflare Edge.",
    "contact": {
      "name": "AgentPulse API Support",
      "url": "https://agentpulse-mcp.scopeforge-studio.workers.dev"
    }
  },
  "servers": [
    {
      "url": "https://agentpulse-mcp.scopeforge-studio.workers.dev",
      "description": "Global Cloudflare Edge Production Server"
    }
  ],
  "paths": {
    "/api/v1/enrich": {
      "get": {
        "operationId": "enrichCompanyDomain",
        "summary": "Live B2B Domain Enrichment (Contacts, Socials, 35+ Tech Signatures & GTM Signals)",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "linear.app"
            },
            "description": "Target company domain or URL to enrich in real time."
          }
        ],
        "responses": {
          "200": {
            "description": "Structured B2B company, contact, tech stack, and intent profile."
          },
          "402": {
            "description": "Free daily sandbox limit reached — upgrade link provided."
          }
        }
      }
    },
    "/api/v1/aeo-audit": {
      "get": {
        "operationId": "auditAiSearchReadiness",
        "summary": "2026 AI Search (AEO / GEO / llms.txt / AI Crawler) Readiness Audit & Generator",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "stripe.com"
            },
            "description": "Target domain to score for ChatGPT Search, Perplexity, Claude & Gemini readiness."
          }
        ],
        "responses": {
          "200": {
            "description": "0-100 AI Readiness score, crawler permissions, and auto-generated /llms.txt + JSON-LD."
          },
          "402": {
            "description": "Free daily sandbox limit reached — upgrade link provided."
          }
        }
      }
    },
    "/api/v1/markdown": {
      "get": {
        "operationId": "extractCleanMarkdown",
        "summary": "Convert any live URL into clean, token-efficient Markdown with YAML frontmatter",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "https://news.ycombinator.com"
            },
            "description": "Target URL to convert into clean LLM-ready Markdown."
          }
        ],
        "responses": {
          "200": {
            "description": "Clean Markdown, token savings percentage, and metadata."
          },
          "402": {
            "description": "Free daily sandbox limit reached — upgrade link provided."
          }
        }
      }
    },
    "/api/v1/dns-infra": {
      "get": {
        "operationId": "inspectDomainInfra",
        "summary": "Inspect live DNS, Email Deliverability (SPF/DMARC/MX), Verified SaaS TXT & Security Headers",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "openai.com"
            },
            "description": "Target domain to inspect via Cloudflare DNS-over-HTTPS and HTTPS headers."
          }
        ],
        "responses": {
          "200": {
            "description": "SPF/DMARC spoofing status, email provider, TXT SaaS tokens, and security score."
          },
          "402": {
            "description": "Free daily sandbox limit reached — upgrade link provided."
          }
        }
      }
    },
    "/api/v1/batch": {
      "post": {
        "operationId": "batchEnrichDomains",
        "summary": "Bulk parallel B2B Enrichment + AEO + DNS inspection for up to 25 domains per request (Pro Key)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domains"
                ],
                "properties": {
                  "domains": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "stripe.com",
                      "linear.app",
                      "supabase.com"
                    ]
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "enrich",
                      "aeo",
                      "dns",
                      "full"
                    ],
                    "default": "enrich"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Array of enriched domain payloads."
          },
          "402": {
            "description": "Pro API Key required for batch pipeline."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}