{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kenna-security/json-schema/kenna-security-role-request-body-schema-schema.json",
  "title": "role_request_body_schema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kenna-security-roles-api-openapi.yml#/components/schemas/role_request_body_schema",
  "type": "object",
  "required": [
    "role"
  ],
  "properties": {
    "role": {
      "type": "object",
      "required": [
        "name",
        "access_level"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the role.",
          "default": "Demo"
        },
        "description": {
          "type": "string",
          "description": "The description of the role."
        },
        "access_level": {
          "type": "string",
          "enum": [
            "read",
            "write",
            "custom"
          ],
          "description": "The access level assigned to the role. This must be \"read\", \"write\", or \"custom\".",
          "default": "read"
        },
        "asset_group_ids": {
          "type": "array",
          "description": "An array of asset group IDs that you want associated with the role. If an asset group cannot cannot be found an error will be returned.",
          "default": [
            66260,
            29979
          ],
          "items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "applications": {
          "type": "array",
          "description": "An array of application names to add to a role's set of applications.",
          "default": [
            "Valid application name",
            "Another application name"
          ],
          "items": {
            "type": "string"
          }
        },
        "asset_groups [DEPRECATED]": {
          "type": "array",
          "description": "An array of asset group names that you want associated with the role. If an asset group with a matching name cannot be found or more than one asset group shares the same name an error will be returned. Because name conflicts will cause an error, we suggest using asset_group_ids instead.",
          "default": [],
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}