{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/octolens-com/json-schema/octolens-com-keyword-health-response-schema.json",
  "title": "KeywordHealthResponse",
  "description": "One keyword's health: the noisy/budget verdict, weekly trend, what the noise is made of, pending AI suggestions and proposed exclude words / context — the same detector the `noisy_keyword` attention signal uses.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/octolens-com-openapi.json#/components/schemas/KeywordHealthResponse",
  "type": "object",
  "properties": {
    "keyword": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "keyword": {
          "type": "string"
        },
        "paused": {
          "type": "boolean"
        },
        "context": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "excludeWords": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "excludeAuthors": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "additionalTerms": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "platforms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "id",
        "keyword",
        "paused",
        "context",
        "excludeWords",
        "excludeAuthors",
        "additionalTerms",
        "platforms"
      ],
      "additionalProperties": false
    },
    "verdict": {
      "$ref": "#/$defs/KeywordHealthVerdict"
    },
    "trend": {
      "type": "object",
      "properties": {
        "weeks": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "buckets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KeywordHealthTrendBucket"
          }
        },
        "total": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "weeks",
        "buckets",
        "total"
      ],
      "additionalProperties": false
    },
    "noise": {
      "type": "object",
      "properties": {
        "sampledLowRelevance": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "sampledHighRelevance": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "topNoiseTerms": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "term": {
                "type": "string"
              },
              "posts": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "term",
              "posts"
            ],
            "additionalProperties": false
          }
        },
        "topNoiseDomains": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "domain": {
                "type": "string"
              },
              "posts": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "domain",
              "posts"
            ],
            "additionalProperties": false
          }
        },
        "topNoiseAuthors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "author": {
                "type": "string"
              },
              "posts": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "author",
              "posts"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "sampledLowRelevance",
        "sampledHighRelevance",
        "topNoiseTerms",
        "topNoiseDomains",
        "topNoiseAuthors"
      ],
      "additionalProperties": false
    },
    "pendingSuggestions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/KeywordHealthSuggestion"
      }
    },
    "proposed": {
      "type": "object",
      "properties": {
        "excludeWords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excludeAuthors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "context": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "excludeWords",
        "excludeAuthors",
        "context"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "keyword",
    "verdict",
    "trend",
    "noise",
    "pendingSuggestions",
    "proposed"
  ],
  "additionalProperties": false,
  "$defs": {
    "KeywordHealthSuggestion": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "type": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "impact": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "type",
        "value",
        "reason",
        "impact"
      ],
      "additionalProperties": false
    },
    "KeywordHealthTrendBucket": {
      "type": "object",
      "properties": {
        "bucket": {
          "description": "Week start (`YYYY-MM-DD`).",
          "type": "string"
        },
        "count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "bucket",
        "count"
      ],
      "additionalProperties": false
    },
    "KeywordHealthVerdict": {
      "type": "object",
      "properties": {
        "status": {
          "description": "`noisy` = ≥ 50% of ≥ 20 scored mentions were Low relevance; `budget` = ≥ 60% of the cycle's mentions; `healthy` otherwise (also when there is not enough data).",
          "type": "string",
          "enum": [
            "healthy",
            "noisy",
            "budget"
          ]
        },
        "totalPosts": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "scoredPosts": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "lowRelevancePosts": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "lowShare": {
          "type": "number"
        },
        "quotaShare": {
          "type": "number"
        }
      },
      "required": [
        "status",
        "totalPosts",
        "scoredPosts",
        "lowRelevancePosts",
        "lowShare",
        "quotaShare"
      ],
      "additionalProperties": false
    }
  }
}