> ## 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 获取异步报告的生成状态、文件、实时失败会话 ID 和失败数量，以便在重试前选择需要处理的项目。

Didit 的异步 Reports API 会返回一个导出任务及其当前的失败列表。`failed_count` 等于 `failed_item_ids` 的长度；已删除的会话会被排除在外。

使用[列出异步报告](https://docs.didit.me/zh/management-api/reports/list.md)查找报告，然后参阅[重试指南](https://docs.didit.me/zh/console/export-pdf-csv.md#重试失败的导出项)，或直接[重试导出](https://docs.didit.me/zh/management-api/reports/retry.md)。


## OpenAPI

````yaml zh/openapi-25.json GET /v3/organization/{organization_id}/application/{application_id}/reports/{report_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/organization/{organization_id}/application/{application_id}/reports/{report_uuid}/:
    get:
      tags:
        - Reports
      summary: 获取异步报告
      description: >-
        需要对报告涵盖的每个资源拥有读取权限。应用或 API 密钥凭证必须属于路径中的应用。成员 Bearer token
        必须有权访问该应用。failed_item_ids 会排除已删除的会话；failed_count 为其长度。
      operationId: retrieve_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。
      responses:
        '200':
          description: 获取异步报告。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncReport'
        '401':
          description: 缺少凭证、凭证无效或凭证已过期。
        '403':
          description: 调用方无权访问此应用，或缺少所需权限。
        '404':
          description: 在此应用中未找到报告。
        '429':
          $ref: '#/components/responses/RateLimitedRead'
      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.retrieve(
                "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.retrieve("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.Retrieve(ctx, \"11111111-2222-3333-4444-555555555555\")\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_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            Didit client = new Didit();


            var result =
            client.reports().retrieve("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->retrieve('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.retrieve("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.RetrieveAsync("11111111-2222-3333-4444-555555555555");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    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:
    RateLimitedRead:
      description: 中间件读取额度已超出。重试前请先遵守 Retry-After。
      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'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitBudgetError'
          example:
            detail: >-
              GET request rate limit exceeded. You can make up to 600 requests
              per minute.
            reference: RL-00000000000040008000000000000001
            limit: 600
            remaining: 0
            reset: 1794358860
            window_seconds: 60
  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.