{
  "openapi": "3.1.0",
  "info": {
    "title": "AttributionRepair Public Attribution Diagnostics API",
    "version": "1.0.0",
    "description": "Free, read-only edge diagnostics maintained by AttributionRepair (https://attributionrepair.com/official/) for inspecting landing page attribution leaks and validating Google Ads Data Manager API / OCT & Meta CAPI payloads.",
    "contact": {
      "name": "AttributionRepair",
      "url": "https://attributionrepair.com/official/",
      "email": "audit@attributionrepair.com"
    }
  },
  "servers": [
    {
      "url": "https://attributionrepair.com"
    }
  ],
  "paths": {
    "/api/inspect": {
      "post": {
        "operationId": "inspectFunnelUrl",
        "summary": "Inspect a public landing page URL for sGTM, Consent Mode v2, and iframe click-ID leaks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "saveSnapshot": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Diagnostic leak score, stack detection, and shareable snapshot URL"
          }
        }
      }
    },
    "/api/validate-payload": {
      "post": {
        "operationId": "validateOctPayload",
        "summary": "Validate a CRM offline conversion row against Google Ads Data Manager API / OCT & Meta CAPI specs",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "gclid": {
                    "type": "string"
                  },
                  "gbraid": {
                    "type": "string"
                  },
                  "wbraid": {
                    "type": "string"
                  },
                  "click_time": {
                    "type": "string"
                  },
                  "conversion_time": {
                    "type": "string"
                  },
                  "conversion_value": {
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "currency_code": {
                    "type": "string"
                  },
                  "order_id": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rule checks plus normalized SHA-256 Enhanced Conversions payload"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcpJsonRpc",
        "summary": "Streamable HTTP MCP JSON-RPC 2.0 endpoint exposing inspect_funnel_url, validate_oct_payload, and decode_consent_mode",
        "responses": {
          "200": {
            "description": "MCP JSON-RPC 2.0 response"
          }
        }
      }
    }
  }
}