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

# 重试异步报告 API

> 重试 Didit 异步导出，或重新处理所选的失败验证项。仅限请求者访问，排除已删除会话，并支持重放处理。

Didit 的异步 Reports API 会重新运行导出，或将选定的失败验证项加入重试队列。新的重试请求返回 `201`；与已有失败项选择完全相同的请求则返回已有报告，状态码为 `200`。

> [!WARNING]
>
> 选择性重试需要原始请求用户的身份。不带该身份的 API 密钥或应用令牌在发送 `item_ids` 时会收到 `403`，即使是其自身应用的请求也是如此。生成的 API 密钥示例会以空请求体重新运行整个导出。

请从 [获取异步报告](https://docs.didit.me/zh/management-api/reports/retrieve.md) 读取实时 ID，并遵循 [失败项重试指南](https://docs.didit.me/zh/console/export-pdf-csv.md#重试失败的导出项)。发送 1 到 1000 个 ID，这些 ID 须来自 `READY` 或 `FAILED` 状态的 `SESSION_EXPORT`，且不得附带替换日期范围。已删除的会话无法重试。


## OpenAPI

````yaml zh/openapi-25.json POST /v3/organization/{organization_id}/application/{application_id}/reports/{report_uuid}/retry/
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/organization/{organization_id}/application/{application_id}/reports/{report_uuid}/retry/:
    post:
      tags:
        - Reports
      summary: 重试异步报告
      description: >-
        需要对报告涵盖的每个资源拥有读取权限。应用或 API 密钥凭证必须属于路径中的应用。成员 Bearer token
        必须有权访问该应用。同时需要对待导出的资源拥有写入权限。省略 item_ids
        即可重新运行原始导出，也可以选择在替代的日期范围内运行。作为失败项重试而创建的报告，进一步重试时必须显式选择 item_ids。使用
        item_ids 时，只有原始请求者（requested_by_user_id 非空且与已认证用户一致）可以重试 READY 或 FAILED
        状态的 SESSION_EXPORT。缺少该用户身份的 API 密钥或应用 token 在进行选择性重试时会收到
        403。只能选择原始导出中仍然存在的失败会话；已删除的会话无法重新导出。原始报告保持不变。首次选择会创建新报告（201）；使用完全相同的所选集合重放请求时，返回已有的重试报告（200）。与已分配给其他重试的选择存在重叠或不同时，返回
        400。参见[重试失败的导出项](https://docs.didit.me/zh/console/export-pdf-csv#重试失败的导出项)。
      operationId: retry_reports
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 组织 ID。
        - name: application_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 应用 ID。
        - name: report_uuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 报告 UUID。
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AsyncReportRetryRequest'
            example: {}
      responses:
        '200':
          description: 与之前失败项选择完全相同的重放请求；返回已有的重试报告，不会再次排队。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncReport'
        '201':
          description: 已排入新的导出队列。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncReport'
        '400':
          description: >-
            选择项为空或无效、超过 1000 个 ID、ID
            不属于此报告中当前有效的失败会话、导出未完成或不是会话导出、重试选择相互冲突，或日期范围无效或混用。
        '401':
          description: 缺少凭证、凭证无效或凭证已过期。
        '403':
          description: 缺少读写权限，或选择性重试由原始请求发起人以外的人员发起，包括没有用户身份的调用方。
        '404':
          description: 在此应用中未找到报告。
        '409':
          description: 该报告正在删除，无法重试。
        '429':
          $ref: '#/components/responses/RateLimitedWrite'
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            # and DIDIT_APPLICATION_ID.
            client = Didit()

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


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            const didit = new Didit();


            const result = await
            didit.reports.retry("11111111-2222-3333-4444-555555555555");

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

            import me.didit.types.AsyncReportRetryRequest;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            Didit client = new Didit();


            var result =
            client.reports().retry("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_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            $didit = new DiditClient();


            $result =
            $didit->reports->retry('11111111-2222-3333-4444-555555555555');

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

            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            # and DIDIT_APPLICATION_ID.
            didit = Didit::Client.new

            result = didit.reports.retry("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, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            using var client = new DiditClient();


            var result = await
            client.Reports.RetryAsync("11111111-2222-3333-4444-555555555555");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    AsyncReportRetryRequest:
      type: object
      properties:
        item_ids:
          type: array
          description: >-
            可选，从本次导出中选择 1 至 1000 个失败的实时会话 UUID。重复项会被合并。只有原始请求发起人可以重试部分会话。不能与
            date_from/date_to 同时使用。
          items:
            type: string
            format: uuid
          minItems: 1
          maxItems: 1000
        date_from:
          type: string
          description: 可选的替换时间段开始日期。两个日期需按顺序一并发送；重试失败项时请省略。
          format: date
        date_to:
          type: string
          description: 可选的替换时间段结束日期，需晚于或等于 date_from。
          format: date
        notify_on_ready:
          type: boolean
          description: 报告就绪后，若有请求人邮箱，则向其发送邮件。
          default: false
    AsyncReport:
      type: object
      required:
        - uuid
        - report_type
        - report_type_display
        - status
        - status_display
        - parameters
        - requested_by_user_id
        - requested_by_email
        - requested_by_name
        - row_count
        - failed_item_ids
        - failed_count
        - file_size
        - files
        - scheduled_report
        - error_message
        - deletion_pending
        - eta_seconds
        - started_at
        - completed_at
        - expires_at
        - created_at
        - updated_at
      properties:
        uuid:
          type: string
          description: 报告标识符。
          format: uuid
        report_type:
          type: string
          description: 导出或合规报告类型。
          enum:
            - SESSION_EXPORT
            - TRANSACTION_EXPORT
            - BUSINESS_EXPORT
            - VENDOR_USER_EXPORT
            - VENDOR_BUSINESS_EXPORT
            - CASE_EXPORT
            - CASE_SLA_EXPORT
            - LIST_ENTRY_EXPORT
            - EVENT_EXPORT
            - COMPLIANCE_KYC_KYB
            - COMPLIANCE_AML_LOG
            - COMPLIANCE_TRAVEL_RULE
            - COMPLIANCE_SANCTIONS_PEP
            - COMPLIANCE_RISK_SUMMARY
            - COMPLIANCE_SAR_STR_DRAFT
            - COMPLIANCE_CTR
            - COMPLIANCE_CASE_SUMMARY
        report_type_display:
          type: string
          description: 报告类型的显示标签。
        status:
          type: string
          description: 生成状态。READY 可能包含单个失败项；请检查 failed_count。
          enum:
            - PENDING
            - PROCESSING
            - READY
            - FAILED
        status_display:
          type: string
          description: 生成状态的显示标签。
        parameters:
          type: object
          description: 原始导出选项；键名取决于 report_type。
          additionalProperties: true
        requested_by_user_id:
          type: string
          description: 原始请求发起人的身份；对于没有用户身份的调用方为 null。
          format: uuid
          nullable: true
        requested_by_email:
          type: string
          description: 请求发起人的邮箱（如有）。
          nullable: true
        requested_by_name:
          type: string
          description: 请求发起人的显示名称（如有）。
          nullable: true
        row_count:
          type: integer
          description: 导出记录的数量；生成前为 null。
          nullable: true
        failed_item_ids:
          type: array
          description: 本次验证导出中失败的实时会话 UUID。已删除的会话不计入。可使用这些 ID 进行选择性重试。
          items:
            type: string
            format: uuid
        failed_count:
          type: integer
          description: failed_item_ids 中的条目数。
          minimum: 0
        file_size:
          type: integer
          description: 生成文件的总大小（字节）；生成前为 null。
          format: int64
          nullable: true
        files:
          type: array
          description: 已生成文件的元数据；不包含下载 URL。
          items:
            $ref: '#/components/schemas/AsyncReportFile'
        scheduled_report:
          type: string
          description: 调度标识符；对于未调度的报告为 null。
          format: uuid
          nullable: true
        error_message:
          type: string
          description: 生成错误（如有）。
          nullable: true
        deletion_pending:
          type: boolean
          description: 请求的删除是否仍在进行中。
        eta_seconds:
          type: integer
          description: 待处理或处理中报告预计完成所需的秒数；无历史记录或已完成时为 null。
          nullable: true
        started_at:
          type: string
          description: 生成开始时间。
          format: date-time
          nullable: true
        completed_at:
          type: string
          description: 生成完成时间。
          format: date-time
          nullable: true
        expires_at:
          type: string
          description: 报告过期时间。
          format: date-time
        created_at:
          type: string
          description: 创建时间。
          format: date-time
        updated_at:
          type: string
          description: 最后更新时间。
          format: date-time
      example:
        uuid: 00000000-0000-4000-8000-000000000002
        report_type: SESSION_EXPORT
        report_type_display: Verifications
        status: READY
        status_display: Ready
        parameters: {}
        requested_by_user_id: null
        requested_by_email: null
        requested_by_name: null
        row_count: 9
        failed_item_ids:
          - 00000000-0000-4000-8000-000000000001
        failed_count: 1
        file_size: 1200
        files:
          - name: verifications.csv
            format: csv
            rows: 9
            bytes: 1200
        scheduled_report: null
        error_message: null
        deletion_pending: false
        eta_seconds: null
        started_at: '2026-11-11T01:00:00Z'
        completed_at: '2026-11-11T01:01:00Z'
        expires_at: '2026-12-11T01:00:00Z'
        created_at: '2026-11-11T01:00:00Z'
        updated_at: '2026-11-11T01:01:00Z'
    AsyncReportFile:
      type: object
      required:
        - name
        - format
        - rows
        - bytes
      properties:
        name:
          type: string
          description: 文件名。
        format:
          type: string
          description: 文件格式。
        rows:
          type: integer
          description: 该文件中包含的导出记录数（如适用）。
          nullable: true
        bytes:
          type: integer
          description: 文件大小（字节）。
          format: int64
    RateLimitBudgetError:
      type: object
      description: 仅在速率限制中间件预算拒绝时返回。其他 429 错误（包括幂等性冲突和端点特定上限）不保证返回这些元数据字段。
      required:
        - detail
        - reference
        - limit
        - remaining
        - reset
        - window_seconds
      properties:
        detail:
          type: string
          description: 已有的可读预算拒绝信息。
        reference:
          type: string
          pattern: ^RL-[0-9a-f]{32}$
          description: 不透明的支持参考编号：RL- 后跟 32 个小写 UUID 十六进制字符。
        limit:
          type: integer
          description: 超出限额的作用域对应的预算；与 X-RateLimit-Limit 相同。
        remaining:
          type: integer
          minimum: 0
          description: 剩余额度，下限为零；与 X-RateLimit-Remaining 相同。
        reset:
          type: integer
          format: int64
          description: 窗口重置时间，以 Unix 秒表示；与 X-RateLimit-Reset 相同。
        window_seconds:
          type: integer
          description: 固定窗口时长（秒），不是剩余等待时间。重试前请遵循 Retry-After。
      example:
        detail: >-
          Write request rate limit exceeded. You can make up to 300 requests per
          minute.
        reference: RL-00000000000040008000000000000001
        limit: 300
        remaining: 0
        reset: 1794358860
        window_seconds: 60
  responses:
    RateLimitedWrite:
      description: 已超出每个 API 密钥每分钟 300 次请求的共享写入限制。在重试之前请遵循 `Retry-After`。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitBudgetError'
          example:
            detail: >-
              Write request rate limit exceeded. You can make up to 300 requests
              per minute.
            reference: RL-00000000000040008000000000000001
            limit: 300
            remaining: 0
            reset: 1794358860
            window_seconds: 60
      headers:
        Retry-After:
          $ref: '#/components/headers/BudgetRetryAfter'
        X-RateLimit-Scope:
          $ref: '#/components/headers/BudgetXRateLimitScope'
        X-RateLimit-Limit:
          $ref: '#/components/headers/BudgetXRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/BudgetXRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/BudgetXRateLimitReset'
  headers:
    BudgetRetryAfter:
      description: 需等待的秒数，向上取整到下一个时间窗口。出现在中间件预算拒绝响应中。
      schema:
        type: integer
    BudgetXRateLimitScope:
      description: 已超出预算的范围。出现在中间件预算拒绝响应中。
      schema:
        type: string
    BudgetXRateLimitLimit:
      description: 超出限额的作用域的预算；与请求体限制相同。出现在中间件预算拒绝响应中。
      schema:
        type: integer
    BudgetXRateLimitRemaining:
      description: 剩余额度，下限为零；与响应体中的 remaining 相同。仅出现在中间件额度拒绝的响应中。
      schema:
        type: integer
    BudgetXRateLimitReset:
      description: 以 Unix 秒表示的重置时间；与正文中的 reset 相同。出现在中间件预算拒绝响应中。
      schema:
        type: integer
  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。
    BearerAuth:
      type: http
      scheme: bearer
      description: 该应用的客户端凭证访问 token。

````

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