---
title: "PolicyStatsResponse"
url: "https://developers.zinnia.com/apis/policy-service-0-1-0/versions/8306e031-b41c-452a-a7ed-d73d65602086/schemas/PolicyStatsResponse"
---

> Full API specification: https://developers.zinnia.com/apis/policy-service-0-1-0/versions/8306e031-b41c-452a-a7ed-d73d65602086.md

# PolicyStatsResponse

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Policy Service
  version: 0.0.21
servers:
  - url: https://qa.api.zinnia.io
components:
  schemas:
    PolicyAgeBucket:
      type: object
      properties:
        label:
          type: string
          description: Bucket label
          example: "1"
        fromDays:
          type: number
          description: Inclusive lower bound in days
          example: 0
        toDays:
          type: number
          description: Exclusive upper bound in days (null for open-ended)
          example: 2
          nullable: true
        count:
          type: number
          description: Total count of policies in this age bucket
          example: 25
        counts:
          description: Policy count breakdown by status
          default: []
          type: array
          items:
            $ref: "#/components/schemas/PolicyStatusCount"
      required:
        - label
        - fromDays
        - toDays
        - count
        - counts
    PolicyStatGroup:
      type: object
      properties:
        attribute:
          type: string
          description: The attribute this group breaks down by
          enum:
            - carrier
            - productName
            - lineOfBusiness
            - policyStatus
          example: carrier
        counts:
          description: Count breakdown for this attribute
          default: []
          type: array
          items:
            $ref: "#/components/schemas/PolicyGroupCount"
      required:
        - attribute
        - counts
    PolicyStatusCount:
      type: object
      properties:
        label:
          type: string
          description: Policy status label
          example: ACTIVE
        value:
          type: number
          description: Count for this status
          example: 20
    PolicyGroupCount:
      type: object
      properties:
        key:
          type: string
          description: Grouped value key
          example: ELIC
        count:
          type: number
          description: Count for this group value
          example: 150
    PolicyStatsResponse:
      type: object
      properties:
        count:
          type: number
          description: Total count of policies matching the search criteria
          example: 344
        ageBuckets:
          description: Policies grouped by age in days
          type: array
          items:
            $ref: "#/components/schemas/PolicyAgeBucket"
        stats:
          description: Policy counts grouped by requested dimensions
          default: []
          type: array
          items:
            $ref: "#/components/schemas/PolicyStatGroup"
      required:
        - count
        - ageBuckets
        - stats
```
