{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/red-hat-enterprise-linux-8/json-schema/red-hat-enterprise-linux-8-view-out-schema.json",
  "title": "View Response",
  "description": "Full representation of an inventory view returned by the API.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/red-hat-enterprise-linux-8-inventory-api-openapi.yml#/components/schemas/ViewOut",
  "properties": {
    "configuration": {
      "$ref": "#/$defs/ViewConfiguration"
    },
    "created_at": {
      "description": "Timestamp when the view was created.",
      "format": "date-time",
      "type": "string"
    },
    "created_by": {
      "description": "The user_id of the view creator.",
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "description": "An optional description of the view.",
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "description": "The unique identifier of the view.",
      "format": "uuid",
      "type": "string"
    },
    "is_owner": {
      "description": "True if the requesting user is the creator of this view. Only the owner can update or delete a view.",
      "type": "boolean"
    },
    "is_system_view": {
      "description": "True if this is a read-only system view (Red Hat preset). System views cannot be updated or deleted, but can be cloned.",
      "type": "boolean"
    },
    "name": {
      "description": "The display name for the view.",
      "type": "string"
    },
    "org_id": {
      "description": "The organization ID that owns the view. Null for system views.",
      "type": [
        "string",
        "null"
      ]
    },
    "org_wide": {
      "description": "Whether the view is visible to the entire organization.",
      "type": "boolean"
    },
    "updated_at": {
      "description": "Timestamp when the view was last updated.",
      "format": "date-time",
      "type": "string"
    }
  },
  "required": [
    "id",
    "name",
    "configuration",
    "org_wide",
    "is_system_view",
    "is_owner",
    "created_at",
    "updated_at"
  ],
  "type": "object",
  "$defs": {
    "HostFilters": {
      "additionalProperties": false,
      "description": "Host-level query filters that correspond to the /hosts endpoint query parameters. Stored with the view so the frontend can reconstruct the full query when loading hosts for this view.",
      "properties": {
        "cve_severity": {
          "description": "Filter by Vulnerability CVE severity. Values are OR. not_evaluated matches hosts with no Vulnerability data.",
          "items": {
            "enum": [
              "critical",
              "important",
              "moderate",
              "low",
              "not_evaluated"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "hostname_or_id": {
          "description": "Display name or ID substring search.",
          "type": "string"
        },
        "incident_status": {
          "description": "Filter by Advisor incident status. Values are OR. present matches incidents greater than 0. not_present matches incidents equal to 0. not_analyzed matches hosts with no Advisor data.",
          "items": {
            "enum": [
              "present",
              "not_present",
              "not_analyzed"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "known_exploit": {
          "description": "Filter by CVEs with known exploits. Values are OR. present matches a count greater than 0. not_present matches a count equal to 0. not_evaluated matches hosts with no Vulnerability data.",
          "items": {
            "enum": [
              "present",
              "not_present",
              "not_evaluated"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "last_check_in_end": {
          "description": "End of last check-in date range (ISO 8601).",
          "format": "date-time",
          "type": "string"
        },
        "last_check_in_start": {
          "description": "Start of last check-in date range (ISO 8601).",
          "format": "date-time",
          "type": "string"
        },
        "recommendation_severity": {
          "description": "Filter by Advisor recommendation severity. Values are OR. not_analyzed matches hosts with no Advisor data.",
          "items": {
            "enum": [
              "critical",
              "important",
              "moderate",
              "low",
              "not_analyzed"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "registered_with": {
          "description": "Filter by reporting source.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "security_rule": {
          "description": "Filter by CVEs with security rules. Values are OR. present matches a count greater than 0. not_present matches a count equal to 0. not_evaluated matches hosts with no Vulnerability data.",
          "items": {
            "enum": [
              "present",
              "not_present",
              "not_evaluated"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "staleness": {
          "description": "Culling states to include.",
          "items": {
            "enum": [
              "fresh",
              "stale",
              "stale_warning",
              "unknown"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "system_type": {
          "description": "Filter by system type.",
          "items": {
            "enum": [
              "conventional",
              "bootc",
              "edge",
              "cluster"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "tags": {
          "description": "Tag filters in namespace/key=value format.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "updated_end": {
          "description": "End of last-modified date range (ISO 8601).",
          "format": "date-time",
          "type": "string"
        },
        "updated_start": {
          "description": "Start of last-modified date range (ISO 8601).",
          "format": "date-time",
          "type": "string"
        },
        "workspace_id": {
          "description": "Filter by workspace ID (UUID format).",
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "type": "array"
        },
        "workspace_name": {
          "description": "Filter by workspace name.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "title": "Host Query Filters",
      "type": "object"
    },
    "ViewColumnConfig": {
      "description": "Configuration for a single column in a view.",
      "properties": {
        "key": {
          "description": "The column key identifier. Core fields use bare names (e.g. \"display_name\", \"last_check_in\"). App fields use colon-delimited format (e.g. \"compliance:last_scan\", \"advisor:recommendations\"). Tag columns use a \"tag:\" prefix plus the namespace/key identity (e.g. \"tag:insights-client/env\", \"tag:owner\"). Core and app keys are validated server-side against the field registry. A tag column is accepted when the identity is non-empty.",
          "type": "string"
        },
        "shown": {
          "description": "Whether the column is visible. Omitted or true means shown. False is used for a tag column the user added and then unchecked. Hidden service columns are omitted from the list instead.",
          "type": "boolean"
        }
      },
      "required": [
        "key"
      ],
      "title": "View Column Configuration",
      "type": "object"
    },
    "ViewConfiguration": {
      "description": "The full visual configuration for an inventory view, including column layout, sort order, and active filters.",
      "properties": {
        "columns": {
          "description": "Ordered list of column configurations.",
          "items": {
            "$ref": "#/$defs/ViewColumnConfig"
          },
          "type": "array"
        },
        "filters": {
          "additionalProperties": true,
          "description": "Active filter criteria for this view. Top-level keys are filter namespaces: app names (e.g. vulnerability, patch), system_profile, or host (for host-level query parameters). Each namespace value is a nested object. system_profile filters may be deeply nested (e.g. operating_system.RHEL.version). The reserved \"host\" key holds host-level query parameters (staleness, tags, etc.) that the frontend replays as /hosts query params. Validated server-side.",
          "properties": {
            "host": {
              "$ref": "#/$defs/HostFilters"
            }
          },
          "type": "object"
        },
        "sort": {
          "$ref": "#/$defs/ViewSortConfig"
        }
      },
      "required": [
        "columns"
      ],
      "title": "View Configuration",
      "type": "object"
    },
    "ViewSortConfig": {
      "description": "Sort configuration for a view.",
      "properties": {
        "direction": {
          "default": "desc",
          "description": "The sort direction.",
          "enum": [
            "asc",
            "desc"
          ],
          "type": "string"
        },
        "key": {
          "description": "The column key to sort by.",
          "type": "string"
        }
      },
      "required": [
        "key"
      ],
      "title": "View Sort Configuration",
      "type": "object"
    }
  }
}