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

# Get policy stats

> Per-policy hit counts for the last 24 hours, keyed by policy ID. Every policy in the organization has an entry, even with zero hits.

**Required permission:** `policies:read`




## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v1/policies/stats
openapi: 3.1.0
info:
  title: Igris Management API
  version: '1'
  description: >-
    REST API for managing Igris connections, policies, sessions, audit events
    and alerts.
servers:
  - url: https://api.igrisecurity.com
security:
  - bearerAuth: []
tags:
  - name: Connections
  - name: Policies
  - name: Sessions
  - name: Audit Events
  - name: Incidents
  - name: Webhooks
  - name: API Keys
  - name: Members
  - name: LLM Providers
  - name: LLM Cost
  - name: Observe
paths:
  /api/v1/policies/stats:
    get:
      tags:
        - Policies
      summary: Get policy stats
      description: >
        Per-policy hit counts for the last 24 hours, keyed by policy ID. Every
        policy in the organization has an entry, even with zero hits.


        **Required permission:** `policies:read`
      operationId: getPolicyStats
      parameters:
        - name: window
          in: query
          description: Only `24h` is supported.
          schema:
            type: string
            enum:
              - 24h
            default: 24h
      responses:
        '200':
          description: Stats keyed by policy ID.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    additionalProperties:
                      $ref: '#/components/schemas/PolicyStats'
              example:
                data:
                  7b1d4c2e-0000-4000-8000-000000000002:
                    evaluated: 120
                    allow: 100
                    deny: 15
                    redact: 2
                    audit: 3
                    trend:
                      - 0
                      - 0
                      - 4
                      - 1
                      - 0
                      - 0
                      - 2
                      - 0
                      - 0
                      - 0
                      - 5
                      - 0
                      - 0
                      - 0
                      - 0
                      - 3
                      - 0
                      - 0
                      - 0
                      - 0
                      - 1
                      - 0
                      - 0
                      - 2
                    lastTriggered: '2026-01-01T00:00:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ZodValidationFailed'
components:
  schemas:
    PolicyStats:
      type: object
      properties:
        evaluated:
          type: integer
        allow:
          type: integer
        deny:
          type: integer
        redact:
          type: integer
        audit:
          type: integer
          description: Count of `alert` actions.
        trend:
          type: array
          items:
            type: integer
          description: 24 hourly buckets
          oldest first.: null
        lastTriggered:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: Forbidden
        required:
          type: string
          description: The permission the caller lacks.
          example: policies:write
    ZodValidationError:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            name:
              type: string
              example: ZodError
            message:
              type: string
              description: JSON string of the validation issues.
  responses:
    Unauthorized:
      description: No valid session or API key, or the key's creator is no longer a member.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
    Forbidden:
      description: The caller lacks the required permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenError'
    ZodValidationFailed:
      description: Validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ZodValidationError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ig_...
      description: >-
        An Igris API key. It acts with the current role and permission overrides
        of the member who created it.

````

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