openapi: 3.1.0 info: title: Kyverno Policy Reporter ClusterPolicyReports PolicyReports API description: The Kyverno Policy Reporter REST API provides endpoints for querying PolicyReport and ClusterPolicyReport custom resources generated by Kyverno. It exposes policy results, status counts, and resource-level violation data, serving as the backend for the Policy Reporter UI. The API enables programmatic access to policy compliance status across namespaces and clusters. version: 2.0.0 contact: name: Kyverno Community url: https://kyverno.io/community/ termsOfService: https://kyverno.io/ servers: - url: http://localhost:8080 description: Default Policy Reporter server tags: - name: PolicyReports description: Namespaced policy report endpoints paths: /api/v1/policy-reports: get: operationId: listPolicyReports summary: Kyverno List namespaced policy reports description: Returns a paginated list of PolicyReport resources across all namespaces or filtered by a specific namespace. Each report includes summary counts and metadata about the namespace and source. tags: - PolicyReports parameters: - $ref: '#/components/parameters/namespaceParam' - $ref: '#/components/parameters/sourceParam' - $ref: '#/components/parameters/pageParam' - $ref: '#/components/parameters/perPageParam' responses: '200': description: Paginated list of policy reports content: application/json: schema: $ref: '#/components/schemas/PolicyReportList' components: schemas: PolicyReport: type: object description: A PolicyReport or ClusterPolicyReport resource summary properties: name: type: string description: Name of the policy report resource example: cpol-require-labels namespace: type: string description: Namespace of the report (empty for cluster-scoped reports) example: default source: type: string description: Policy engine that generated the report example: kyverno summary: $ref: '#/components/schemas/ResultCounts' creationTimestamp: type: string format: date-time description: Timestamp when the policy report was created PolicyReportList: type: object description: Paginated list of policy reports properties: items: type: array description: List of policy report summaries items: $ref: '#/components/schemas/PolicyReport' count: type: integer description: Total number of policy reports matching the query example: 42 ResultCounts: type: object description: Aggregated counts of policy results grouped by status properties: pass: type: integer description: Number of passing results example: 45 fail: type: integer description: Number of failing results example: 3 warn: type: integer description: Number of warning results example: 1 error: type: integer description: Number of error results example: 0 skip: type: integer description: Number of skipped results example: 2 parameters: sourceParam: name: source in: query description: Filter results by policy source (e.g., kyverno, trivy) required: false schema: type: string example: kyverno namespaceParam: name: namespace in: query description: Filter results by Kubernetes namespace required: false schema: type: string example: default perPageParam: name: perPage in: query description: Number of results per page required: false schema: type: integer minimum: 1 maximum: 250 default: 20 pageParam: name: page in: query description: Page number for paginated results (1-based) required: false schema: type: integer minimum: 1 default: 1 externalDocs: description: Policy Reporter API Reference url: https://kyverno.github.io/policy-reporter/core/api-reference/