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

# Get Event Enrichment Metrics

> Read event ingestion and IP-enrichment counters for a period: cache hit rate, unique-IP ratio and fresh lookups per thousand events.

Get Event Enrichment Metrics API Prompt
Copy prompt to clipboard

<pre>
  \`Read the event ingestion and IP-enrichment counters of my Didit application for a period.

  Endpoint:
  GET [https://verification.didit.me/v3/events/enrichment-metrics/?days=30](https://verification.didit.me/v3/events/enrichment-metrics/?days=30)

  Authentication:
  Use the x-api-key header with my Didit API key. A scoped key needs transactions: read.

  Goal:

  * Monitor event volume and confirm that IP enrichment is resolved once per unique address rather than once per event, for a usage dashboard or an alert.

  Behavior:

  * days defaults to 30 and is clamped to 1-365; a non-integer value falls back to 30.
  * The period covers today plus the previous days days, by UTC calendar day.
  * Counters are summed over every lane (server, batch and device).
  * The three ratios are null when their denominator is zero.

  Example call:
  curl -X GET "[https://verification.didit.me/v3/events/enrichment-metrics/?days=30](https://verification.didit.me/v3/events/enrichment-metrics/?days=30)" \
  -H "x-api-key: YOUR\_API\_KEY"

  What to read from the response:

  * events\_ingested - new events stored (replays are not counted).
  * events\_rejected - items rejected inside batch requests (a rejected single-event request is not counted).
  * enrichment\_lookups - events whose public IP address was resolved; enrichment\_cache\_hits - answered from the cache; enrichment\_provider\_calls - needed a fresh resolution.
  * enrichment\_skipped\_low\_value - low-value telemetry whose address was not cached; it never triggers a lookup of its own.
  * unique\_ips\_seen - distinct addresses that needed a fresh resolution.
  * cache\_hit\_rate, unique\_ip\_ratio, provider\_calls\_per\_1k\_events - the ratios.
  * period\_days - the period actually applied.

  Failure modes:

  * 401 - the API key has expired.
  * 403 - missing or invalid API key, or a scoped key without transactions: read.

  Side effects: none. This is a pure read.

  For the full integration shape, see /integration/integration-prompt.\`
</pre>

Paste into

The Business Console shows the same numbers above the events list. See [IP enrichment](/transaction-monitoring/events.md#ip-enrichment) in the event ingestion guide for why low-value telemetry reads enrichment only when another event already resolved the address, and [IP enrichment](/transaction-monitoring/ip-enrichment.md) for the fields an enriched address carries.


## OpenAPI

````yaml GET /v3/events/enrichment-metrics/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/events/enrichment-metrics/:
    get:
      tags:
        - Monitoring Events
      summary: Get event enrichment metrics
      description: >-
        Return the event ingestion and IP-enrichment counters of your
        application for a period, summed over every lane (server, batch and
        device), so you can watch event volume and confirm that enrichment is
        resolved once per unique address rather than once per event. The period
        covers today plus the previous `days` days, counted by UTC calendar
        date. The three ratios are null when their denominator is zero. A scoped
        API key needs `transactions: read`. See [IP
        enrichment](https://docs.didit.me/transaction-monitoring/events#ip-enrichment).
      operationId: get_monitoring_event_enrichment_metrics
      parameters:
        - name: days
          in: query
          required: false
          description: >-
            Length of the period in days. Defaults to 30; values are clamped to
            1 to 365, and a non-integer value falls back to 30. The value
            applied is returned as `period_days`.
          schema:
            type: integer
            default: 30
            minimum: 1
            maximum: 365
          example: 30
      responses:
        '200':
          description: Counters and ratios for the period.
          content:
            application/json:
              schema:
                type: object
                required:
                  - events_ingested
                  - events_rejected
                  - enrichment_lookups
                  - enrichment_cache_hits
                  - enrichment_provider_calls
                  - enrichment_skipped_low_value
                  - unique_ips_seen
                  - period_days
                  - cache_hit_rate
                  - unique_ip_ratio
                  - provider_calls_per_1k_events
                properties:
                  events_ingested:
                    type: integer
                    description: New events stored. Idempotent replays are not counted.
                  events_rejected:
                    type: integer
                    description: >-
                      Items rejected inside batch requests (server and device
                      lanes). A rejected single-event request is not counted.
                  enrichment_lookups:
                    type: integer
                    description: >-
                      Events whose public IP address was resolved, from the
                      cache or freshly.
                  enrichment_cache_hits:
                    type: integer
                    description: Lookups answered from the cache.
                  enrichment_provider_calls:
                    type: integer
                    description: Lookups that needed a fresh resolution of the address.
                  enrichment_skipped_low_value:
                    type: integer
                    description: >-
                      Low-value telemetry events whose address was not already
                      known. They never trigger a fresh resolution of their own.
                  unique_ips_seen:
                    type: integer
                    description: Addresses that needed a fresh resolution.
                  period_days:
                    type: integer
                    description: The `days` value applied after clamping.
                  cache_hit_rate:
                    type: number
                    nullable: true
                    description: >-
                      `enrichment_cache_hits / enrichment_lookups`, rounded to 4
                      decimals. Null when there were no lookups.
                  unique_ip_ratio:
                    type: number
                    nullable: true
                    description: >-
                      `unique_ips_seen / events_ingested`, rounded to 4
                      decimals. Null when no events were ingested.
                  provider_calls_per_1k_events:
                    type: number
                    nullable: true
                    description: >-
                      Fresh resolutions per 1000 ingested events, rounded to 2
                      decimals. Null when no events were ingested.
              examples:
                Last 30 days:
                  value:
                    events_ingested: 128450
                    events_rejected: 214
                    enrichment_lookups: 41230
                    enrichment_cache_hits: 40118
                    enrichment_provider_calls: 1112
                    enrichment_skipped_low_value: 74320
                    unique_ips_seen: 1112
                    period_days: 30
                    cache_hit_rate: 0.973
                    unique_ip_ratio: 0.0087
                    provider_calls_per_1k_events: 8.66
                No events yet:
                  value:
                    events_ingested: 0
                    events_rejected: 0
                    enrichment_lookups: 0
                    enrichment_cache_hits: 0
                    enrichment_provider_calls: 0
                    enrichment_skipped_low_value: 0
                    unique_ips_seen: 0
                    period_days: 30
                    cache_hit_rate: null
                    unique_ip_ratio: null
                    provider_calls_per_1k_events: null
        '401':
          description: >-
            The scoped API key has expired. Only an expired key gets `401`; a
            missing or invalid key gets `403`.
          content:
            application/json:
              examples:
                Expired key:
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            Missing or invalid `x-api-key` (this endpoint answers `403`, never
            `401`, for a missing or invalid key), a scoped key without
            `transactions: read`, a key limited to some workflows or to approved
            sessions (such a key never reaches transaction monitoring data), or
            a request from outside the key's IP allowlist.
          content:
            application/json:
              examples:
                Missing or invalid API key:
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without access:
                  value:
                    detail: This API key has no read access to transactions.
                Key limited to workflows or approved sessions:
                  value:
                    detail: >-
                      This API key only reaches sessions inside its workflow or
                      status limits, so it can't use this endpoint.
                IP not allowed:
                  value:
                    detail: This API key can't be used from this IP address.
        '429':
          description: >-
            Rate limit exceeded: `GET` requests share a budget of 600 requests
            per minute per API key. Wait `Retry-After` seconds, then retry.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
                example: 30
          content:
            application/json:
              examples:
                Throttled:
                  value:
                    detail: >-
                      GET request rate limit exceeded. You can make up to 600
                      requests per minute.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X GET
            'https://verification.didit.me/v3/events/enrichment-metrics/?days=30'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: >-
            import os


            import requests


            resp = requests.get(
                'https://verification.didit.me/v3/events/enrichment-metrics/',
                headers={'x-api-key': os.environ['DIDIT_API_KEY']},
                params={'days': 30},
                timeout=10,
            )

            resp.raise_for_status()

            metrics = resp.json()

            print(metrics['events_ingested'], metrics['cache_hit_rate'],
            metrics['provider_calls_per_1k_events'])
        - lang: javascript
          label: JavaScript
          source: >-
            const resp = await
            fetch('https://verification.didit.me/v3/events/enrichment-metrics/?days=30',
            {
              headers: { 'x-api-key': process.env.DIDIT_API_KEY },
            });

            if (!resp.ok) throw new Error(`Request failed: ${resp.status}`);

            const metrics = await resp.json();

            console.log(metrics.events_ingested, metrics.cache_hit_rate,
            metrics.provider_calls_per_1k_events);
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is missing, wrong, revoked or expired; 403 means the key
        has no access to this resource or action, or the request came from an
        address outside its IP list; 404 on a session route means the session is
        outside the key's workflows or statuses. A key without media access
        receives image, video and PDF URLs as null, and a key without sessions
        write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.

````

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