{
  "openapi": "3.1.0",
  "info": {
    "title": "BounceLint Real-Browser Message-Match Lint API",
    "version": "2.0.0",
    "description": "Deterministic Playwright desktop (1440x900) and mobile (390x844) ad-to-landing-page linter with dual-path verification. Free tier allows 5 requests/day/IP without authentication; Agency keys allow up to 200 requests/month.",
    "contact": {
      "name": "Terra Ventures B.V.",
      "email": "support@bouncelint.com",
      "url": "https://bouncelint.com/api"
    }
  },
  "servers": [
    {
      "url": "https://bouncelint.com",
      "description": "Production (EU Amsterdam)"
    }
  ],
  "paths": {
    "/api/v1/lint": {
      "post": {
        "operationId": "runMessageMatchLint",
        "summary": "Render a landing page on desktop + mobile and evaluate all 13 message-match checks",
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LintRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed dual-viewport lint result",
            "headers": {
              "X-RateLimit-Tier": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "free",
                    "keyed"
                  ]
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LintResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON, schema validation error, or SSRF-blocked private/non-HTTP URL"
          },
          "401": {
            "description": "Invalid or revoked Authorization Bearer API key"
          },
          "429": {
            "description": "Daily free IP limit (5/day, shared with the web linter and free tools) or workspace/per-key monthly quota exceeded. Requests rejected with 400 or 401 do not use quota.",
            "headers": {
              "X-RateLimit-Tier": {
                "$ref": "#/components/headers/XRateLimitTier"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "Retry-After": {
                "description": "Seconds until the free-tier daily window frees a slot. Not sent for monthly workspace quotas, which reset on the 1st of each UTC calendar month.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "502": {
            "description": "Unreachable destination host or DNS failure"
          },
          "504": {
            "description": "Destination page timed out during headless Chromium render"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service, database, and browser pool health check",
        "responses": {
          "200": {
            "description": "Healthy"
          },
          "503": {
            "description": "Degraded or database disconnected"
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "XRateLimitTier": {
        "description": "free (per-IP daily limit) or keyed (API key quota).",
        "schema": {
          "type": "string",
          "enum": [
            "free",
            "keyed"
          ]
        }
      },
      "XRateLimitLimit": {
        "description": "Requests allowed in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "XRateLimitRemaining": {
        "description": "Requests left in the current window after this one.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Self-serve workspace API key (bl_live_...) created at https://bouncelint.com/account/keys"
      }
    },
    "schemas": {
      "LintRequest": {
        "type": "object",
        "required": [
          "url",
          "adHeadline",
          "adPrimaryText"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://secureframe.com/books/pocket-guide-to-cmmc"
          },
          "adHeadline": {
            "type": "string",
            "minLength": 3,
            "maxLength": 200,
            "example": "CMMC in plain language, 10 pages"
          },
          "adPrimaryText": {
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "example": "Download the free CMMC 2.0 guide covering all 110 controls."
          },
          "adCta": {
            "type": "string",
            "minLength": 2,
            "maxLength": 80,
            "example": "Download"
          },
          "destinationConfidence": {
            "type": "string",
            "enum": [
              "confirmed",
              "assumed"
            ],
            "default": "assumed"
          },
          "region": {
            "type": "string",
            "enum": [
              "EU",
              "US"
            ],
            "default": "EU"
          }
        }
      },
      "DiagnosticCheck": {
        "type": "object",
        "required": [
          "code",
          "severity",
          "evidenceType",
          "outcome",
          "title",
          "evidence",
          "measured_value",
          "hard_threshold"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "high",
              "medium",
              "info"
            ]
          },
          "evidenceType": {
            "type": "string",
            "enum": [
              "binary",
              "measured",
              "score"
            ]
          },
          "outcome": {
            "type": "string",
            "enum": [
              "pass",
              "fail",
              "borderline",
              "info",
              "not_applicable",
              "inconclusive"
            ]
          },
          "title": {
            "type": "string"
          },
          "evidence": {
            "type": "string"
          },
          "measured_value": {
            "type": "string"
          },
          "hard_threshold": {
            "type": "string"
          },
          "recommendation": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LintResponse": {
        "type": "object",
        "required": [
          "auditId",
          "reportUrl",
          "reportUrlExpiresAt",
          "summary",
          "leadFinding",
          "headlineMatchScore",
          "ctaParity",
          "pageType",
          "renderRegion",
          "destinationConfidence",
          "failedChecks",
          "passedChecks",
          "telemetry"
        ],
        "properties": {
          "auditId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Stored audit ID. Null only if the report could not be saved; the measurements are still returned."
          },
          "reportUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Shareable web report for this lint (unguessable link, not indexed by search engines)."
          },
          "reportUrlExpiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When reportUrl stops working: 30 days after the lint for free-tier requests and keys not tied to an Agency workspace; null for Agency workspace keys, whose audits are kept while subscribed."
          },
          "summary": {
            "type": "object",
            "properties": {
              "fail": {
                "type": "integer"
              },
              "borderline": {
                "type": "integer"
              },
              "pass": {
                "type": "integer"
              },
              "info": {
                "type": "integer"
              },
              "not_applicable": {
                "type": "integer"
              },
              "inconclusive": {
                "type": "integer"
              }
            }
          },
          "leadFinding": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DiagnosticCheck"
              },
              {
                "type": "null"
              }
            ]
          },
          "headlineMatchScore": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "ctaParity": {
            "type": "string",
            "enum": [
              "aligned",
              "medium",
              "high"
            ]
          },
          "pageType": {
            "type": "string",
            "enum": [
              "dedicated_landing",
              "site_page"
            ]
          },
          "renderRegion": {
            "type": "string",
            "enum": [
              "EU",
              "US"
            ]
          },
          "destinationConfidence": {
            "type": "string",
            "enum": [
              "confirmed",
              "assumed"
            ]
          },
          "failedChecks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosticCheck"
            }
          },
          "borderlineChecks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosticCheck"
            }
          },
          "passedChecks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosticCheck"
            }
          },
          "infoChecks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosticCheck"
            }
          },
          "notApplicableChecks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosticCheck"
            }
          },
          "inconclusiveChecks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiagnosticCheck"
            }
          },
          "telemetry": {
            "type": "object"
          }
        }
      }
    }
  }
}