> ## 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 the company metrics report

> Return the KPI report of the authenticated company as JSON: use it to summarise the company's situation, build a report or answer how-many questions at a glance. `report` holds the headline counts (devices in use, assigned or not, and in stock; employees to enroll or enrolled; devices with MDM on, off or in another MDM; compliance issues; disk encryption; EDR; online and offline devices; employees to onboard and to offboard), each next to the cockpit table that lists them, and leaves out a count equal to 0. `companyMetrics` holds every raw counter the report is built from, zeros included, plus the connected apps and the SaaS identities. Through MCP, the counters of a domain the caller cannot read (equipment, employees, SaaS) are left out of `report` and null in `companyMetrics`. These are counts only: to list the devices, employees, onboardings or offboardings behind a count, use `getDevices`, `getEmployees`, `getOnboardings` or `getOffboardings` instead; for the compliance issues themselves, use `getComplianceAlerts`. Only accessible with a Company API key.

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


## OpenAPI

````yaml https://api.getprimo.com/openapi.json get /company/metrics
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:
  /company/metrics:
    get:
      tags:
        - Company
      summary: Get the company metrics report
      description: >-
        Return the KPI report of the authenticated company as JSON: use it to
        summarise the company's situation, build a report or answer how-many
        questions at a glance. `report` holds the headline counts (devices in
        use, assigned or not, and in stock; employees to enroll or enrolled;
        devices with MDM on, off or in another MDM; compliance issues; disk
        encryption; EDR; online and offline devices; employees to onboard and to
        offboard), each next to the cockpit table that lists them, and leaves
        out a count equal to 0. `companyMetrics` holds every raw counter the
        report is built from, zeros included, plus the connected apps and the
        SaaS identities. Through MCP, the counters of a domain the caller cannot
        read (equipment, employees, SaaS) are left out of `report` and null in
        `companyMetrics`. These are counts only: to list the devices, employees,
        onboardings or offboardings behind a count, use `getDevices`,
        `getEmployees`, `getOnboardings` or `getOffboardings` instead; for the
        compliance issues themselves, use `getComplianceAlerts`. Only accessible
        with a Company API key.
      operationId: getCompanyMetrics
      parameters: []
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCompanyMetrics_Output'
components:
  schemas:
    GetCompanyMetrics_Output:
      type: object
      properties:
        report:
          type: object
          description: >-
            Headline counts of the company with the cockpit table behind each of
            them. A count equal to 0, or that the caller has no permission to
            read, is left out
          properties:
            devicesInUseAssignedCount:
              description: Devices in use that are assigned to an employee
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesInUseAssignedURL:
              description: >-
                Cockpit table of the devices in use that are assigned to an
                employee
              type: string
            devicesInUseUnassignedCount:
              description: Devices in use that are not assigned to an employee
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesInUseUnassignedURL:
              description: >-
                Cockpit table of the devices in use that are not assigned to an
                employee
              type: string
            devicesInStockCount:
              description: Devices in stock
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesInStockURL:
              description: Cockpit table of the devices in stock
              type: string
            employeesCount:
              description: Current employees
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            employeesToEnrollCount:
              description: Employees who still have to enroll in MDM
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            employeesToEnrollURL:
              description: Cockpit table of the employees who still have to enroll in MDM
              type: string
            employeesEnrolledCount:
              description: Employees enrolled in MDM
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            employeesEnrolledURL:
              description: Cockpit table of the employees enrolled in MDM
              type: string
            employeesToOnboardOrOffboardCount:
              description: Employees to onboard or to offboard
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            employeesToOnboardCount:
              description: Employees to onboard
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            employeesToOnboardThisWeekCount:
              description: Employees to onboard this week
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            employeesToOnboardURL:
              description: Cockpit table of the pending onboardings
              type: string
            employeesToOffboardCount:
              description: Employees to offboard
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            employeesToOffboardThisWeekCount:
              description: Employees to offboard this week
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            employeesToOffboardURL:
              description: Cockpit table of the pending offboardings
              type: string
            devicesWithMDMOnCount:
              description: Devices in use with MDM on
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithMDMOnURL:
              description: Cockpit table of the devices in use with MDM on
              type: string
            devicesWithMDMOnInAnotherMDMCount:
              description: Devices in use enrolled in another MDM
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithMDMOnInAnotherMDMURL:
              description: Cockpit table of the devices in use enrolled in another MDM
              type: string
            devicesWithMDMOffCount:
              description: Devices in use with MDM off
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithMDMOffURL:
              description: Cockpit table of the devices in use with MDM off
              type: string
            devicesWithMissingAgentCount:
              description: Devices in use whose MDM agent is missing
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithMissingAgentURL:
              description: Cockpit table of the devices in use whose MDM agent is missing
              type: string
            devicesWithReadyZTDCount:
              description: Devices in use ready for zero-touch deployment
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithReadyZTDURL:
              description: >-
                Cockpit table of the devices in use ready for zero-touch
                deployment
              type: string
            devicesCompliantCount:
              description: Devices with no compliance issue
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithIssuesCount:
              description: Devices with at least one compliance issue
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesNotEncryptedCount:
              description: Devices in use whose disk is not encrypted
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesNotEncryptedURL:
              description: Cockpit table of the devices in use whose disk is not encrypted
              type: string
            devicesWithoutRecoveryKeyCount:
              description: Devices in use with no disk recovery key escrowed
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithoutRecoveryKeyURL:
              description: >-
                Cockpit table of the devices in use with no disk recovery key
                escrowed
              type: string
            devicesWithIcloudLockIssueCount:
              description: Devices in use with an iCloud lock issue
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithIcloudLockIssueURL:
              description: Cockpit table of the devices in use with an iCloud lock issue
              type: string
            edrEnabled:
              description: >-
                Whether the company has an EDR (endpoint detection and response)
                connected
              type: boolean
            devicesWithActiveEDRCount:
              description: Devices in use with an active EDR
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithActiveEDRURL:
              description: Cockpit table of the devices in use with an active EDR
              type: string
            devicesWithEdrNotDetectedCount:
              description: Devices in use where the EDR is not detected
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithEdrNotDetectedURL:
              description: >-
                Cockpit table of the devices in use where the EDR is not
                detected
              type: string
            devicesWithEdrActivationIssueCount:
              description: Devices in use with an EDR activation issue
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithEdrActivationIssueURL:
              description: Cockpit table of the devices in use with an EDR activation issue
              type: string
            devicesWithEdrInactiveCount:
              description: Devices in use whose EDR has been inactive for 7 days
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesWithEdrInactiveURL:
              description: >-
                Cockpit table of the devices in use whose EDR has been inactive
                for 7 days
              type: string
            devicesOnlineCount:
              description: Devices in use that are online
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesOnlineURL:
              description: Cockpit table of the devices in use that are online
              type: string
            devicesOfflineCount:
              description: Devices in use that are offline
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesOfflineURL:
              description: Cockpit table of the devices in use that are offline
              type: string
            devicesOffline7dCount:
              description: Devices in use that have been offline for 7 days
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            devicesOffline7dURL:
              description: >-
                Cockpit table of the devices in use that have been offline for 7
                days
              type: string
          required:
            - devicesInUseAssignedURL
            - devicesInUseUnassignedURL
            - devicesInStockURL
            - employeesToEnrollURL
            - employeesEnrolledURL
            - employeesToOnboardURL
            - employeesToOffboardURL
            - devicesWithMDMOnURL
            - devicesWithMDMOnInAnotherMDMURL
            - devicesWithMDMOffURL
            - devicesWithMissingAgentURL
            - devicesWithReadyZTDURL
            - devicesNotEncryptedURL
            - devicesWithoutRecoveryKeyURL
            - devicesWithIcloudLockIssueURL
            - devicesWithActiveEDRURL
            - devicesWithEdrNotDetectedURL
            - devicesWithEdrActivationIssueURL
            - devicesWithEdrInactiveURL
            - devicesOnlineURL
            - devicesOfflineURL
            - devicesOffline7dURL
          additionalProperties: false
        companyMetrics:
          type: object
          description: >-
            Every raw counter the report is built from, zeros included. A
            counter the caller has no permission to read is null
          properties:
            id:
              description: Company identifier
              type: string
            countConnectedApps:
              anyOf:
                - description: SaaS applications connected through their API
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                - type: 'null'
            countCurrentEmployees:
              anyOf:
                - description: Current employees
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                - type: 'null'
            deviceMdm:
              anyOf:
                - type: object
                  properties:
                    countMdmOn:
                      description: Devices with MDM on
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countMdmOff:
                      description: Devices with MDM off
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countMdmOnInAnotherMdm:
                      description: Devices enrolled in another MDM
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countMissingAgent:
                      description: Devices whose MDM agent is missing
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countReadyZTD:
                      description: Devices ready for zero-touch deployment
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - countMdmOn
                    - countMdmOff
                    - countMdmOnInAnotherMdm
                    - countMissingAgent
                    - countReadyZTD
                  additionalProperties: false
                - type: 'null'
            deviceEdr:
              anyOf:
                - type: object
                  properties:
                    countNotDetected:
                      description: Devices where the EDR is not detected
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countInstallIncomplete:
                      description: Devices where the EDR installation is incomplete
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countActivationIssues:
                      description: Devices with an EDR activation issue
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countOfflineFor7Days:
                      description: Devices whose EDR has been inactive for 7 days
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countActive:
                      description: Devices with an active EDR
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - countNotDetected
                    - countInstallIncomplete
                    - countActivationIssues
                    - countOfflineFor7Days
                    - countActive
                  additionalProperties: false
                - type: 'null'
            deviceCompliance:
              anyOf:
                - type: object
                  properties:
                    countCompliant:
                      description: Devices with no compliance issue
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countIssuesExist:
                      description: Devices with at least one compliance issue
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countCompliantByAlertCount:
                      description: >-
                        Devices with no compliance issue, counted from the
                        device alert count
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countIssuesExistByAlertCount:
                      description: >-
                        Devices with at least one compliance issue, counted from
                        the device alert count
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - countCompliant
                    - countIssuesExist
                    - countCompliantByAlertCount
                    - countIssuesExistByAlertCount
                  additionalProperties: false
                - type: 'null'
            deviceComplianceDetails:
              anyOf:
                - type: object
                  properties:
                    countToEncrypt:
                      description: Devices whose disk is not encrypted
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countWithoutRecoveryKey:
                      description: Devices with no disk recovery key escrowed
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countWithIcloudLockIssue:
                      description: Devices with an iCloud lock issue
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - countToEncrypt
                    - countWithoutRecoveryKey
                    - countWithIcloudLockIssue
                  additionalProperties: false
                - type: 'null'
            employeeEnrollment:
              anyOf:
                - type: object
                  properties:
                    countToEnroll:
                      description: Employees who still have to enroll in MDM
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countEnrolled:
                      description: Employees enrolled in MDM
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - countToEnroll
                    - countEnrolled
                  additionalProperties: false
                - type: 'null'
            deviceAssignment:
              anyOf:
                - type: object
                  properties:
                    countInUseAssigned:
                      description: Devices in use that are assigned to an employee
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countInUseUnassigned:
                      description: Devices in use that are not assigned to an employee
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countInStock:
                      description: Devices in stock
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - countInUseAssigned
                    - countInUseUnassigned
                    - countInStock
                  additionalProperties: false
                - type: 'null'
            deviceOnline:
              anyOf:
                - type: object
                  properties:
                    countOnline:
                      description: Devices that are online
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countOffline:
                      description: Devices that are offline
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countOfflineFor7Days:
                      description: Devices that have been offline for 7 days
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - countOnline
                    - countOffline
                    - countOfflineFor7Days
                  additionalProperties: false
                - type: 'null'
            identitiesAndAccess:
              anyOf:
                - type: object
                  properties:
                    countAssignedToEmployee:
                      description: SaaS identities assigned to an employee
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countAssignedToMachine:
                      description: SaaS identities assigned to a machine
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countAssignedToGroup:
                      description: SaaS identities assigned to a group
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countAssignedToGuest:
                      description: SaaS identities assigned to a guest
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countAssignedToContractor:
                      description: SaaS identities assigned to a contractor
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    countToLink:
                      description: SaaS identities still to link to an employee
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - countAssignedToEmployee
                    - countAssignedToMachine
                    - countAssignedToGroup
                    - countAssignedToGuest
                    - countAssignedToContractor
                    - countToLink
                  additionalProperties: false
                - type: 'null'
          required:
            - id
            - countConnectedApps
            - countCurrentEmployees
            - deviceMdm
            - deviceEdr
            - deviceCompliance
            - deviceComplianceDetails
            - employeeEnrollment
            - deviceAssignment
            - deviceOnline
            - identitiesAndAccess
          additionalProperties: false
      required:
        - report
        - companyMetrics
      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>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.