{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kenna-security/json-schema/kenna-security-asset-group-request-body-schema-schema.json",
  "title": "asset_group_request_body_schema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kenna-security-asset-groups-api-openapi.yml#/components/schemas/asset_group_request_body_schema",
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the asset group or risk meter.  It can be a parent or child asset group."
    },
    "historical": {
      "type": "boolean",
      "description": "Boolean value indicating if the asset search should be populated with historical data. Defaults to true."
    },
    "query": {
      "$ref": "#/$defs/asset_groups_query_schema"
    }
  },
  "$defs": {
    "asset_groups_query_schema": {
      "type": "object",
      "properties": {
        "exclude_child_filter": {
          "type": "array",
          "description": "Asset Groups and Risk Meters normally require that assets have open vulnerabilities. If you would like to include all assets, including assets without open vulnerabilities, pass an array with the value of [\"Include all assets”].",
          "default": [],
          "items": {
            "type": "string"
          }
        },
        "id": {
          "type": "array",
          "description": "Array of asset IDs.",
          "default": [],
          "items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "min_priority": {
          "type": "integer",
          "description": "Search for all assets that have a priority greater than this value.",
          "format": "int32"
        },
        "max_priority": {
          "type": "integer",
          "description": "Search for all assets that have a priority less than this value.",
          "format": "int32"
        },
        "min_risk_meter_score": {
          "type": "integer",
          "description": "Search for all assets that have a risk meter score greater than this value.",
          "format": "int32"
        },
        "operating_system": {
          "type": "array",
          "description": "An array of the names of the operating systems associated with a set of assets.",
          "default": [],
          "items": {
            "type": "string"
          }
        },
        "primary_locator": {
          "type": "array",
          "description": "The primary locator used for an asset. This should be one of the following values: ip_address, hostname, database, url, mac_address, netbios, fqdn, file, or application.",
          "default": [],
          "items": {
            "type": "string"
          }
        },
        "q": {
          "type": "string",
          "description": "This can be any query string you want to search for, including a regex. We also have our own search syntax that enables you to search assets based on specific locators and fields. For more detailed documentation on our search syntax visit our Help Center. Below is an example of our search syntax being used to find all assets with the hostname foobar. As stated in our Help Center, it is also possible to use our search syntax on vulnerability fields. In order to apply a query for a vulnerability field to an asset search you must nest the query string under a vulnerability key. The example below shows how to search for all assets that relate to vulnerabilities that are connected to the Heartbleed CVE."
        },
        "service_ports": {
          "type": "array",
          "description": "An array of ports relating to your assets.",
          "default": [],
          "items": {
            "type": "integer"
          }
        },
        "service_protocols": {
          "$ref": "#/$defs/service_protocols"
        },
        "status": {
          "type": "array",
          "description": "An array of statuses for your assets which can include active and/or inactive. NOTE: By default, only active assets are returned when searching. You must specify the asset status you want in order to override that default.",
          "default": [],
          "items": {
            "type": "string"
          }
        },
        "tags": {
          "type": "array",
          "description": "An array of tag names associated with your assets.",
          "default": [],
          "items": {
            "type": "string"
          }
        },
        "tag_boolean_mode": {
          "type": "string",
          "description": "Set this to 'all' if you would like to return assets that contain all of the tags in your query rather than assets that contain any tags."
        },
        "vulnerability: {id: []}": {
          "type": "array",
          "description": "Vulnerability IDs. Search for all assets that have vulnerabilities with these IDs.",
          "default": [],
          "items": {
            "type": "integer",
            "format": "int32"
          }
        }
      }
    },
    "service_protocols": {
      "type": "array",
      "description": "An array of service protocols relating to your asset.",
      "items": {
        "type": "string",
        "enum": [
          "http",
          "tcp",
          "udp"
        ]
      }
    }
  }
}