> ## 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，并附带新签名。您将获得新投递记录以及您端点返回的响应。



重新发送会话 Webhook 投递 API 提示词
        将提示词复制到剪贴板



      
      

\<pre>

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

Endpoint:
POST https://verification.didit.me/v3/session/{session_id}/webhook/{webhook_uuid}/resend
(no trailing slash, no request body)

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

Goal:
\- Replay a webhook my endpoint missed or rejected, after I fixed the endpoint.

Behavior:
\- {webhook_uuid} is the uuid of an entry from GET /v3/session/{session_id}/webhooks/, and it must belong to the session in the path.
\- Didit sends the recorded payload again to the URL the delivery was first sent to. The payload keeps its event_id; Didit refreshes the timestamp field, the X-Timestamp header and the signatures, using the destination's current signing secret (the application-level secret for a delivery sent to the legacy webhook_url).
\- Synchronous: Didit waits up to 5 seconds for my endpoint, records the attempt as a new delivery and returns it. The original delivery is not changed.
\- The call returns 200 even when my endpoint answered with an error: read response_status in the returned delivery.
\- A failed resend is not retried automatically. Every call sends one more request to my endpoint, so my handler must be idempotent on event_id.

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

What to read from the response:
\- uuid: the new delivery id.
\- response_status: what my endpoint answered this time (504 timeout, 503 connection failure, 400 URL refused as unsafe).
\- request_header and request_body: the headers and body actually sent.

Failure modes:
\- 400 with code webhook_url_missing: the delivery has no recorded URL.
\- 400 with code webhook_resend_error: the recorded payload could not be re-signed or sent.
\- 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": "Webhook log not found" }).
\- 429: more than 300 writes per minute for this API key; honor Retry-After.

Side effects: sends one HTTP request to my webhook endpoint and adds one delivery to the session's webhook log.

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

\</pre>



      
      

粘贴到

> [!NOTE]
>
> 无论您之后是否修改了 Webhook 目标的 URL，重新发送都会发往投递记录中保存的 URL。由于 payload 保留其 `event_id`，如果接收方[依据 `event_id` 去重](https://docs.didit.me/zh/integration/webhooks#信封结构)，就会将此次重新发送视为其已知的同一事件。使用[列出会话 Webhook 投递记录](https://docs.didit.me/zh/management-api/sessions/list-webhooks.md)查找要重新发送的投递。


## OpenAPI

````yaml zh/openapi-25.json POST /v3/session/{sessionId}/webhook/{webhook_uuid}/resend
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}/resend:
    post:
      tags:
        - Sessions
      summary: 重发会话 Webhook 投递
      description: >-
        将已记录的会话 Webhook 再次发送到最初发送的 URL，使用相同的 payload 和 `event_id`，以及全新的
        `timestamp`、`X-Timestamp` 请求头和签名。Didit 会使用该投递所属目标的当前密钥（对于投递到旧版 Webhook
        URL 的情况，则使用应用级密钥）对其进行签名，等待您的 endpoint 响应最多 5 秒，将该尝试记录为一次新投递，无论您的
        endpoint 响应为何均返回 `200`：请查看
        `response_status`。重新发送不会自动重试，并且每次调用都会再次发送，因此请确保您的 endpoint 基于 `event_id`
        具备幂等性。该路径没有尾随斜杠，请求也没有请求体。带作用域的 API 密钥需要 `webhooks: write` 和 `decisions:
        read` 权限。
      operationId: post_v3_session_webhook_resend
      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: 已尝试的新投递。`response_status` 为您的 endpoint 此次返回的状态。原始投递保持不变。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionWebhookDelivery'
              examples:
                Accepted on resend:
                  value:
                    uuid: 66666666-7777-8888-9999-000000000004
                    session_id: 22222222-3333-4444-5555-666666666666
                    request_url: https://yourapp.com/webhooks/didit
                    response_status: 200
                    status: In Progress
                    webhook_type: status.updated
                    request_header: >-
                      {"Content-Type": "application/json", "X-Signature":
                      "b8eb1e376517ee0cad8ba98ff7f8fd35fc72eca231000963a96a335f82328835",
                      "X-Signature-V2":
                      "9efd2ce9ed1303e1d05273ef9608a59363ed9789a05253db4748b3e8e50cb109",
                      "X-Signature-Simple":
                      "bf3a9dc04b2c20ab539203b0cd5cca2a10f630bf62d8feb6d68d82af80f64774",
                      "X-Timestamp": "1792159542", "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":1792159542,"vendor_data":"user-123","webhook_type":"status.updated","workflow_id":"44444444-5555-6666-7777-888888888888","workflow_version":3}
                    created_at: '2026-10-16T14:05:42.330981Z'
        '400':
          description: >-
            投递无法重新发送。根据 `code` 进行分支判断：`webhook_url_missing` 表示该投递没有记录的
            URL，不会发送任何内容；`webhook_resend_error` 表示存储的投递无法再次签名或尝试无法完成。在
            `webhook_resend_error` 之后，`detail` 以 `Error processing webhook
            resend:` 开头，后跟可能发生变化的诊断文本。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。请基于此代码进行分支处理，而非 `detail`。
              examples:
                No recorded URL:
                  value:
                    detail: >-
                      The webhook delivery does not have a request URL
                      configured
                    code: webhook_url_missing
                Resend failed:
                  value:
                    detail: >-
                      Error processing webhook resend: Invalid webhook data
                      format
                    code: webhook_resend_error
        '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 webhooks write:
                  value:
                    detail: This API key has no write access to webhooks.
                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.`）。投递记录不存在、属于其他会话或已不可用时返回 `Webhook log not found`。
          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: Webhook log not found
        '429':
          description: >-
            超出速率限制：当前一分钟窗口内该 API 密钥的写入请求（POST、PATCH、PUT、DELETE）超过 300 次。请等待
            `Retry-After` 秒后再重试。
          headers:
            Retry-After:
              description: 重试前需要等待的秒数。
              schema:
                type: integer
                minimum: 1
                example: 30
            X-RateLimit-Limit:
              description: 一分钟时间窗口内允许的请求数（300）。
              schema:
                type: integer
                example: 300
            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-write
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Throttled:
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      requests per minute.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            'https://verification.didit.me/v3/session/22222222-3333-4444-5555-666666666666/webhook/66666666-7777-8888-9999-000000000001/resend'
            \
              -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.resend(
                "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.resend(
              "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.Resend(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().resend("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->resend('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.resend(
              "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.ResendAsync("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.