> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getprimo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get all active compliance alerts

> Return the paginated list of device compliance records that are currently alerting (hasAlert=true) for your company. Optionally filter by device ID.

<span className="badge-read">Key: Read</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json get /compliance/alerts
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /compliance/alerts:
    get:
      tags:
        - Compliance
      summary: Get all active compliance alerts
      description: >-
        Return the paginated list of device compliance records that are
        currently alerting (hasAlert=true) for your company. Optionally filter
        by device ID.
      operationId: getComplianceAlerts
      parameters:
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            minimum: 1
            maximum: 9007199254740991
            default: 1
            type: number
        - name: perPage
          required: false
          in: query
          description: Number of items per page (max 100)
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: number
        - name: deviceId
          required: false
          in: query
          description: Filter alerts by device ID
          schema:
            type: string
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetComplianceAlerts_Output'
components:
  schemas:
    GetComplianceAlerts_Output:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              deviceId:
                type: string
              complianceRuleId:
                type: string
              mdmControlId:
                anyOf:
                  - type: string
                  - type: 'null'
              status:
                type: string
                enum:
                  - ACTIVE
                  - NOT_PROTECTED
                  - OFFLINE_7_DAYS
                  - PENDING
                  - PROTECTED
                  - FAILED
                  - NOT_ENCRYPTED
                  - MISSING_RECOVERY_KEY
                  - ENCRYPTED
                  - ACTION_REQUIRED
                  - GRACE_PERIOD
                  - UP_TO_DATE
                  - NOT_UP_TO_DATE
                  - ENFORCED
                  - ERROR
                  - CREATION_PENDING
                  - DEMOTION_PENDING
                  - CREATED
                  - CREATION_FAILED
                  - SUCCESS
                  - INSTALLED
                  - MDM_ON
                  - MDM_OFF
                  - MDM_ON_IN_ANOTHER_MDM
                  - READY_ZTD
                  - MISSING_AGENT
                  - ONLINE
                  - OFFLINE
                  - ENABLED
                  - DISABLED
                  - MISSING_BYPASS_CODE
                  - MEETS_REQUIREMENTS
                  - BELOW_MINIMUM_VERSION
                  - UNSUPPORTED_OS_EDITION
              createdAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              updatedAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            required:
              - id
              - deviceId
              - complianceRuleId
              - mdmControlId
              - status
              - createdAt
              - updatedAt
            additionalProperties: false
        pagination:
          type: object
          properties:
            totalElements:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            totalPages:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            page:
              type: integer
              minimum: 1
              maximum: 9007199254740991
            perPage:
              type: integer
              minimum: 1
              maximum: 100
          required:
            - totalElements
            - totalPages
            - page
            - perPage
          additionalProperties: false
      required:
        - data
        - pagination
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````