CloudQuery policies API

The policies API from CloudQuery — 10 operation(s) for policies.

Operations 16

GET /policies #
POST /policies #
GET /policies/{policy_id} #
PUT /policies/{policy_id} #
DELETE /policies/{policy_id} #
POST /policies/{policy_id}/toggle #
GET /policies/{policy_id}/violations #
GET /policies/{policy_id}/violations-history #
GET /policies/metrics #
GET /policies/violations-by-domain #
GET /policies/violations-history #
GET /policy-groups #
POST /policy-groups #
GET /policy-groups/{policy_group_id} #
PUT /policy-groups/{policy_group_id} #
DELETE /policy-groups/{policy_group_id} #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cloudquery-policies-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cloudquery-policies-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: support@cloudquery.io
    name: CloudQuery Support Team
    url: https://cloudquery.io
  description: 'Welcome to the CloudQuery Platform API documentation! This API can be used to interact with the CloudQuery platform. As a user, the API allows you to search the CloudQuery asset inventory, run SQL queries against the data warehouse, save and load searches, and much more. As an administrator, it allows you to manage your teams, syncs, and other objects.

    ### Authentication

    The API is secured using bearer tokens. To get started, you can generate an API key for your Platform deployment from your platform dashboard. For a step-by-step guide, see: https://www.cloudquery.io/docs/cli/managing-cloudquery/deployments/generate-api-key.

    The base URL for the API depends on where your CloudQuery Platform is hosted. If running locally, this is usually http://localhost:3000/api. In a production deployment it should be an HTTPS URL. For purposes of illustration, we will assume the platform instance is available at https://cloudquery.mycompany.com. In this case, the base API endpoint will be https://cloudquery.mycompany.com/api.

    ### Example Request

    To test your connection to the API, we can use the `/plugins` endpoint. For example:

    `curl -v -H "Authorization: Bearer $CLOUDQUERY_API_KEY" \ https://cloudquery.mycompany.com/api/plugins`

    '
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://www.cloudquery.io/terms
  title: CloudQuery Platform OpenAPI Spec admin Policies API
  version: 1.0.0
servers:
- url: https://api.cloudquery.io
  description: Base URL declared by the provider in apis.yml (roadmap#122).
security:
- bearerAuth: []
- cookieAuth: []
tags:
- name: policies
paths:
  /policies:
    get:
      description: List all policies for a team
      operationId: PlatformListPolicies
      parameters:
      - $ref: '#/components/parameters/platform_per_page'
      - $ref: '#/components/parameters/platform_page'
      - $ref: '#/components/parameters/platform_policy_status'
      - in: query
        name: severities
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicySeverity'
        style: form
        explode: true
        description: Filter by severities (policy matches any)
      - in: query
        name: domain
        required: false
        schema:
          $ref: '#/components/schemas/PlatformPolicyDomain'
        description: Filter by domain
      - in: query
        name: policy_group_ids
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicyGroupID'
        style: form
        explode: true
        description: Filter by policy groups (policy matches any)
      - in: query
        name: search
        required: false
        schema:
          type: string
        description: Search in policy name and description
      - in: query
        name: sort_by
        required: false
        schema:
          type: string
          enum:
          - name
          - domain
          - severity
          - violation_count
          - last_run_at
          - created_at
          default: created_at
        description: Field to sort by
      - in: query
        name: sort_dir
        required: false
        schema:
          type: string
          enum:
          - asc
          - desc
          default: desc
        description: Sort direction
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                required:
                - items
                - metadata
                properties:
                  items:
                    items:
                      $ref: '#/components/schemas/PlatformPolicy'
                    type: array
                  metadata:
                    $ref: '#/components/schemas/PlatformListMetadata'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
    post:
      description: Create a new policy
      operationId: PlatformCreatePolicy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPolicyCreate'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPolicy'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '422':
          $ref: '#/components/responses/PlatformUnprocessableEntity'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policies/{policy_id}:
    get:
      description: Get a policy by ID
      operationId: PlatformGetPolicy
      parameters:
      - $ref: '#/components/parameters/platform_policy_id'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPolicy'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
    put:
      description: Update a policy
      operationId: PlatformUpdatePolicy
      parameters:
      - $ref: '#/components/parameters/platform_policy_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPolicyUpdate'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPolicy'
        '400':
          $ref: '#/components/responses/PlatformBadRequest'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '422':
          $ref: '#/components/responses/PlatformUnprocessableEntity'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
    delete:
      description: Delete a policy
      operationId: PlatformDeletePolicy
      parameters:
      - $ref: '#/components/parameters/platform_policy_id'
      responses:
        '204':
          description: Success
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '422':
          $ref: '#/components/responses/PlatformUnprocessableEntity'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policies/{policy_id}/toggle:
    post:
      description: Toggle a policy's status (active/paused)
      operationId: PlatformTogglePolicy
      parameters:
      - $ref: '#/components/parameters/platform_policy_id'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPolicy'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '422':
          $ref: '#/components/responses/PlatformUnprocessableEntity'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policies/{policy_id}/violations:
    get:
      description: Get violations for a policy
      operationId: PlatformGetPolicyViolations
      parameters:
      - $ref: '#/components/parameters/platform_policy_id'
      - $ref: '#/components/parameters/platform_page'
      - $ref: '#/components/parameters/platform_per_page'
      - name: search
        in: query
        description: Text search term to filter violations by resource_type_label, name, account_name, cloud, or region
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                required:
                - items
                properties:
                  items:
                    items:
                      $ref: '#/components/schemas/PlatformPolicyViolation'
                    type: array
                  metadata:
                    $ref: '#/components/schemas/PlatformListMetadata'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policies/{policy_id}/violations-history:
    get:
      description: Get violation history for a policy
      operationId: PlatformGetPolicyViolationsHistory
      parameters:
      - $ref: '#/components/parameters/platform_policy_id'
      - $ref: '#/components/parameters/platform_per_page'
      - $ref: '#/components/parameters/platform_page'
      - in: query
        name: start_time
        required: false
        schema:
          type: string
          format: date-time
      - in: query
        name: end_time
        required: false
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                required:
                - items
                - metadata
                properties:
                  items:
                    items:
                      $ref: '#/components/schemas/PlatformPolicyEvaluationLog'
                    type: array
                  metadata:
                    $ref: '#/components/schemas/PlatformListMetadata'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policies/metrics:
    get:
      description: Get policy metrics summary
      operationId: PlatformGetPolicyMetrics
      parameters:
      - in: query
        name: severities
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicySeverity'
        style: form
        explode: true
        description: Filter by severities (policy matches any)
      - in: query
        name: domain
        required: false
        schema:
          $ref: '#/components/schemas/PlatformPolicyDomain'
        description: Filter by domain
      - in: query
        name: policy_group_ids
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicyGroupID'
        style: form
        explode: true
        description: Filter by policy groups (policy matches any)
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPolicyMetrics'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policies/violations-by-domain:
    get:
      description: Get violations grouped by domain
      operationId: PlatformGetViolationsByDomain
      parameters:
      - in: query
        name: severities
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicySeverity'
        style: form
        explode: true
        description: Filter by severities (policy matches any)
      - in: query
        name: domain
        required: false
        schema:
          $ref: '#/components/schemas/PlatformPolicyDomain'
        description: Filter by domain
      - in: query
        name: policy_group_ids
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicyGroupID'
        style: form
        explode: true
        description: Filter by policy groups (policy matches any)
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformViolationsByDomain'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policies/violations-history:
    get:
      description: Get violations history over time
      operationId: PlatformGetViolationsHistory
      parameters:
      - in: query
        name: start_date
        required: false
        schema:
          type: string
          format: date
        description: Start date for the query range (YYYY-MM-DD)
      - in: query
        name: end_date
        required: false
        schema:
          type: string
          format: date
        description: End date for the query range (YYYY-MM-DD)
      - in: query
        name: severities
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicySeverity'
        style: form
        explode: true
        description: Filter by severities (policy matches any)
      - in: query
        name: domain
        required: false
        schema:
          $ref: '#/components/schemas/PlatformPolicyDomain'
        description: Filter by domain
      - in: query
        name: policy_group_ids
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicyGroupID'
        style: form
        explode: true
        description: Filter by policy groups (policy matches any)
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformViolationsHistory'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policy-groups:
    get:
      description: List all policy groups
      operationId: PlatformListPolicyGroups
      parameters:
      - in: query
        name: search
        required: false
        schema:
          type: string
        description: Search in policy group name and description
      - in: query
        name: severities
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicySeverity'
        style: form
        explode: true
        description: Filter to policy groups that contain at least one policy with any of these severities
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                required:
                - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/PlatformPolicyGroupWithCounts'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
    post:
      description: Create a new policy group
      operationId: PlatformCreatePolicyGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPolicyGroupCreate'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPolicyGroup'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '422':
          $ref: '#/components/responses/PlatformUnprocessableEntity'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
  /policy-groups/{policy_group_id}:
    get:
      description: List policies in a policy group
      operationId: PlatformListPoliciesInGroup
      parameters:
      - $ref: '#/components/parameters/platform_policy_group_id'
      - $ref: '#/components/parameters/platform_per_page'
      - $ref: '#/components/parameters/platform_page'
      - in: query
        name: sort_by
        required: false
        schema:
          type: string
          enum:
          - name
          - policy_count
          default: name
        description: Field to sort by
      - in: query
        name: sort_dir
        required: false
        schema:
          type: string
          enum:
          - asc
          - desc
          default: asc
        description: Sort direction
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                required:
                - items
                - metadata
                properties:
                  items:
                    items:
                      $ref: '#/components/schemas/PlatformPolicy'
                    type: array
                  metadata:
                    $ref: '#/components/schemas/PlatformListMetadata'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
    put:
      description: Update a policy group
      operationId: PlatformUpdatePolicyGroup
      parameters:
      - $ref: '#/components/parameters/platform_policy_group_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPolicyGroupUpdate'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPolicyGroup'
        '400':
          $ref: '#/components/responses/PlatformBadRequest'
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '422':
          $ref: '#/components/responses/PlatformUnprocessableEntity'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
    delete:
      description: Delete a policy group
      operationId: PlatformDeletePolicyGroup
      parameters:
      - $ref: '#/components/parameters/platform_policy_group_id'
      responses:
        '204':
          description: Success
        '401':
          $ref: '#/components/responses/PlatformRequiresAuthentication'
        '403':
          $ref: '#/components/responses/PlatformForbidden'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '500':
          $ref: '#/components/responses/PlatformInternalError'
      tags:
      - policies
components:
  responses:
    PlatformInternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformBasicError'
      description: Internal Error
    PlatformUnprocessableEntity:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformFieldError'
      description: UnprocessableEntity
    PlatformRequiresAuthentication:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformBasicError'
      description: Requires authentication
    PlatformNotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformBasicError'
      description: Resource not found
    PlatformBadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformFieldError'
      description: Bad request
    PlatformForbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformFieldError'
      description: Forbidden
  schemas:
    PlatformPolicyUpdate:
      title: Policy Update
      type: object
      description: Update a policy
      additionalProperties: false
      properties:
        name:
          type: string
        domain:
          $ref: '#/components/schemas/PlatformPolicyDomain'
        severity:
          $ref: '#/components/schemas/PlatformPolicySeverity'
        description:
          type: string
        query:
          type: string
          example: SELECT account_id, bucket_name, region FROM aws_s3_buckets WHERE encryption_status IS NULL
        notification_destination_ids:
          type: array
          items:
            type: string
            format: uuid
          nullable: true
          description: Notification destination IDs to send alerts to
        policy_group_ids:
          type: array
          items:
            type: string
            format: uuid
          nullable: true
          description: Policy group IDs to set for this policy
    PlatformPolicyCreate:
      title: Policy Create
      type: object
      description: Create a policy (implicitly creates a query and an enabled alert)
      additionalProperties: false
      required:
      - name
      - domain
      - severity
      - query
      properties:
        name:
          type: string
          example: Unencrypted S3 buckets
        domain:
          $ref: '#/components/schemas/PlatformPolicyDomain'
        severity:
          $ref: '#/components/schemas/PlatformPolicySeverity'
        description:
          type: string
          default: ''
          example: Policy to detect unencrypted S3 buckets
        query:
          type: string
          example: SELECT account_id, bucket_name, region FROM aws_s3_buckets WHERE encryption_status IS NULL
        notification_destination_ids:
          type: array
          items:
            type: string
            format: uuid
          nullable: true
          description: Notification destination IDs to send alerts to
        policy_group_ids:
          type: array
          items:
            type: string
            format: uuid
          nullable: true
          description: Policy group IDs to add this policy to
    PlatformQueryID:
      description: The unique ID for the query.
      type: string
      format: uuid
      x-go-name: QueryID
    PlatformPolicyID:
      description: The unique ID for the policy.
      type: string
      format: uuid
      x-go-name: PolicyID
    PlatformListMetadata:
      required:
      - page_size
      properties:
        total_count:
          type: integer
        last_page:
          type: integer
        page_size:
          type: integer
        time_ms:
          type: integer
    PlatformNotificationDestinationID:
      description: The unique ID for the notification destination.
      type: string
      format: uuid
      x-go-name: NotificationDestinationID
    PlatformPolicyGroupWithCounts:
      title: Policy Group With Counts
      type: object
      description: Policy Group with policy count and violation counts by severity
      additionalProperties: false
      required:
      - id
      - name
      - description
      - policy_count
      - violation_count_low
      - violation_count_medium
      - violation_count_high
      - violation_count_critical
      - created_at
      - updated_at
      allOf:
      - $ref: '#/components/schemas/PlatformPolicyGroup'
      - type: object
        properties:
          policy_count:
            type: integer
            description: Number of policies in this group
            example: 5
            default: 0
          violation_count_low:
            type: integer
            description: Total violations from low severity policies in this group
            example: 10
            default: 0
          violation_count_medium:
            type: integer
            description: Total violations from medium severity policies in this group
            example: 25
            default: 0
          violation_count_high:
            type: integer
            description: Total violations from high severity policies in this group
            example: 15
            default: 0
          violation_count_critical:
            type: integer
            description: Total violations from critical severity policies in this group
            example: 3
            default: 0
    PlatformPolicyGroupID:
      title: Policy Group ID
      type: string
      format: uuid
      x-go-name: PolicyGroupID
    PlatformPolicy:
      title: Policy
      type: object
      description: Policy
      additionalProperties: false
      required:
      - id
      - name
      - domain
      - severity
      - description
      - status
      - team_name
      - query_id
      - query
      - created_by
      - created_at
      - updated_at
      properties:
        id:
          $ref: '#/components/schemas/PlatformPolicyID'
        name:
          type: string
          example: Unencrypted S3 buckets
        domain:
          $ref: '#/components/schemas/PlatformPolicyDomain'
        severity:
          $ref: '#/components/schemas/PlatformPolicySeverity'
        description:
          type: string
          example: Policy to detect unencrypted S3 buckets
        status:
          $ref: '#/components/schemas/PlatformPolicyStatus'
        team_name:
          type: string
          example: my-team
        query_id:
          $ref: '#/components/schemas/PlatformQueryID'
        query:
          type: string
          description: The SQL query string for the policy
          example: SELECT * FROM aws_s3_buckets WHERE server_side_encryption_configuration IS NULL
        created_by:
          type: string
          format: uuid
          x-go-name: CreatedByUserID
        updated_by:
          type: string
          format: uuid
          nullable: true
          x-go-name: UpdatedByUserID
        created_at:
          example: '2017-07-14T16:53:42Z'
          format: date-time
          type: string
        updated_at:
          example: '2017-07-14T16:53:42Z'
          format: date-time
          type: string
        violation_count:
          type: integer
          nullable: true
          description: Number of violations from the last evaluation
          example: 5
        run_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the last evaluation run
          example: '2017-07-14T16:53:42Z'
        notification_destinations:
          type: array
          items:
            $ref: '#/components/schemas/PlatformNotificationDestinationListItem'
          description: List of notification destinations configured for the policy's alert
          example: []
        policy_groups:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPolicyGroup'
          description: List of policy groups this policy belongs to
          example: []
    PlatformPolicyGroup:
      title: Policy Group
      type: object
      description: Policy Group
      additionalProperties: false
      required:
      - id
      - name
      - description
      - created_at
      - updated_at
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: Security Policies
        description:
          type: string
          example: Group containing all security-related policies
        created_at:
          example: '2017-07-14T16:53:42Z'
          format: date-time
          type: string
        updated_at:
          example: '2017-07-14T16:53:42Z'
          format: date-time
          type: string
    PlatformViolationsHistory:
      title: Violations History
      type: object
      description: Violations history over time
      additionalProperties: false
      required:
      - items
      - metadata
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PlatformViolationsHistoryItem'
        metadata:
          $ref: '#/components/schemas/PlatformViolationsHistoryMetadata'
    PlatformPolicyMetrics:
      title: Policy Metrics
      type: object
      description: Policy metrics summary
      additionalProperties: false
      required:
      - total_active_violations
      - high_severity_violations
      - violations_this_week
      properties:
        total_active_violations:
          type: integer
          description: Total violations from active policies
          example: 28
        high_severity_violations:
          type: integer
          description: Total violations from high or critical severity policies
          example: 10
        violations_this_week:
          type: integer
          description: Total violations from evaluations in the last 7 days
          example: 7
    PlatformPolicyGroupCreate:
      title: Policy Group Create
      type: object
      description: Create a policy group
      additionalProperties: false
      required:
      - name
      properties:
        name:
          type: string
          example: Security Policies
        description:
          type: string
          default: ''
          example: Group containing all security-related policies
        policy_ids:
          type: array
          items:
            type: string
            format: uuid
          nullable: true
          description: Optional array of policy IDs to add to this group
    PlatformPolicySeverity:
      description: Policy severity
      type: string
      enum:
      - low
      - medium
      - high
      - critical
      x-go-name: PolicySeverity
    PlatformPolicyViolation:
      title: Policy Violation
      type: object
      description: Policy violation resource information
      additionalProperties: false
      required:
      - cloud
      - resource_type_label
      - _cq_account_name
      - name
      - region
      - _cq_platform_id
      properties:
        cloud:
          type: string
          example: aws
        resource_type_label:
          type: string
          example: EC2 Instance
        _cq_account_name:
          type: string
          example: my-account
        name:
          type: string
          example: my-resource
        region:
          type: string
          example: us-east-1
        _cq_platform_id:
          type: string
          example: aws_ec2_instances_12345678-1234-1234-1234-123456789abc
        tags:
          type: array
          items:
            type: string
          description: 

# --- truncated at 32 KB (38 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/cloudquery/refs/heads/main/openapi/cloudquery-policies-api-openapi.yml