> ## 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.

# Webhook 目标数据分析 API

> Didit 提供单个 Webhook 目标在任意日期范围内的投递总数、失败率和响应时间，包括整体数据及按 UTC 日期的每日数据。



获取 Webhook 目标分析 API 提示词
        将提示词复制到剪贴板



      
      

\<pre>

\`Read delivery statistics for one Didit webhook destination through the Management API.

Endpoint:
GET https://verification.didit.me/v3/webhook/destinations/{destination_uuid}/analytics/

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

Goal:
\- Measure how reliably and how fast my endpoint accepts webhooks, to alert on failures or chart delivery health.

Path parameter:
\- destination_uuid: the destination uuid from GET /v3/webhook/destinations/.

Query parameters (optional):
\- date_from, date_to: UTC days as YYYY-MM-DD, both inclusive. Without them, every delivery of the destination is included. Delivery records are available for about 30 days, so no range reaches further back.

Behavior:
\- summary: total_deliveries, failed_deliveries, error_rate_percentage (whole number, 0 when there are no deliveries), min_response_time_ms, avg_response_time_ms, max_response_time_ms (null when there is no data). A delivery not attempted yet counts in total_deliveries, never in failed_deliveries, and has no response time.
\- points: one entry per UTC day that had deliveries, oldest first, with the same counters plus date. Days without deliveries are omitted, so fill the gaps with zeros when you chart them.
\- Every attempt counts: the first send of an event, each automatic retry and each resend.
\- Failed means HTTP 400 or above. A timeout is recorded as 504 and a connection failure as 503, so both count as failed.

Example call:
curl -X GET "https://verification.didit.me/v3/webhook/destinations/{destination_uuid}/analytics/?date_from=2026-05-01&date_to=2026-05-31" \
-H "x-api-key: YOUR_API_KEY"

Failure modes:
\- 400: { "date_from": ["Date has wrong format. Use one of these formats instead: YYYY-MM-DD."] } or { "date_to": ["date_to must be greater than or equal to date_from."] }
\- 401: { "detail": "This API key has expired." }
\- 403: { "detail": "You do not have permission to perform this action." } or { "detail": "This API key has no read access to webhooks." }
\- 404: { "detail": "Webhook destination not found." }
\- 429: more than 600 GET requests per minute with this key; wait for Retry-After.

Side effects: none. This is a pure read.

For the full integration shape, see /integration/integration-prompt.`

\</pre>



      
      

粘贴到

使用此 endpoint 可以查看您所选时间段内某个 Webhook 目标的情况。要查看导致失败的各次尝试，请先通过 [列出 Webhook 目标投递](https://docs.didit.me/zh/management-api/webhook/list-deliveries.md) 列出投递记录，再通过 [获取 Webhook 目标投递](https://docs.didit.me/zh/management-api/webhook/get-delivery.md) 打开其中一条。Didit 会自动重试哪些响应，详见[重试策略](https://docs.didit.me/zh/integration/webhooks.md#重试策略)。


## OpenAPI

````yaml zh/openapi-25.json GET /v3/webhook/destinations/{destination_uuid}/analytics/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份证件验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/webhook/destinations/{destination_uuid}/analytics/:
    get:
      tags:
        - Webhook
      summary: 获取 Webhook 目标分析
      description: >-
        单个 Webhook 目标在整个时间范围（`summary`）内以及按 UTC
        日（`points`）细分的投递总量、失败率和响应时间。每次尝试均计为一次投递：事件的首次发送、每次自动[重试](https://docs.didit.me/zh/integration/webhooks#重试策略)以及每次重新发送。当记录的
        HTTP 状态为 400 或以上时，该投递被视为失败，因此超时（记录为 `504`）和连接失败（`503`）均计为失败；仍在排队中的投递仅计入
        `total_deliveries`。投递记录保留约 30 天。限定作用域的 API 密钥需要 `webhooks: read` 权限。
      operationId: get_webhook_destination_analytics
      parameters:
        - name: destination_uuid
          in: path
          required: true
          description: 目标的 UUID（`GET /v3/webhook/destinations/` 返回的 `uuid`）。
          schema:
            type: string
            format: uuid
          example: 11111111-2222-3333-4444-555555555555
        - name: date_from
          in: query
          required: false
          description: 包含的首个 UTC 日期，格式为 `YYYY-MM-DD`（含）。省略则从最早可用的投递开始。支持将 `dateFrom` 作为别名。
          schema:
            type: string
            format: date
          example: '2026-10-01'
        - name: date_to
          in: query
          required: false
          description: >-
            要包含的最后一个 UTC 日期，格式为 `YYYY-MM-DD`（含）。不得早于 `date_from`。可接受 `dateTo`
            作为别名。
          schema:
            type: string
            format: date
          example: '2026-10-16'
      responses:
        '200':
          description: 目标的投递统计信息。
          content:
            application/json:
              schema:
                type: object
                required:
                  - summary
                  - points
                properties:
                  summary:
                    type: object
                    description: 所请求范围内的总计。
                    required:
                      - total_deliveries
                      - failed_deliveries
                      - min_response_time_ms
                      - avg_response_time_ms
                      - max_response_time_ms
                      - error_rate_percentage
                    properties:
                      total_deliveries:
                        type: integer
                        minimum: 0
                        description: 投递尝试，包括排队中的尝试。
                      failed_deliveries:
                        type: integer
                        minimum: 0
                        description: 记录的 HTTP 状态码为 400 或更高的尝试次数。
                      min_response_time_ms:
                        type: integer
                        nullable: true
                        description: 最快的尝试耗时（毫秒），若没有尝试记录时间则为 `null`。
                      avg_response_time_ms:
                        type: integer
                        nullable: true
                        description: 平均尝试时间（毫秒），四舍五入取整；若无尝试记录时间则为 `null`。
                      max_response_time_ms:
                        type: integer
                        nullable: true
                        description: 最慢的一次尝试（以毫秒计），当没有尝试记录时间时为 `null`。
                      error_rate_percentage:
                        type: integer
                        minimum: 0
                        maximum: 100
                        description: >-
                          `failed_deliveries` / `total_deliveries` x
                          100，四舍五入为整数。没有投递时为 `0`。
                  points:
                    type: array
                    description: >-
                      发生过投递的每个 UTC
                      天对应一个条目，按时间从早到晚排列。没有投递的日期会被省略，因此在绘制图表时请用零补齐空缺。
                    items:
                      type: object
                      required:
                        - date
                        - total_deliveries
                        - failed_deliveries
                        - min_response_time_ms
                        - avg_response_time_ms
                        - max_response_time_ms
                      properties:
                        date:
                          type: string
                          format: date
                          description: UTC 日期，`YYYY-MM-DD`。
                        total_deliveries:
                          type: integer
                          minimum: 0
                          description: 投递尝试，包括排队中的尝试。
                        failed_deliveries:
                          type: integer
                          minimum: 0
                          description: 记录的 HTTP 状态码为 400 或更高的尝试次数。
                        min_response_time_ms:
                          type: integer
                          nullable: true
                          description: 最快的尝试耗时（毫秒），若没有尝试记录时间则为 `null`。
                        avg_response_time_ms:
                          type: integer
                          nullable: true
                          description: 平均尝试时间（毫秒），四舍五入取整；若无尝试记录时间则为 `null`。
                        max_response_time_ms:
                          type: integer
                          nullable: true
                          description: 最慢的一次尝试（以毫秒计），当没有尝试记录时间时为 `null`。
              examples:
                Three days of deliveries:
                  value:
                    summary:
                      total_deliveries: 1250
                      failed_deliveries: 12
                      min_response_time_ms: 38
                      avg_response_time_ms: 164
                      max_response_time_ms: 5004
                      error_rate_percentage: 1
                    points:
                      - date: '2026-10-14'
                        total_deliveries: 410
                        failed_deliveries: 0
                        min_response_time_ms: 38
                        avg_response_time_ms: 152
                        max_response_time_ms: 911
                      - date: '2026-10-15'
                        total_deliveries: 395
                        failed_deliveries: 12
                        min_response_time_ms: 41
                        avg_response_time_ms: 190
                        max_response_time_ms: 5004
                      - date: '2026-10-16'
                        total_deliveries: 445
                        failed_deliveries: 0
                        min_response_time_ms: 40
                        avg_response_time_ms: 151
                        max_response_time_ms: 1220
                No deliveries in range:
                  value:
                    summary:
                      total_deliveries: 0
                      failed_deliveries: 0
                      min_response_time_ms: null
                      avg_response_time_ms: null
                      max_response_time_ms: null
                      error_rate_percentage: 0
                    points: []
        '400':
          description: >-
            `date_from` 或 `date_to` 不是 `YYYY-MM-DD` 格式的日期，或者 `date_to` 早于
            `date_from`。
          content:
            application/json:
              schema:
                type: object
                description: 每个无效字段映射到的消息列表。
                additionalProperties:
                  type: array
                  items:
                    type: string
              examples:
                Malformed date:
                  value:
                    date_from:
                      - >-
                        Date has wrong format. Use one of these formats instead:
                        YYYY-MM-DD.
                Reversed range:
                  value:
                    date_to:
                      - date_to must be greater than or equal to date_from.
        '401':
          description: API 密钥已过期：它在创建时设置的到期日期已过。错误或已撤销的密钥也会收到 `401`；缺失密钥则收到 `403`。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Expired key:
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            该请求不被允许。缺失、无效或已撤销的 `x-api-key` 会收到 `You do not have permission to
            perform this action.`。缺少此 endpoint 所需访问权限的限定作用域密钥会收到指明所缺权限的消息，而在其 IP
            白名单之外使用的密钥会收到 `This API key can't be used from this IP address.`。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Missing or invalid key:
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without webhooks read:
                  value:
                    detail: This API key has no read access to webhooks.
                Outside the IP allowlist:
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: 应用不存在具有此 UUID 的目标，或者已被删除。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Destination not found:
                  value:
                    detail: Webhook destination not found.
        '429':
          description: 超出速率限制：当前一分钟窗口内该 API 密钥的 GET 请求超过 600 次。请等待 `Retry-After` 秒后再重试。
          headers:
            Retry-After:
              description: 重试前需要等待的秒数。
              schema:
                type: integer
                minimum: 1
                example: 30
            X-RateLimit-Limit:
              description: 一分钟时间窗口内允许的请求数（600）。
              schema:
                type: integer
                example: 600
            X-RateLimit-Remaining:
              description: 当前时间窗口内剩余的请求数。
              schema:
                type: integer
                example: 0
            X-RateLimit-Reset:
              description: 当前窗口重置的 Unix 时间（秒）。
              schema:
                type: integer
                example: 1792056120
            X-RateLimit-Scope:
              description: 发生超支的预算名称。
              schema:
                type: string
                example: generic-get
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              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/webhook/destinations/11111111-2222-3333-4444-555555555555/analytics/?date_from=2026-10-01&date_to=2026-10-16'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.webhooks.destinations.retrieve_analytics(
                "11111111-2222-3333-4444-555555555555",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: >-
            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            const result = await
            didit.webhooks.destinations.retrieveAnalytics("11111111-2222-3333-4444-555555555555");

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Webhooks.Destinations.RetrieveAnalytics(ctx, \"11111111-2222-3333-4444-555555555555\", didit.WebhooksDestinationsRetrieveAnalyticsParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.webhooks().destinations().retrieveAnalytics("11111111-2222-3333-4444-555555555555");

            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $result =
            $didit->webhooks->destinations->retrieveAnalytics('11111111-2222-3333-4444-555555555555');

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: >-
            require "didit"


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            result =
            didit.webhooks.destinations.retrieve_analytics("11111111-2222-3333-4444-555555555555")

            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await
            client.Webhooks.Destinations.RetrieveAnalyticsAsync("11111111-2222-3333-4444-555555555555");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

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