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

# Get alert rule statistics

> Returns how many evaluations of an alert rule ended in each status, summed over all of the rule's
alerts per day or per month. Only days or months with evaluations have buckets. Buckets start at
midnight in the project's timezone. The statistics are kept for about 13 months and refreshed
every 30 minutes, so the current day is incomplete.

Required API key permission: `observe:alerts:read`.



## OpenAPI

````yaml /api-reference/openapi/observe.yaml get /observe/alertRuleStatistics
openapi: 3.1.1
info:
  version: 1.0.0
  title: Corbado API
  description: >
    # Introduction

    This documentation gives an overview of all Corbado API calls to implement
    authentication observe.
  contact:
    name: Corbado team
    email: support@corbado.com
    url: https://www.corbado.com
servers:
  - url: https://api.cloud.corbado.io/v1
security:
  - bearerAuth: []
tags:
  - name: ObserveFlow
    description: Flow search and related APIs
    x-group: Journeys and users
  - name: ObserveSubFlow
    description: Subflow search and related APIs
    x-group: Journeys and users
  - name: ObserveUser
    description: User search and related APIs
    x-group: Journeys and users
  - name: ObserveClientEnv
    description: Client environment search APIs
    x-group: Journeys and users
  - name: ObserveTimeSeries
    description: Time series query APIs
    x-group: Metrics and funnels
  - name: ObserveFunnel
    description: Historical funnel metrics, dictionaries and coverage.
    x-group: Metrics and funnels
  - name: ObserveEvent
    description: Event ingestion and event feed APIs
    x-group: Events
  - name: ObserveError
    description: Named authentication errors and recommendations.
    x-group: Error management
  - name: ObserveErrorFlavour
    description: Error variants and their impact on authentication outcomes.
    x-group: Error management
  - name: ObserveAlert
    description: Authentication alert rules, instances and history.
    x-group: Alert management
  - name: ObserveAnnotation
    description: Annotation APIs (dated notes for analytics context)
    x-group: Annotations
  - name: ObserveTableExport
    description: Table export file listing and download APIs
    x-group: Data exports
  - name: ObserveTimeSeriesExport
    description: Time-series export generation and downloads.
    x-group: Data exports
  - name: ObserveDataExport
    description: Data export APIs
    x-group: User data
  - name: ObserveDataDeletionJob
    description: Data deletion job APIs
    x-group: User data
  - name: ObserveFlowTypeDefinition
    description: Flow type definitions used in authentication journeys.
    x-group: Catalogs and labels
  - name: ObserveCatalog
    description: Catalog APIs
    x-group: Catalogs and labels
  - name: OpenAPI
    description: Downloadable API specification
  - name: ProjectOperationExecution
    description: Project-scoped operation history and pipeline health
  - name: ObserveClassification
    description: Flow and subflow classification APIs
  - name: ObserveIntegrationStats
    description: Integration stats APIs
  - name: ObserveTimeSeriesPrecalculation
    description: Time series precalculation APIs
  - name: ObserveIDList
    x-group: Saved ID lists
    description: Stored ID-list selection APIs
  - name: ObserveDataContext
    description: Schema-loose data context APIs for agent and debugging tooling
  - name: ObserveData
    description: Observe data administration APIs
  - name: ObserveTrackingStats
    description: Tracking ingestion stats APIs
  - name: ObserveExperiment
    x-group: Experiments
    description: Experiment catalog and run APIs
  - name: ObserveDataPolicy
    description: >-
      Project data policy catalogue (retention selected by the SDK's
      meta.dataPolicy code)
  - name: ObserveMetadata
    x-group: Metadata
    description: Authenticator metadata APIs (FIDO MDS + passkey AAGUID)
  - name: ObservePasskey
    x-group: Passkey analysis
    description: Observed passkey search and cohort analysis.
paths:
  /observe/alertRuleStatistics:
    get:
      tags:
        - ObserveAlert
      summary: Get alert rule statistics
      description: >-
        Returns how many evaluations of an alert rule ended in each status,
        summed over all of the rule's

        alerts per day or per month. Only days or months with evaluations have
        buckets. Buckets start at

        midnight in the project's timezone. The statistics are kept for about 13
        months and refreshed

        every 30 minutes, so the current day is incomplete.


        Required API key permission: `observe:alerts:read`.
      operationId: ObserveAlertRuleStatisticsGet
      parameters:
        - name: alertRuleID
          in: query
          required: true
          description: The alert rule to describe (format `aru-<number>`).
          schema:
            type: string
          x-oapi-codegen-extra-tags:
            validate: required,id=aru
        - name: interval
          in: query
          required: true
          description: >-
            Bucket size, one day or one calendar month in the project's
            timezone.
          schema:
            type: string
            enum:
              - daily
              - monthly
          x-oapi-codegen-extra-tags:
            validate: required,oneof=daily monthly
        - name: fromMs
          in: query
          required: true
          description: Window start (epoch ms, inclusive).
          schema:
            type: integer
            format: int64
          x-oapi-codegen-extra-tags:
            validate: required
        - name: toMs
          in: query
          required: true
          description: >-
            Window end (epoch ms, exclusive). Must be after fromMs; the window
            may span at most 500 days.
          schema:
            type: integer
            format: int64
          x-oapi-codegen-extra-tags:
            validate: required
      responses:
        '200':
          description: Statistics for the alert rule over the window.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/observeAlertRuleStatistics'
        default:
          $ref: '#/components/responses/error'
      security:
        - bearerAuth:
            - observe:alerts:read
components:
  schemas:
    observeAlertRuleStatistics:
      type: object
      description: >
        One alert rule's evaluations over a requested window, counted per status
        and bucketed by day or month. dataFromMs and dataToMs span every day
        with statistics, regardless of the window, so a client knows how far it
        can navigate. Both are absent when the rule has no statistics yet.
      required:
        - buckets
      properties:
        buckets:
          type: array
          maxItems: 500
          items:
            $ref: '#/components/schemas/observeAlertRuleStatisticsBucket'
        dataFromMs:
          type: integer
          format: int64
          description: Start of the first day with statistics, in milliseconds since epoch.
        dataToMs:
          type: integer
          format: int64
          description: Start of the last day with statistics, in milliseconds since epoch.
    observeAlertRuleStatisticsBucket:
      type: object
      description: >
        One day or month of a rule's evaluations, summed over all of its alerts.
        Every count is present, zero included.
      required:
        - bucketStartMs
        - normalCount
        - pendingCount
        - firingCount
        - noDataCount
        - errorCount
      properties:
        bucketStartMs:
          type: integer
          format: int64
          description: >-
            Start of the day or month in the project's timezone, in milliseconds
            since epoch.
        normalCount:
          type: integer
          format: int64
        pendingCount:
          type: integer
          format: int64
        firingCount:
          type: integer
          format: int64
        noDataCount:
          type: integer
          format: int64
        errorCount:
          type: integer
          format: int64
    errorRspV2:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            message:
              description: Error message
              type: string
              example: Validation failed
            details:
              description: Validation error details per field
              type: array
              items:
                type: object
                required:
                  - field
                  - message
                properties:
                  field:
                    description: Field name that failed validation
                    type: string
                    example: projectID
                  message:
                    description: Validation error message
                    type: string
                    example: required
  responses:
    error:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorRspV2'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use an Observe API key from the management console. The key selects the
        project and must grant the permission listed on the operation. Keep this
        key on your server.

````