{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/writavo-com/json-schema/writavo-com-internal-link-report-schema.json",
  "title": "InternalLinkReport",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/writavo-com-openapi.json#/components/schemas/InternalLinkReport",
  "type": "object",
  "required": [
    "under_linked_threshold",
    "list_limit",
    "summary",
    "orphans",
    "under_linked",
    "no_outbound",
    "pillars",
    "broken",
    "anchors",
    "anchor_concentration"
  ],
  "properties": {
    "under_linked_threshold": {
      "type": "integer"
    },
    "list_limit": {
      "type": "integer",
      "description": "The most rows any list holds."
    },
    "summary": {
      "type": "object",
      "required": [
        "published_articles",
        "internal_links",
        "external_links",
        "avg_inbound",
        "orphans",
        "under_linked",
        "no_outbound",
        "broken_internal",
        "broken_external",
        "external_checked",
        "generic_anchor_links",
        "last_checked_at"
      ],
      "properties": {
        "published_articles": {
          "type": "integer"
        },
        "internal_links": {
          "type": "integer",
          "description": "Links from one published article to another, self-links excluded."
        },
        "external_links": {
          "type": "integer"
        },
        "avg_inbound": {
          "type": "number"
        },
        "orphans": {
          "type": "integer"
        },
        "under_linked": {
          "type": "integer"
        },
        "no_outbound": {
          "type": "integer"
        },
        "broken_internal": {
          "type": "integer"
        },
        "broken_external": {
          "type": "integer"
        },
        "external_checked": {
          "type": "integer",
          "description": "External links with an HTTP check result so far."
        },
        "generic_anchor_links": {
          "type": "integer"
        },
        "last_checked_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Null until the first scan."
        }
      }
    },
    "orphans": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InternalLinkReportArticle"
      },
      "maxItems": 200
    },
    "under_linked": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InternalLinkReportArticle"
      },
      "maxItems": 200
    },
    "no_outbound": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InternalLinkReportArticle"
      },
      "maxItems": 200
    },
    "pillars": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InternalLinkReportArticle"
      },
      "maxItems": 25
    },
    "broken": {
      "type": "array",
      "maxItems": 200,
      "items": {
        "type": "object",
        "required": [
          "source_article_id",
          "target_url",
          "link_type",
          "reason"
        ],
        "properties": {
          "source_article_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "anchor_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "link_type": {
            "type": "string",
            "enum": [
              "internal",
              "external"
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "missing",
              "unpublished",
              "unreachable"
            ]
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "anchors": {
      "type": "array",
      "maxItems": 200,
      "items": {
        "type": "object",
        "required": [
          "anchor_text",
          "uses",
          "targets",
          "generic",
          "ambiguous"
        ],
        "properties": {
          "anchor_text": {
            "type": "string",
            "description": "Normalised (lower case, collapsed whitespace, outer punctuation trimmed)."
          },
          "uses": {
            "type": "integer"
          },
          "targets": {
            "type": "integer",
            "description": "Distinct articles this anchor links to."
          },
          "generic": {
            "type": "boolean",
            "description": "A phrase like \"click here\" or \"read more\"."
          },
          "ambiguous": {
            "type": "boolean",
            "description": "The same anchor links to more than one article."
          },
          "share_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Percent of all anchored internal links."
          }
        }
      }
    },
    "anchor_concentration": {
      "type": "array",
      "maxItems": 100,
      "description": "Articles with at least 3 anchored inbound links where one exact anchor carries 60% or more.",
      "items": {
        "type": "object",
        "required": [
          "target_article_id",
          "anchor_text",
          "uses",
          "target_links",
          "share"
        ],
        "properties": {
          "target_article_id": {
            "type": "string",
            "format": "uuid"
          },
          "target_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "anchor_text": {
            "type": "string"
          },
          "uses": {
            "type": "integer"
          },
          "target_links": {
            "type": "integer"
          },
          "share": {
            "type": "number",
            "description": "0 to 1."
          }
        }
      }
    }
  },
  "$defs": {
    "InternalLinkReportArticle": {
      "type": "object",
      "required": [
        "article_id",
        "title",
        "slug",
        "inbound",
        "outbound",
        "published_at"
      ],
      "properties": {
        "article_id": {
          "type": "string",
          "format": "uuid"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "slug": {
          "type": [
            "string",
            "null"
          ]
        },
        "inbound": {
          "type": "integer",
          "description": "Distinct published articles linking to this one."
        },
        "outbound": {
          "type": "integer",
          "description": "Distinct published articles this one links to."
        },
        "published_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}