{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/phishunt-io/json-schema/phishunt-io-related-response-schema.json",
  "title": "RelatedResponse",
  "description": "Related-infrastructure lookup result for a single uuid. Describes observed technical overlap between publicly detected phishing sites; not an attribution claim.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/phishunt-io-openapi.yml#/components/schemas/RelatedResponse",
  "type": "object",
  "properties": {
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "domain": {
      "type": "string"
    },
    "algorithm_version": {
      "type": [
        "string",
        "null"
      ],
      "description": "Correlation algorithm identifier; scores are not comparable across versions."
    },
    "generated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the correlation sidecar was last rebuilt (daily job)."
    },
    "cluster": {
      "type": [
        "object",
        "null"
      ],
      "description": "Present when this indicator belongs to a possible campaign / suspected cluster. Null when unclustered. No numeric `id` here (unlike CampaignSummary/Campaign) - this object was never a permalink target in its own right, so there is no back-compat reason to carry the ephemeral per-rebuild cluster id at all; `key` is the only identifier.",
      "properties": {
        "key": {
          "type": "string",
          "description": "Stable campaign identifier; use this for permalinks."
        },
        "size": {
          "type": "integer",
          "description": "Number of distinct registrable domains (Public Suffix List, private section included) in this cluster. Sibling subdomains of one domain count once; each platform tenant counts once."
        },
        "host_count": {
          "type": "integer",
          "description": "Number of hostnames (members.length)."
        },
        "url": {
          "type": "string",
          "description": "Link to the /campaigns/{key}/ page for this cluster. Only present when the cluster is live and not the low-confidence \"weak\" tier (weak clusters have no public campaign page - see GET /api/v1/campaigns)."
        }
      }
    },
    "count": {
      "type": "integer",
      "description": "Number of items in `results` (published high/medium confidence links only, after `min_score` and `limit`)."
    },
    "limit": {
      "type": "integer"
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RelatedIndicator"
      }
    }
  },
  "$defs": {
    "Evidence": {
      "type": "object",
      "description": "One shared signal contributing to a relationship score. `value` is display evidence only, not a claim about intent.",
      "properties": {
        "type": {
          "type": "string",
          "description": "Stable evidence-signal identifier, e.g. `same_ip`, `cert_fingerprint_exact`, `same_registrar`."
        },
        "value": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display value for this signal (e.g. the shared IP, cert fingerprint, or registrar name)."
        },
        "contributed": {
          "type": "integer",
          "description": "Points this signal contributed toward `relationship_score`. Entries sum to the total."
        }
      }
    },
    "RelatedIndicator": {
      "type": "object",
      "description": "A single related-infrastructure indicator, with the evidence linking it to the queried uuid.",
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid"
        },
        "domain": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Null when the indicator has been pruned from the live dataset (retention, or an FP takedown) - it is still listed for completeness (see `status`)."
        },
        "company": {
          "type": "string",
          "description": "Targeted brand slug."
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "offline",
            "no longer tracked"
          ],
          "description": "'active'/'offline' reflect a live Site row's own status; 'no longer tracked' means the uuid this edge points at no longer has a live Site row at all (retention, or an FP takedown) - distinct from 'offline', which still has one."
        },
        "first_seen": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Null under the same condition as `url`."
        },
        "relationship_score": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "evidence": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Evidence"
          }
        },
        "detail_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Null under the same condition as `url`."
        },
        "service_range": {
          "description": "The official provider IP range that contains the IP of this indicator, or null. Null for an indicator that is no longer tracked. It describes the network of the IP, not the indicator, and it is not a verdict.",
          "oneOf": [
            {
              "$ref": "#/$defs/ServiceRange"
            },
            {
              "type": "null"
            }
          ]
        },
        "url_only": {
          "type": "boolean",
          "description": "true when the host is shared infrastructure where only the URL path identifies the phishing link (URL shorteners, file hosts); block the full URL, never the domain."
        }
      }
    },
    "ServiceRange": {
      "type": "object",
      "description": "An IP address that sits inside an official IP range published by a provider (cloud, platform, mail sender, crawler). Context only, not a verdict: a hit says whose network the IP belongs to. It does not say that the indicator is safe or unsafe.",
      "properties": {
        "best": {
          "$ref": "#/$defs/ServiceRangeRecord"
        },
        "also": {
          "type": "array",
          "description": "Up to 3 more ranges from other sources that contain the same IP.",
          "items": {
            "$ref": "#/$defs/ServiceRangeRecord"
          }
        },
        "note": {
          "type": "string"
        }
      }
    },
    "ServiceRangeRecord": {
      "type": "object",
      "properties": {
        "prefix": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "service": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "bot",
            "user_fetcher",
            "mail",
            "service",
            "platform",
            "hosting"
          ]
        },
        "direction": {
          "type": "string"
        },
        "kind_label": {
          "type": "string"
        }
      }
    }
  }
}