> ## 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 投递的详情：目标 URL、您的端点返回的 HTTP 响应，以及 Didit 发送的确切签名请求头和 JSON 正文。



获取会话 Webhook 投递 API 提示词
        将提示词复制到剪贴板



      
      

\<pre>

\`Retrieve one webhook delivery of a Didit verification session through the API.

Endpoint:
GET https://verification.didit.me/v3/session/{session_id}/webhook/{webhook_uuid}
(no trailing slash)

Authentication:
Send my Didit API key in the x-api-key header. A scoped key needs sessions: read and decisions: read.

Goal:
\- Read exactly what Didit sent to my webhook endpoint for one delivery and what my endpoint answered, to debug a rejected or missing event.

Behavior:
\- {webhook_uuid} is the uuid of an entry from GET /v3/session/{session_id}/webhooks/. It must belong to the session in the path; a delivery of another session returns 404.
\- request_header and request_body are JSON-encoded strings. Parse them with a JSON parser.
\- To check my signature code, recompute X-Signature-V2 from the parsed request_body with my destination's secret (the application-level secret for a delivery sent to the legacy webhook_url) and compare it with the header. A scoped key without media: read or sessions: write receives a redacted body, which no longer matches the signatures.

Example call:
curl -X GET "https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/webhook/9f8e7d6c-5b4a-4321-8fed-cba987654321" \
-H "x-api-key: YOUR_API_KEY"

What to read from the response:
\- response_status: the HTTP status my endpoint returned (null while queued, 504 timeout, 503 connection failure, 400 URL refused as unsafe).
\- request_url: where it was sent.
\- request_header: the X-Signature, X-Signature-V2, X-Signature-Simple and X-Timestamp values sent.
\- request_body: the webhook payload (event_id, webhook_type, session_id, status, decision when present).
\- status, webhook_type, created_at.

Failure modes:
\- 401: the API key has expired.
\- 403: missing key (a wrong, revoked or expired key gets 401), a key of another application, a scoped key without the permissions above, or a request from outside the key's IP allowlist.
\- 404: the session does not exist, was deleted, or is outside a scoped key's limits, or the delivery does not belong to this session ({ "detail": "No WebhookLog matches the given query." }).
\- 429: more than 600 reads per minute for this API key; honor Retry-After.

Side effects: none. This is a pure read.

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

\</pre>



      
      

粘贴到

`request_body` 中的 payload 与 [Webhook](https://docs.didit.me/zh/integration/webhooks.md#payload-结构) 中描述的一致，请求头则与 [签名验证](https://docs.didit.me/zh/integration/webhooks.md#签名验证) 中介绍的相同。若要重新发送该投递，请使用 [重新发送会话 Webhook 投递](https://docs.didit.me/zh/management-api/sessions/resend-webhook.md)。


## OpenAPI

````yaml zh/openapi-25.json GET /v3/session/{sessionId}/webhook/{webhook_uuid}
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/session/{sessionId}/webhook/{webhook_uuid}:
    get:
      tags:
        - Sessions
      summary: 获取会话 Webhook 投递记录
      description: >-
        获取验证会话的一次 Webhook 投递：投递的目标 URL、您的 endpoint 返回的 HTTP 状态，以及 Didit
        发送的准确请求头和 JSON 请求体。`request_header` 和 `request_body` 为 JSON
        文本；若要检查您的[签名验证](https://docs.didit.me/zh/integration/webhooks#签名验证)，请使用其发送目标所对应的密钥（如果投递到旧版
        Webhook URL，则使用应用级密钥）根据解析后的请求体重新计算 `X-Signature-V2`。路径末尾不能带斜杠：若带斜杠将返回
        `404`。作用域受限的 API 密钥需要 `sessions: read` 和 `decisions: read` 权限。
      operationId: get_v3_session_webhook
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            用户（KYC）或企业（KYB）验证会话的 UUID：由 `POST /v3/session/` 返回的
            `session_id`。服务器会针对两种会话类型进行解析。


            **必须是有效的 UUID。** 该路由仅匹配格式正确的 UUID，因此格式错误的值在任何应用代码运行之前就会被 URL
            路由器拒绝，并且响应将是 `404` **HTML** 页面，而不是如下所示的 JSON `{"detail": ...}` 封装。
          schema:
            type: string
            format: uuid
          example: 22222222-3333-4444-5555-666666666666
        - name: webhook_uuid
          in: path
          required: true
          description: >-
            投递的 UUID：由 `GET /v3/session/{sessionId}/webhooks/` 返回的条目的
            `uuid`。它必须属于路径中的会话。
          schema:
            type: string
            format: uuid
          example: 66666666-7777-8888-9999-000000000001
      responses:
        '200':
          description: 投递，包含其请求头和请求体。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionWebhookDelivery'
              examples:
                Connection failure:
                  value:
                    uuid: 66666666-7777-8888-9999-000000000001
                    session_id: 22222222-3333-4444-5555-666666666666
                    request_url: https://yourapp.com/webhooks/didit
                    response_status: 503
                    status: In Progress
                    webhook_type: status.updated
                    request_header: >-
                      {"Content-Type": "application/json", "X-Signature":
                      "a5e02a03404e1337a0198e6be15d34abbd053c658a0e51e5d0e78554213ef29b",
                      "X-Signature-V2":
                      "927e7cb770c94ce745939bff73f04aa200015f3bc64795ba46c2aaf78a6cedc5",
                      "X-Signature-Simple":
                      "e37b0d4c716c72bb5ae7127b9cc455d28ab4686e9e22312b4ec2327409a73302",
                      "X-Timestamp": "1792056078", "User-Agent":
                      "DiditWebhook/2.0 +https://didit.me"}
                    request_body: >-
                      {"application_id":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","created_at":1792056057,"environment":"live","event_id":"33333333-4444-5555-6666-777777777777","sandbox_scenario":null,"session_id":"22222222-3333-4444-5555-666666666666","status":"In
                      Progress","timestamp":1792056078,"vendor_data":"user-123","webhook_type":"status.updated","workflow_id":"44444444-5555-6666-7777-888888888888","workflow_version":3}
                    created_at: '2026-10-15T09:21:18.412345Z'
        '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`、密钥无效或已撤销会收到 `Authentication credentials were
            not provided or are invalid.`。属于其他应用的密钥会收到 `You do not have
            permission to perform this action.`。缺少此 endpoint
            所需访问权限的限定作用域密钥会收到指明所缺权限的消息，而在其 IP 白名单之外使用的密钥会收到 `This API key can't
            be used from this IP address.`。未知的 `sessionId` 会在检查凭据之前返回 `404`。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Missing or invalid key:
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                Key of another application:
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without sessions read:
                  value:
                    detail: This API key has no read access to sessions.
                Scoped key without decisions read:
                  value:
                    detail: This API key has no read access to decisions.
                Outside the IP allowlist:
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: >-
            会话不存在或已被删除（在检查凭证之前返回 `Not found.`），或者超出了限定作用域密钥的工作流或状态限制（`Session
            not found.`）。投递记录不存在、属于其他会话或已不可用时返回 `No WebhookLog matches the given
            query.`
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Unknown session:
                  value:
                    detail: Not found.
                Outside the key's limits:
                  value:
                    detail: Session not found.
                Delivery not in this session:
                  value:
                    detail: No WebhookLog matches the given query.
        '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/session/22222222-3333-4444-5555-666666666666/webhook/66666666-7777-8888-9999-000000000001'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.webhooks.retrieve(
                "22222222-3333-4444-5555-666666666666",
                "66666666-7777-8888-9999-000000000001",
            )
            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.sessions.webhooks.retrieve(
              "22222222-3333-4444-5555-666666666666",
              "66666666-7777-8888-9999-000000000001",
            );
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.Webhooks.Retrieve(ctx, \"22222222-3333-4444-5555-666666666666\", \"66666666-7777-8888-9999-000000000001\")\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.sessions().webhooks().retrieve("22222222-3333-4444-5555-666666666666",
            "66666666-7777-8888-9999-000000000001");

            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->sessions->webhooks->retrieve('22222222-3333-4444-5555-666666666666',
            '66666666-7777-8888-9999-000000000001');

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

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.sessions.webhooks.retrieve(
              "22222222-3333-4444-5555-666666666666",
              "66666666-7777-8888-9999-000000000001"
            )
            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.Sessions.Webhooks.RetrieveAsync("22222222-3333-4444-5555-666666666666",
            "66666666-7777-8888-9999-000000000001");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    SessionWebhookDelivery:
      type: object
      description: 为验证会话记录的一次 Webhook 投递尝试，包含 Didit 发送的原始请求头和请求体。
      required:
        - uuid
        - session_id
        - request_url
        - response_status
        - status
        - webhook_type
        - request_header
        - request_body
        - created_at
      properties:
        uuid:
          type: string
          format: uuid
          description: 投递 ID。将其用作 `{webhook_uuid}` 以获取或重新发送此投递。
        session_id:
          type: string
          format: uuid
          description: 投递记录所属的会话（路径中的会话）。
        request_url:
          type: string
          format: uri
          nullable: true
          description: 投递发送的目标 URL。
        response_status:
          type: integer
          nullable: true
          description: >-
            您的 endpoint 返回的 HTTP 状态码。在投递已排队且尚未尝试时为 `null`。未收到 HTTP 响应时，Didit
            会记录自身的状态码：您的 endpoint 未在 5 秒内响应记录为 `504`，连接失败记录为 `503`，因 URL
            不安全而被拒绝（例如私有或内部地址）记录为 `400`，其他任何请求错误记录为 `404`。`400` 或更高视为投递失败。
        status:
          type: string
          nullable: true
          description: 生成事件时的会话状态，例如 `In Progress`、`Approved` 或 `Declined`。
        webhook_type:
          $ref: '#/components/schemas/WebhookEvent'
        request_header:
          type: string
          description: >-
            Didit 发送的请求头的 JSON
            文本（字符串）：`Content-Type`、`X-Signature`、`X-Signature-V2`、`X-Signature-Simple`、`X-Timestamp`
            和 `User-Agent`。请使用 JSON 解析器进行解析。其中包含签名，绝不会包含签名密钥。
        request_body:
          type: string
          description: >-
            Didit 发送的准确 payload 的 JSON 文本（字符串），键已排序，包括 `event_id` 和
            `timestamp`。请使用 JSON 解析器进行解析；参见 [Payload
            结构](https://docs.didit.me/zh/integration/webhooks#payload-结构)。对于没有
            `media: read` 权限的作用域密钥，其中的媒体 URL 为 `null`；没有 `sessions: write`
            权限时，会话 token 和托管验证链接为 `null`。以此方式修改的请求体将不再与其签名匹配。Didit 不会记录您的
            endpoint 返回的响应体。
        created_at:
          type: string
          format: date-time
          description: 投递创建的时间。
    WebhookEvent:
      type: string
      description: 支持的 Webhook 事件名称。请在 `subscribed_events` 中使用这些完全匹配的字符串；不支持的值将被拒绝。
      enum:
        - status.updated
        - data.updated
        - user.status.updated
        - user.data.updated
        - business.status.updated
        - business.data.updated
        - activity.created
        - transaction.created
        - transaction.status.updated
        - travel_rule.status.updated
        - workflow.compliance_changed
        - transaction_rule_suggestions.created
        - auth.signup
        - auth.login
        - auth.login_failed
        - auth.password_reset_requested
        - auth.password_reset_completed
        - auth.mfa_changed
        - auth.new_device
        - auth.account_locked
        - investigator.report.ready
        - investigator.decision.automated
        - investigator.decision.overridden
        - investigator.decision.contested
        - investigator.question.raised
        - investigator.automation.paused
        - investigator.rfi.answered
        - investigator.rfi.overdue
        - investigator.drift.detected
        - investigator.sla.breached
        - investigator.qa.failed
        - investigator.external.report.ready
  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.