{
  "openapi": "3.1.0",
  "info": {
    "title": "OpsBlu API",
    "version": "1.0.0",
    "summary": "Live, enriched data on US local businesses.",
    "description": "Aggregates are free and never return names, IDs or coordinates. Record-level endpoints bill prepaid credits: 3 credits ($0.03) per standard record, 10 credits ($0.10) per hot record (new or changed in the last 30 days), charged once per unique record per calendar month. Paid responses include `credits_used` and `balance_remaining`. Over-rate requests answer 429 with `{\"error\":\"slow_down\",\"retry_after\":N}`.",
    "contact": {
      "url": "https://opsblu.com/docs",
      "email": "hello@opsblu.com"
    }
  },
  "servers": [
    {
      "url": "https://opsblu.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "apiKey": []
    },
    {
      "bearer": []
    },
    {}
  ],
  "tags": [
    {
      "name": "Aggregates",
      "description": "Free. Counts only, small counts rendered as \"<5\"."
    },
    {
      "name": "Businesses",
      "description": "Search is free (names + signals). Opening a record bills credits."
    },
    {
      "name": "Changes",
      "description": "What changed in a territory since a timestamp."
    },
    {
      "name": "Exports",
      "description": "Two-step: create (estimate) then confirm (charge)."
    },
    {
      "name": "Tools",
      "description": "Report card, removal requests, sample pages."
    },
    {
      "name": "Account",
      "description": "Credits, billing, keys, territories."
    },
    {
      "name": "Technology",
      "description": "Infrasight technology intelligence. Counts are free; lists of domains and change feeds bill 3 credits per domain, once per domain per calendar month."
    }
  ],
  "paths": {
    "/v1/coverage": {
      "get": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Collection-wide counters and covered cities",
        "security": [
          {}
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Coverage"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "include_sample",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true"
              ]
            },
            "description": "Also return fixture (synthetic) numbers, labelled source \"sample\", for areas without live data."
          }
        ]
      }
    },
    "/v1/stats": {
      "get": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Aggregate stats for a state, city or city × category",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "oregon"
            }
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "portland"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "dentists"
            }
          },
          {
            "name": "include_sample",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true"
              ]
            },
            "description": "Also return fixture (synthetic) numbers, labelled source \"sample\", for areas without live data."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            }
          },
          "404": {
            "description": "not_found (unknown scope) or not_covered_yet (a real area the crawl has not reached; pass include_sample=1 for sample numbers)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A state without a row in leads.state_stats_latest (or a city of a live state missing from leads.city_stats) answers 404 {\"error\":\"not_covered_yet\"} unless include_sample=1, which returns the fixture labelled source \"sample\". When the cluster is down every answer is the fixture, labelled \"sample\"."
      }
    },
    "/v1/stats/history": {
      "get": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Per-day crawl counters for one state (live data only)",
        "description": "One point per day from the crawl ledger, oldest first. Answers 503 live_data_unavailable when the API is running on fixtures or the ScyllaDB cluster is unreachable.",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "OR"
            },
            "description": "Two-letter code or slug (OR, oregon)"
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 1,
              "maximum": 365
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsHistory"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "description": "Live data unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stats/polygon": {
      "post": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Aggregate stats inside a drawn boundary",
        "security": [
          {}
        ],
        "description": "The polygon is snapped to H3 cells server-side. Minimum area ~0.5 km². Hex counts under 5 come back as \"<5\".",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "geojson"
                ],
                "properties": {
                  "geojson": {
                    "type": "object"
                  },
                  "categories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "persona": {
                    "type": "string",
                    "enum": [
                      "web",
                      "seo",
                      "ppc",
                      "opening"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            }
          }
        }
      }
    },
    "/v1/categories": {
      "get": {
        "tags": [
          "Aggregates"
        ],
        "summary": "Controlled category vocabulary with national counts",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "OR"
            },
            "description": "With live data: the scraper's category terms for one state from leads.category_stats (slugified, counts <5 suppressed), with source: \"live\". Otherwise, or when the table is absent, the fixture vocabulary."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "categories": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CategoryCount"
                      }
                    },
                    "state": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "live"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/businesses": {
      "get": {
        "tags": [
          "Businesses"
        ],
        "summary": "Search businesses (free: names + signals, no contacts)",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zip",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Name contains"
          },
          {
            "name": "no_website",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "cwv_fail",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "wordpress",
                "wix",
                "squarespace",
                "shopify",
                "other"
              ]
            }
          },
          {
            "name": "has_ads",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_analytics",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "server_side",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "new_days",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "changed_days",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "has_phone",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "has_email",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "hot",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessPage"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/SlowDown"
          }
        }
      }
    },
    "/v1/businesses/{id}": {
      "get": {
        "tags": [
          "Businesses"
        ],
        "summary": "Open a full record (billed once per month)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "record": {
                      "$ref": "#/components/schemas/Business"
                    },
                    "credits_used": {
                      "type": "integer"
                    },
                    "balance_remaining": {
                      "type": "integer"
                    },
                    "already_revealed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/changes": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Change events since a timestamp",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Default: 7 days ago"
          },
          {
            "name": "territory_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "types",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma list: new_business, site_launched, platform_changed, pixel_added, pixel_removed, closed"
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "since": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChangeEvent"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/exports": {
      "post": {
        "tags": [
          "Exports"
        ],
        "summary": "Create an export and get a credit estimate (nothing charged yet)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filters": {
                    "$ref": "#/components/schemas/Filters"
                  },
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 5000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, status pending_confirm",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Export"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "List exports",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exports": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Export"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/exports/{id}": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Get an export",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Export"
                }
              }
            }
          }
        }
      }
    },
    "/v1/exports/{id}/confirm": {
      "post": {
        "tags": [
          "Exports"
        ],
        "summary": "Confirm and charge; makes the CSV available",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Export"
                }
              }
            }
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    },
    "/v1/exports/{id}/download": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Download CSV",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/report-card": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Score a business website",
        "security": [
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "business": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/report-card/{id}": {
      "get": {
        "tags": [
          "Tools"
        ],
        "summary": "Get a report card",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCard"
                }
              }
            }
          }
        }
      }
    },
    "/v1/removal-requests": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Ask us to remove a business",
        "security": [
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "business_name",
                  "requester_email"
                ],
                "properties": {
                  "business_name": {
                    "type": "string"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  },
                  "requester_email": {
                    "type": "string",
                    "format": "email"
                  },
                  "relationship": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "employee",
                      "other"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ticket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemovalRequest"
                }
              }
            }
          }
        }
      }
    },
    "/v1/samples/{token}": {
      "get": {
        "tags": [
          "Tools"
        ],
        "summary": "Outreach sample page payload (noindex)",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. Records never carry phone numbers or emails (sample links get forwarded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sample"
                }
              }
            }
          },
          "410": {
            "description": "Expired"
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Current account and balance",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/connect-bonus": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Claim the +750 connect bonus (MCP/API/TagFrog)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "enum": [
                      "mcp",
                      "api",
                      "tagfrog"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "409": {
            "description": "Already granted"
          }
        }
      }
    },
    "/v1/billing/topup": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Start a credit top-up",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount"
                ],
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 20
                  },
                  "return_path": {
                    "type": "string",
                    "description": "Path on the calling site to come back to (default /app/billing)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkout_url": {
                      "type": "string"
                    },
                    "session_id": {
                      "type": "string"
                    },
                    "item": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Amounts of 20/50/100/250 buy the matching credit pack (same as POST /v1/billing/checkout with item credits_<n>); any other amount from $20 uses an inline price. Without Stripe configured the Phase 0 payment links are returned (`mode: payment_link`)."
      }
    },
    "/v1/billing/spend-cap": {
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Set the monthly spend cap",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "monthly_usd": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/ledger": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Credit ledger",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LedgerEntry"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/keys": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Create an API key (secret shown once)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "spend_cap": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKey"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "List keys",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/keys/{id}": {
      "delete": {
        "tags": [
          "Account"
        ],
        "summary": "Revoke a key",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          }
        }
      }
    },
    "/v1/territories": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Save a territory",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Territory"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      },
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "List territories",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/territories/{id}": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Get a territory",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "put": {
        "tags": [
          "Account"
        ],
        "summary": "Update a territory / alerts",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Account"
        ],
        "summary": "Delete a territory",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/tech": {
      "get": {
        "tags": [
          "Technology"
        ],
        "summary": "Technology index (free): every technology with sites, local_sites, added_30d, removed_30d",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Name contains"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "technologies": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TechCount"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "computed_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "source": {
                      "type": "string"
                    },
                    "price": {
                      "$ref": "#/components/schemas/TechPrice"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/SlowDown"
          },
          "503": {
            "$ref": "#/components/responses/TechUnavailable"
          }
        }
      }
    },
    "/v1/tech/{technology}": {
      "get": {
        "tags": [
          "Technology"
        ],
        "summary": "One technology (free): counts + sites by state, suppressed under 5",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "technology",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "wordpress"
            },
            "description": "Name or slug"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TechDetail"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/SlowDown"
          },
          "503": {
            "$ref": "#/components/responses/TechUnavailable"
          }
        }
      }
    },
    "/v1/tech/{technology}/sites": {
      "get": {
        "tags": [
          "Technology"
        ],
        "summary": "Domains running a technology (paid: 3 credits per domain, once per domain per month)",
        "description": "Each domain returned is a record and goes through the same reveal path as GET /v1/businesses/{id}: 3 credits ($0.03), billed once per domain per calendar month, free to re-open. Anonymous callers get the counts and the price with a 402. Removal tickets suppress a domain here immediately.",
        "parameters": [
          {
            "name": "technology",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "wordpress"
            },
            "description": "Name or slug"
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "OR"
            },
            "description": "Two-letter state"
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "next_cursor from the previous page"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TechSitePage"
                }
              }
            }
          },
          "402": {
            "$ref": "#/components/responses/TechPaymentRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/SlowDown"
          },
          "503": {
            "$ref": "#/components/responses/TechUnavailable"
          }
        }
      }
    },
    "/v1/tech/{technology}/changes": {
      "get": {
        "tags": [
          "Technology"
        ],
        "summary": "Domains that added / removed / re-versioned a technology since a date (paid per domain)",
        "description": "One row per change, newest day first, window capped at 90 days. A domain that changed twice is one record (billed once). Same billing as /sites.",
        "parameters": [
          {
            "name": "technology",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "wordpress"
            },
            "description": "Name or slug"
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-10-01"
            },
            "description": "Default 30 days ago"
          },
          {
            "name": "change",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "added",
                "removed",
                "version"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TechChangePage"
                }
              }
            }
          },
          "400": {
            "description": "Bad change filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "$ref": "#/components/responses/TechPaymentRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/SlowDown"
          },
          "503": {
            "$ref": "#/components/responses/TechUnavailable"
          }
        }
      }
    },
    "/v1/sites/{domain}/tech": {
      "get": {
        "tags": [
          "Technology"
        ],
        "summary": "Current technologies and scan history for one domain (free)",
        "description": "The caller supplied the domain, so nothing is revealed; this is the top of the funnel behind the Infrasight tool. 404 for domains never scanned or under a removal ticket.",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "example.com"
            },
            "description": "Domain or URL"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteTech"
                }
              }
            }
          },
          "400": {
            "description": "Not a domain",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/SlowDown"
          },
          "503": {
            "$ref": "#/components/responses/TechUnavailable"
          }
        }
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Start a Stripe Checkout for a catalogue item",
        "description": "Signed-in buyers get their account's Stripe customer (created on first use). One-time items with `allow_anonymous` (credit packs, GTM containers) may be bought without signing in: Stripe collects the email and the webhook creates or links the account by that email. Success and cancel URLs go back to the calling site (Origin header; opsblu.com and bluefroganalytics.com are accepted, anything else falls back to opsblu.com) at `return_path` with `?checkout=success&item=<key>&session_id=...` or `?checkout=cancelled&item=<key>`. CORS: allowed from bluefroganalytics.com.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "item"
                ],
                "properties": {
                  "item": {
                    "type": "string",
                    "description": "Catalogue key, e.g. territory, agency, tagfrog_pro, website, gtm_container, credits_50"
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Stores / sites / territories for per-unit items (tagfrog_pro, agency_tagfrog_pro, territory_extra); 1 otherwise"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Up to 10 keys ([a-z0-9_], values up to 200 chars), copied to the Stripe session and subscription and onto the entitlement (e.g. store_domain). account_id, item, quantity, site are reserved."
                  },
                  "return_path": {
                    "type": "string",
                    "description": "Path on the calling site (default /app/billing)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Checkout session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkout_url": {
                      "type": "string"
                    },
                    "session_id": {
                      "type": "string"
                    },
                    "item": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_request / bad_quantity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "auth_required: subscriptions need a signed-in account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_required: e.g. agency_tagfrog_pro needs an active Agency plan, territory_extra a Territory or Agency plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "unknown_item",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "not_available: listed but not on sale yet (watch, store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "stripe_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "billing_unavailable: STRIPE_SECRET_KEY not set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/portal": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Open the Stripe Customer Portal",
        "description": "Manage cards, invoices, plan quantity and cancellation (at period end). CORS: allowed from bluefroganalytics.com.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "return_path": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "portal_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "no_billing_account: nothing bought yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "billing_unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/catalogue": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "What is for sale (pricing pages of both sites)",
        "security": [
          {}
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CatalogueItem"
                      }
                    },
                    "currency": {
                      "type": "string"
                    },
                    "checkout_enabled": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/entitlements": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Plans and one-time purchases of the signed-in account",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entitlements": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Entitlement"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/billing/webhook": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Stripe webhook (Stripe only)",
        "security": [
          {}
        ],
        "description": "Verifies `Stripe-Signature` (v1 HMAC-SHA256, 5 minute tolerance; 503 when STRIPE_WEBHOOK_SECRET is unset), processes each event id once. Handles checkout.session.completed / async_payment_succeeded (credit packs to the ledger, one-time items and subscriptions to entitlements, manual-fulfilment orders posted to Discord), invoice.paid, invoice.payment_failed, customer.subscription.updated / deleted (state re-read from Stripe, so out-of-order delivery cannot regress it). Non-2xx makes Stripe retry.",
        "responses": {
          "200": {
            "description": "Processed or duplicate"
          },
          "400": {
            "description": "bad_signature / bad_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "in_progress: another worker holds the event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "processing_failed: retried by Stripe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "webhook_unconfigured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer ob_live_… (create keys at /app/api-keys)"
      },
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Firebase ID token (Firebase Auth email link or Google, one project for opsblu.com and bluefroganalytics.com, so one account on both sites). Verified against the securetoken JWKS: RS256, aud = the project id, verified email required. The first sign-in creates the account (250 free credits for business-email domains, one grant per domain)."
      }
    },
    "responses": {
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Sign in or pass an API key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Insufficient credits or spend cap reached",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "SlowDown": {
        "description": "Rate limited. Back off for retry_after seconds.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TechUnavailable": {
        "description": "Technology data unavailable (cluster down or tables not created yet)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TechPaymentRequired": {
        "description": "Unpaid: counts and the price, never domains",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TechPaymentRequired"
            }
          }
        }
      }
    },
    "schemas": {
      "Count": {
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "string",
            "enum": [
              "<5"
            ]
          }
        ],
        "description": "Counts under 5 are suppressed as \"<5\"."
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retry_after": {
            "type": "integer"
          }
        }
      },
      "Coverage": {
        "type": "object",
        "properties": {
          "businesses_total": {
            "type": "integer"
          },
          "added_today": {
            "type": "integer"
          },
          "cities_covered": {
            "type": "integer"
          },
          "new_this_week": {
            "type": "integer"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "cities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "state": {
                  "type": "string"
                },
                "state_slug": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "city_slug": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "sweeping",
                    "planned",
                    "live"
                  ]
                },
                "businesses_total": {
                  "$ref": "#/components/schemas/Count"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "with_website": {
                  "$ref": "#/components/schemas/Count",
                  "description": "live cities only"
                },
                "with_phone": {
                  "$ref": "#/components/schemas/Count",
                  "description": "live cities only"
                },
                "latitude": {
                  "type": "number",
                  "description": "city centroid (live cities only; never a business location)"
                },
                "longitude": {
                  "type": "number"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "live",
                    "sample"
                  ],
                  "description": "\"live\" for a leads.city_stats row, \"sample\" for a fixture city (render as a sample, never as data)."
                }
              }
            },
            "description": "With live data: only cities of states that have a crawl-ledger row (plus the fixture-only states' cities, source \"sample\", when include_sample=1)."
          },
          "source": {
            "type": "string",
            "enum": [
              "live",
              "sample"
            ],
            "description": "Where the numbers come from: \"live\" (crawl ledger in ScyllaDB; see sample_fields for what is still fixture) or \"sample\" (synthetic fixture numbers: no live data configured, or the cluster is down). Fixture numbers are never labelled live."
          },
          "states": {
            "type": "array",
            "description": "Live only: per-state crawl ledger. Lists only states with a row in leads.state_stats_latest; include_sample=1 appends fixture-only states with status and source \"sample\".",
            "items": {
              "$ref": "#/components/schemas/CoverageState"
            }
          },
          "rate_per_hour": {
            "type": "number",
            "description": "Businesses added per hour over the newest window of rate_window_minutes (0 on fixtures, and 0 when the ledger is older than 2 hours = crawl stopped)."
          },
          "rate_window_minutes": {
            "type": "integer"
          },
          "stats_computed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Anchor for projecting rate_per_hour (live only)."
          },
          "sample_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Live responses only: fields still carrying fixture data (\"cities\" when leads.city_stats was unreadable and the fixture cities of live states were kept). Omitted when everything is live, and on sample responses."
          }
        }
      },
      "CoverageState": {
        "type": "object",
        "description": "Per-state crawl counters (aggregates only).",
        "properties": {
          "state": {
            "type": "string",
            "example": "OR"
          },
          "state_slug": {
            "type": "string",
            "example": "oregon"
          },
          "name": {
            "type": "string"
          },
          "businesses_total": {
            "$ref": "#/components/schemas/Count"
          },
          "with_website": {
            "$ref": "#/components/schemas/Count"
          },
          "with_phone": {
            "$ref": "#/components/schemas/Count"
          },
          "new_today": {
            "$ref": "#/components/schemas/Count"
          },
          "cities": {
            "type": "integer"
          },
          "categories": {
            "type": "integer"
          },
          "jobs_done": {
            "type": "integer"
          },
          "jobs_total": {
            "type": "integer"
          },
          "crawl_progress": {
            "type": "number",
            "description": "jobs_done / jobs_total, 0..1"
          },
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "sweeping",
              "planned",
              "sample"
            ]
          },
          "computed_at": {
            "type": "string",
            "format": "date-time"
          },
          "rate_per_hour": {
            "type": "number"
          },
          "rate_window_minutes": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "live",
              "sample"
            ]
          }
        }
      },
      "LiveStats": {
        "type": "object",
        "description": "Raw crawl counters attached to Stats when source is \"live\". top_categories are scraper search terms, not the controlled slug vocabulary.",
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "live"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "national",
              "state",
              "city",
              "city_category"
            ]
          },
          "total": {
            "$ref": "#/components/schemas/Count"
          },
          "with_website": {
            "$ref": "#/components/schemas/Count"
          },
          "with_phone": {
            "$ref": "#/components/schemas/Count"
          },
          "with_place_id": {
            "$ref": "#/components/schemas/Count"
          },
          "with_coords": {
            "$ref": "#/components/schemas/Count"
          },
          "new_today": {
            "$ref": "#/components/schemas/Count"
          },
          "cities": {
            "type": "integer"
          },
          "categories": {
            "type": "integer"
          },
          "top_categories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string"
                },
                "count": {
                  "$ref": "#/components/schemas/Count"
                }
              }
            }
          },
          "jobs_done": {
            "type": "integer"
          },
          "jobs_total": {
            "type": "integer"
          },
          "crawl_progress": {
            "type": "number"
          },
          "states": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CoverageState"
            }
          },
          "enriched": {
            "$ref": "#/components/schemas/Count",
            "description": "city_category only: value written to depth.enriched (rows whose domain has an opsblu.site_enrichments row; extrapolated when enriched_sampled)"
          },
          "enriched_domains": {
            "type": "integer",
            "description": "distinct domains in scope"
          },
          "enriched_checked": {
            "type": "integer",
            "description": "domains looked up (capped at 5000)"
          },
          "enriched_hits": {
            "type": "integer",
            "description": "of enriched_checked, domains with a site_enrichments row"
          },
          "enriched_sampled": {
            "type": "boolean",
            "description": "true when the scope had more than 5000 domains and the ratio was extrapolated"
          },
          "enriched_known": {
            "type": "boolean",
            "description": "false when the site_enrichments lookup failed; depth.enriched then keeps the fixture value"
          },
          "computed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StatsHistory": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "example": "OR"
          },
          "state_slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "days": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "live"
            ]
          },
          "points": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "total": {
                  "$ref": "#/components/schemas/Count"
                },
                "with_website": {
                  "$ref": "#/components/schemas/Count"
                },
                "with_phone": {
                  "$ref": "#/components/schemas/Count"
                },
                "new_rows": {
                  "$ref": "#/components/schemas/Count"
                },
                "cities": {
                  "type": "integer"
                },
                "categories": {
                  "type": "integer"
                },
                "jobs_done": {
                  "type": "integer"
                },
                "jobs_total": {
                  "type": "integer"
                },
                "computed_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "Depth": {
        "type": "object",
        "properties": {
          "phones": {
            "$ref": "#/components/schemas/Count"
          },
          "websites": {
            "$ref": "#/components/schemas/Count"
          },
          "emails": {
            "$ref": "#/components/schemas/Count"
          },
          "ads": {
            "$ref": "#/components/schemas/Count"
          },
          "cwv_fail": {
            "$ref": "#/components/schemas/Count"
          },
          "no_website": {
            "$ref": "#/components/schemas/Count"
          },
          "new_90d": {
            "$ref": "#/components/schemas/Count"
          },
          "enriched": {
            "$ref": "#/components/schemas/Count"
          }
        }
      },
      "CategoryCount": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "count": {
            "$ref": "#/components/schemas/Count"
          }
        }
      },
      "Stats": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Count"
          },
          "depth": {
            "$ref": "#/components/schemas/Depth"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategoryCount"
            }
          },
          "platforms": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Count"
            }
          },
          "tracking": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Count"
            }
          },
          "new_by_month": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "month": {
                  "type": "string"
                },
                "count": {
                  "$ref": "#/components/schemas/Count"
                }
              }
            }
          },
          "hexes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "h3": {
                  "type": "string"
                },
                "count": {
                  "$ref": "#/components/schemas/Count"
                }
              }
            }
          },
          "suppressed": {
            "type": "boolean"
          },
          "coverage_complete": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string",
            "enum": [
              "live",
              "sample"
            ],
            "description": "Where the numbers come from: \"live\" (crawl ledger in ScyllaDB; see sample_fields for what is still fixture) or \"sample\" (synthetic fixture numbers: no live data configured, or the cluster is down). Fixture numbers are never labelled live."
          },
          "sample_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "depth.emails",
              "depth.ads",
              "depth.cwv_fail",
              "depth.new_90d",
              "depth.enriched",
              "categories",
              "platforms",
              "tracking",
              "new_by_month",
              "hexes"
            ],
            "description": "Live responses only: the fields that are NOT live (fixture values, or zero placeholders where the fixture set has none). Chip them as sample. National live responses also empty new_by_month and zero depth.new_90d (both listed). city adds coverage_complete; city x category adds depth.phones and coverage_complete and drops depth.enriched when the site_enrichments join succeeded."
          },
          "live": {
            "$ref": "#/components/schemas/LiveStats"
          },
          "rate_per_hour": {
            "type": "number",
            "description": "national / state scope, live only (0 on fixtures)"
          },
          "rate_window_minutes": {
            "type": "integer"
          },
          "stats_computed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Signals": {
        "type": "object",
        "properties": {
          "hot": {
            "type": "boolean"
          },
          "new_in_days": {
            "type": "integer"
          },
          "changed": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "no_website": {
            "type": "boolean"
          },
          "cwv_fail": {
            "type": "boolean"
          },
          "ads_no_tracking": {
            "type": "boolean"
          }
        }
      },
      "BusinessSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "category_slug": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "signals": {
            "$ref": "#/components/schemas/Signals"
          },
          "has_phone": {
            "type": "boolean"
          },
          "has_email": {
            "type": "boolean"
          },
          "has_website": {
            "type": "boolean"
          },
          "platform": {
            "type": "string"
          },
          "revealed": {
            "type": "boolean"
          }
        }
      },
      "CostEstimate": {
        "type": "object",
        "properties": {
          "records": {
            "type": "integer"
          },
          "hot_records": {
            "type": "integer"
          },
          "already_revealed": {
            "type": "integer"
          },
          "credits": {
            "type": "integer"
          },
          "usd": {
            "type": "number"
          }
        }
      },
      "BusinessPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessSummary"
            }
          },
          "total": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string"
          },
          "estimate": {
            "$ref": "#/components/schemas/CostEstimate"
          }
        }
      },
      "CWV": {
        "type": "object",
        "properties": {
          "lcp": {
            "type": "number"
          },
          "cls": {
            "type": "number"
          },
          "inp": {
            "type": "number"
          },
          "pass": {
            "type": "boolean"
          }
        }
      },
      "SEO": {
        "type": "object",
        "properties": {
          "title": {
            "type": "boolean"
          },
          "meta": {
            "type": "boolean"
          },
          "h1": {
            "type": "boolean"
          },
          "schema": {
            "type": "boolean"
          },
          "sitemap": {
            "type": "boolean"
          },
          "robots": {
            "type": "boolean"
          }
        }
      },
      "Marketing": {
        "type": "object",
        "properties": {
          "analytics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ads_platforms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pixels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "server_side_tracking": {
            "type": "boolean"
          },
          "consent_tool": {
            "type": "string"
          }
        }
      },
      "Business": {
        "type": "object",
        "description": "Full paid record. No reviews, ratings or photos.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "subcategories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "address": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "phone": {
            "type": "string"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "website": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "socials": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_verified_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "closed",
              "unknown"
            ]
          },
          "web": {
            "type": "object",
            "properties": {
              "has_website": {
                "type": "boolean"
              },
              "platform": {
                "type": "string"
              },
              "cwv": {
                "$ref": "#/components/schemas/CWV"
              },
              "seo": {
                "$ref": "#/components/schemas/SEO"
              },
              "ssl_issued_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "marketing": {
            "$ref": "#/components/schemas/Marketing"
          },
          "signals": {
            "$ref": "#/components/schemas/Signals"
          }
        }
      },
      "Filters": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "q": {
            "type": "string"
          },
          "no_website": {
            "type": "boolean"
          },
          "cwv_fail": {
            "type": "boolean"
          },
          "platform": {
            "type": "string"
          },
          "has_ads": {
            "type": "boolean"
          },
          "has_analytics": {
            "type": "boolean"
          },
          "server_side": {
            "type": "boolean"
          },
          "new_days": {
            "type": "integer"
          },
          "changed_days": {
            "type": "integer"
          },
          "has_phone": {
            "type": "boolean"
          },
          "has_email": {
            "type": "boolean"
          },
          "hot": {
            "type": "boolean"
          },
          "territory_id": {
            "type": "string"
          }
        }
      },
      "ChangeEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "business": {
            "$ref": "#/components/schemas/BusinessSummary"
          }
        }
      },
      "Export": {
        "type": "object",
        "properties": {
          "export_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_confirm",
              "ready",
              "expired"
            ]
          },
          "filters": {
            "$ref": "#/components/schemas/Filters"
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "estimate": {
            "$ref": "#/components/schemas/CostEstimate"
          },
          "estimated_credits": {
            "type": "integer"
          },
          "credits_used": {
            "type": "integer"
          },
          "rows": {
            "type": "integer"
          },
          "format": {
            "type": "string"
          },
          "download_url": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "confirmed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReportCard": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "cwv_mobile": {
            "$ref": "#/components/schemas/CWV"
          },
          "cwv_desktop": {
            "$ref": "#/components/schemas/CWV"
          },
          "seo": {
            "$ref": "#/components/schemas/SEO"
          },
          "platform": {
            "type": "string"
          },
          "tech_stack": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "marketing": {
            "$ref": "#/components/schemas/Marketing"
          },
          "tracking_health": {
            "type": "object",
            "properties": {
              "score": {
                "type": "integer"
              },
              "issues": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "comparison": {
            "type": "object",
            "properties": {
              "category": {
                "type": "string"
              },
              "zip": {
                "type": "string"
              },
              "peer_count": {
                "$ref": "#/components/schemas/Count"
              },
              "peer_cwv_pass_rate": {
                "type": "number"
              },
              "peer_ads_rate": {
                "type": "number"
              },
              "peer_server_side_rate": {
                "type": "number"
              }
            }
          }
        }
      },
      "RemovalRequest": {
        "type": "object",
        "properties": {
          "ticket_id": {
            "type": "string"
          },
          "business_name": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "requester_email": {
            "type": "string"
          },
          "relationship": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "applies_by": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "business_email": {
            "type": "boolean"
          },
          "credits_balance": {
            "type": "integer",
            "description": "1 credit = $0.01"
          },
          "free_credits": {
            "type": "integer"
          },
          "free_credits_expire_at": {
            "type": "string",
            "format": "date-time"
          },
          "spend_cap": {
            "type": "number",
            "description": "USD per month, 0 = none"
          },
          "spent_this_month_usd": {
            "type": "number"
          },
          "connect_bonus_granted": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "firebase_uid": {
            "type": "string",
            "description": "Firebase user linked to this account (absent until the first sign-in of an account created by a purchase)."
          },
          "stripe_customer_id": {
            "type": "string",
            "description": "The account's Stripe customer (absent before the first checkout)."
          }
        }
      },
      "LedgerEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "type": "string",
            "enum": [
              "grant",
              "topup",
              "reveal",
              "export",
              "expiry",
              "adjustment"
            ]
          },
          "credits": {
            "type": "integer"
          },
          "balance_after": {
            "type": "integer"
          },
          "note": {
            "type": "string"
          },
          "ref_id": {
            "type": "string"
          }
        }
      },
      "APIKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "secret": {
            "type": "string",
            "description": "Only returned on create"
          },
          "spend_cap": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked": {
            "type": "boolean"
          }
        }
      },
      "Territory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "city",
              "zip",
              "polygon"
            ]
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          },
          "geojson": {
            "type": "object"
          },
          "alerts": {
            "type": "object",
            "properties": {
              "email": {
                "type": "boolean"
              },
              "slack_webhook": {
                "type": "string"
              },
              "webhook": {
                "type": "string"
              },
              "types": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cadence": {
                "type": "string",
                "enum": [
                  "daily",
                  "weekly"
                ]
              }
            }
          }
        }
      },
      "TechPrice": {
        "type": "object",
        "description": "What a paid technology list costs.",
        "properties": {
          "credits_per_domain": {
            "type": "integer",
            "example": 3
          },
          "usd_per_domain": {
            "type": "number",
            "example": 0.03
          },
          "billed_once_per": {
            "type": "string",
            "example": "domain per calendar month"
          }
        }
      },
      "TechCount": {
        "type": "object",
        "properties": {
          "technology": {
            "type": "string",
            "example": "WordPress"
          },
          "slug": {
            "type": "string",
            "example": "wordpress"
          },
          "sites": {
            "$ref": "#/components/schemas/Count"
          },
          "local_sites": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Count"
              },
              {
                "type": "null"
              }
            ],
            "description": "How many of sites are local businesses (domain present in leads.business_domains), from the rollup; null when it could not be computed."
          },
          "added_30d": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Count"
              },
              {
                "type": "null"
              }
            ],
            "description": "Domains that added the technology in the last 30 days; null (not 0) until the change history covers a full 30-day window (history_since + 30 days); until then \"nothing recorded yet\" is not \"nothing changed\"."
          },
          "removed_30d": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Count"
              },
              {
                "type": "null"
              }
            ],
            "description": "Domains that dropped the technology in the last 30 days; null (not 0) until the change history covers a full 30-day window (history_since + 30 days); until then \"nothing recorded yet\" is not \"nothing changed\"."
          },
          "computed_at": {
            "type": "string",
            "format": "date-time"
          },
          "history_since": {
            "type": "string",
            "format": "date",
            "example": "2026-10-27",
            "description": "First day technology changes were recorded. Omitted when the rollup predates it."
          }
        }
      },
      "TechStateCount": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "example": "OR"
          },
          "sites": {
            "$ref": "#/components/schemas/Count"
          }
        }
      },
      "TechDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TechCount"
          },
          {
            "type": "object",
            "properties": {
              "by_state": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TechStateCount"
                },
                "description": "Sites per state from the rollup table tech_state_counts (one partition read; a tech_sites scan only while that table is empty). States come from tech_sites.state, filled from leads.business_domains when the technology was first seen on the domain, so the sum can be slightly below local_sites."
              },
              "source": {
                "type": "string",
                "example": "live"
              }
            }
          }
        ]
      },
      "TechSite": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "first_seen": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "string"
          },
          "confidence": {
            "type": "integer",
            "description": "0-100"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "revealed": {
            "type": "boolean",
            "description": "Already billed this month before this call"
          }
        }
      },
      "TechSitePage": {
        "type": "object",
        "properties": {
          "technology": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "sites": {
            "$ref": "#/components/schemas/Count"
          },
          "state": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TechSite"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass as ?cursor= for the next page"
          },
          "truncated": {
            "type": "boolean",
            "description": "Credits ran out mid-page; next_cursor resumes"
          },
          "credits_used": {
            "type": "integer"
          },
          "balance_remaining": {
            "type": "integer"
          },
          "price": {
            "$ref": "#/components/schemas/TechPrice"
          }
        }
      },
      "TechChange": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "changed_on": {
            "type": "string",
            "format": "date"
          },
          "change": {
            "type": "string",
            "enum": [
              "added",
              "removed",
              "version"
            ]
          },
          "from_version": {
            "type": "string"
          },
          "to_version": {
            "type": "string"
          },
          "scanned_at": {
            "type": "string",
            "format": "date-time"
          },
          "revealed": {
            "type": "boolean"
          }
        }
      },
      "TechChangePage": {
        "type": "object",
        "properties": {
          "technology": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "since": {
            "type": "string",
            "format": "date"
          },
          "change": {
            "type": "string"
          },
          "sites": {
            "$ref": "#/components/schemas/Count"
          },
          "added_30d": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Count"
              },
              {
                "type": "null"
              }
            ],
            "description": "null (not 0) until the change history covers a full 30-day window (history_since + 30 days); until then \"nothing recorded yet\" is not \"nothing changed\"."
          },
          "removed_30d": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Count"
              },
              {
                "type": "null"
              }
            ],
            "description": "null (not 0) until the change history covers a full 30-day window (history_since + 30 days); until then \"nothing recorded yet\" is not \"nothing changed\"."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TechChange"
            }
          },
          "truncated": {
            "type": "boolean"
          },
          "credits_used": {
            "type": "integer"
          },
          "balance_remaining": {
            "type": "integer"
          },
          "price": {
            "$ref": "#/components/schemas/TechPrice"
          },
          "history_since": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "SiteTech": {
        "type": "object",
        "description": "Current technologies and scan history for one domain (free: the caller supplied the domain).",
        "properties": {
          "domain": {
            "type": "string"
          },
          "scanned_at": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string"
          },
          "techs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "confidence": {
                  "type": "integer"
                },
                "categories": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scanned_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "source": {
                  "type": "string"
                },
                "added": {
                  "description": "JSON as written by the scanner"
                },
                "removed": {},
                "changed": {}
              }
            }
          }
        }
      },
      "TechPaymentRequired": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Error"
          },
          {
            "type": "object",
            "properties": {
              "technology": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "sites": {
                "$ref": "#/components/schemas/Count"
              },
              "added_30d": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Count"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "null (not 0) until the change history covers a full 30-day window (history_since + 30 days); until then \"nothing recorded yet\" is not \"nothing changed\"."
              },
              "removed_30d": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Count"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "null (not 0) until the change history covers a full 30-day window (history_since + 30 days); until then \"nothing recorded yet\" is not \"nothing changed\"."
              },
              "price": {
                "$ref": "#/components/schemas/TechPrice"
              },
              "signup_url": {
                "type": "string"
              },
              "estimate": {
                "$ref": "#/components/schemas/CostEstimate",
                "description": "Only when signed in and short of credits"
              },
              "history_since": {
                "type": "string",
                "format": "date"
              }
            }
          }
        ]
      },
      "Entitlement": {
        "type": "object",
        "description": "Something the account bought: a subscription or a one-time purchase. Credit packs go to the ledger instead.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Stripe subscription id, or `<checkout session id>:<item>` for one-time items"
          },
          "item": {
            "type": "string",
            "description": "Catalogue key, see GET /v1/billing/catalogue"
          },
          "kind": {
            "type": "string",
            "enum": [
              "subscription",
              "one_time"
            ]
          },
          "quantity": {
            "type": "integer",
            "description": "Stores / sites / territories for per-unit items, else 1"
          },
          "status": {
            "type": "string",
            "description": "Stripe subscription status (active, trialing, past_due, unpaid, canceled, incomplete) or `paid` for one-time items. active, trialing, past_due and paid grant access."
          },
          "current_period_end": {
            "type": "string",
            "format": "date-time"
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "stripe_customer_id": {
            "type": "string"
          },
          "stripe_subscription_id": {
            "type": "string"
          },
          "stripe_session_id": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Caller metadata from checkout (e.g. store_domain)"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CatalogueItem": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "brand": {
            "type": "string",
            "enum": [
              "opsblu",
              "bluefrog"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "credits",
              "subscription",
              "one_time"
            ]
          },
          "prices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lookup_key": {
                  "type": "string"
                },
                "unit_amount": {
                  "type": "integer",
                  "description": "US cents"
                },
                "interval": {
                  "type": "string",
                  "enum": [
                    "month"
                  ]
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "recurring",
                    "setup",
                    "one_time"
                  ]
                },
                "nickname": {
                  "type": "string"
                }
              }
            }
          },
          "credits": {
            "type": "integer",
            "description": "Credit packs only"
          },
          "unit": {
            "type": "string",
            "description": "What quantity counts (store, site, territory); absent = quantity 1"
          },
          "max_quantity": {
            "type": "integer"
          },
          "purchasable": {
            "type": "boolean",
            "description": "false = listed but not on sale yet (Watch, Store)"
          },
          "requires": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "An active entitlement to one of these items is required"
          },
          "allow_anonymous": {
            "type": "boolean",
            "description": "Checkout without signing in; Stripe collects the email and the account is created or linked by it"
          }
        }
      },
      "SampleRecord": {
        "description": "A business on a public sample page: the full record minus contacts. `phone` is never present and `emails` is always empty; `has_phone` / `has_email` say whether a paid reveal (GET /v1/businesses/{id}) would return them.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Business"
          },
          {
            "type": "object",
            "properties": {
              "has_phone": {
                "type": "boolean"
              },
              "has_email": {
                "type": "boolean"
              }
            }
          }
        ]
      },
      "Sample": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "agency": {
            "type": "string"
          },
          "niche": {
            "type": "string"
          },
          "category_slug": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "city_slug": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "state_slug": {
            "type": "string"
          },
          "angle": {
            "type": "string",
            "enum": [
              "no_website",
              "cwv_fail",
              "ads_no_tracking"
            ]
          },
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SampleRecord"
            }
          },
          "total_more": {
            "$ref": "#/components/schemas/Count"
          },
          "depth": {
            "$ref": "#/components/schemas/Depth"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "signup_url": {
            "type": "string"
          },
          "payment_url": {
            "type": "string"
          }
        }
      }
    }
  }
}
