{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/layercall-com/json-schema/layercall-com-device-score-schema.json",
  "title": "DeviceScore",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/layercall-com-openapi.json#/components/schemas/DeviceScore",
  "type": "object",
  "required": [
    "device_id",
    "risk_score",
    "verdict",
    "bot_probability",
    "signals"
  ],
  "properties": {
    "device_id": {
      "type": "string"
    },
    "risk_score": {
      "$ref": "#/$defs/RiskScore"
    },
    "verdict": {
      "$ref": "#/$defs/Verdict"
    },
    "bot_probability": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Reported separately from risk: plenty of automated traffic is legitimate."
    },
    "signals": {
      "type": "object",
      "properties": {
        "is_bot": {
          "type": "boolean",
          "description": "bot_probability >= 60."
        },
        "is_automated": {
          "type": "boolean"
        },
        "is_headless": {
          "type": "boolean"
        },
        "timezone_mismatch": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Browser timezone country differs from the IP's. Silent (false) when either is genuinely unknown; null when the country could NOT be resolved — a GeoIP outage — so no comparison was made."
        },
        "repeat_device": {
          "type": "boolean",
          "description": "Seen before across the LayerCall network."
        }
      }
    },
    "first_seen": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "times_seen": {
      "type": "integer"
    },
    "abuse_reports": {
      "type": "integer"
    },
    "request_id": {
      "type": "string"
    },
    "processing_time_sec": {
      "type": "number"
    },
    "billable_lookups": {
      "type": "integer"
    }
  },
  "$defs": {
    "RiskScore": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "0 = clean, 100 = certain fraud."
    },
    "Verdict": {
      "type": "string",
      "enum": [
        "allow",
        "review",
        "block"
      ],
      "description": "Recommended action. Thresholds move with `strictness`."
    }
  }
}