> ## 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 用户实体查询

> 通过 vendor_data 获取单个 Didit 用户，包括身份字段、状态、KYC 计数器和功能映射。持久化 KYC 身份，按次计费。



获取用户提示
        将提示词复制到剪贴板



      
      

\<pre>

\`Goal: Fetch a single Didit User entity by your own vendor_data.

Endpoint: GET https://verification.didit.me/v3/users/{vendor_data}/
Auth header: x-api-key: <DIDIT_API_KEY>

Path param:
\- vendor_data (string, REQUIRED) — your unique identifier. Free-form string, NOT a UUID. Matching is case-insensitive after Didit normalisation. URL-encode it.

curl:
curl -X GET 'https://verification.didit.me/v3/users/user-abc-123/' \
-H 'x-api-key: YOUR_API_KEY'

Response 200 (UserDetailItem) — extends the list shape with metadata, comments (activity log), and updated_at. Key fields:
\- didit_internal_id (UUID — Didit's stable internal identifier)
\- vendor_data (string)
\- display_name, full_name, date_of_birth, effective_name, portrait_image_url
\- status: "ACTIVE" | "FLAGGED" | "BLOCKED" (VendorUserStatusChoices)
\- session_count, approved_count, declined_count, in_review_count (aggregate counters)
\- features (map of feature -> latest status)
\- approved_emails, approved_phones, issuing_states
\- metadata (arbitrary JSON you attached)
\- comments (chronological activity log: status changes, manual notes, system events)
\- created_at, updated_at
See /reference/data-models for the full schema.

Notes:
\- Aggregate counters update in real time as sessions reach terminal status.
\- For bulk lookups, prefer paging GET /v3/users/ and indexing locally on vendor_data instead of fanning out one call per identifier.

Failure modes (envelope {"detail": "..."}):
\- 401 — missing or invalid x-api-key.
\- 403 — the API key is revoked or is not valid for this application.
\- 404 — no user with that vendor_data in this application.
\- 429 — rate-limited.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

粘贴到

## 概述返回一个由 `vendor_data` 索引的单个[用户实体](https://docs.didit.me/zh/entities/users/overview.md)。响应中包含 `didit_internal_id`，即 Didit 的稳定内部标识符。## 使用场景- **查询**用户的当前验证状态：`features` 映射以单个对象的形式提供每项功能的最新状态。
- **自有界面中的详情视图**：渲染前按需获取用户资料。
- **风险评分**：结合会话计数器和 `features`，在您的系统中为每位用户评分。## 注意事项- URL 中的 `vendor_data` 区分大小写。
- 如果应用中不存在该 `vendor_data` 对应的用户，则返回 `404`。
- 聚合计数器（`session_count`、`approved_count`、`declined_count`、`in_review_count`）会在会话完成时实时更新。
- 有关每个字段的说明，请参阅[用户数据模型](https://docs.didit.me/zh/entities/users/data-model.md)。## 权限应用的任何处于活动状态的 API 密钥都可以调用此 endpoint。Didit 的 API 密钥是**应用级别的，而非角色级别的**：控制台中的[角色与权限](https://docs.didit.me/zh/console/roles-permissions.md)（`read:users` 等）决定的是*人员*在控制台中能做什么，对 Management API 的请求不做评估。要控制谁可以调用此 endpoint，请控制谁可以读取应用的 API 密钥。## 相关内容- [用户概览](https://docs.didit.me/zh/entities/users/overview.md)
- [数据模型](https://docs.didit.me/zh/entities/users/data-model.md)
- [列出用户](https://docs.didit.me/zh/management-api/users/list.md)


## OpenAPI

````yaml zh/openapi-25.json GET /v3/users/{vendor_data}/
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/users/{vendor_data}/:
    get:
      tags:
        - Users
      summary: 获取用户
      description: >-
        通过 `vendor_data` 获取单个[用户](/entities/users)（精确匹配）。在列表视图的基础上补充
        `metadata`、`comments` 和 `updated_at`，并将 `tags` 切换为详细的标签链接格式。
      operationId: get_user
      parameters:
        - name: vendor_data
          in: path
          required: true
          schema:
            type: string
          description: >-
            您对该用户的唯一标识符，即自由格式字符串（非 UUID）。该值与您在首次引入该用户创建会话时作为 `vendor_data`
            传入的值相同，按发送的内容精确匹配。
          example: user-abc-123
      responses:
        '200':
          description: 完整的用户详情，包括元数据、备注/活动日志以及汇总的会话数据。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetailItem'
              examples:
                Active user:
                  value:
                    didit_internal_id: f4e5e1f2-94a9-4f86-8c16-2b7d9b4db418
                    vendor_data: user-abc-123
                    display_name: null
                    full_name: John Michael Doe
                    date_of_birth: '1990-05-15'
                    effective_name: John Michael Doe
                    status: ACTIVE
                    metadata:
                      tier: premium
                      source: website
                    portrait_image_url: https://<media-host>/...
                    session_count: 3
                    approved_count: 2
                    declined_count: 0
                    in_review_count: 1
                    issuing_states:
                      - USA
                    approved_emails:
                      - john@example.com
                    approved_phones:
                      - '+14155551234'
                    features:
                      ID_VERIFICATION: Approved
                      LIVENESS: Approved
                      FACE_MATCH: Approved
                      AML: Approved
                    features_list:
                      - feature: ID_VERIFICATION
                        status: Approved
                      - feature: LIVENESS
                        status: Approved
                      - feature: FACE_MATCH
                        status: Approved
                      - feature: AML
                        status: Approved
                    last_session_at: '2025-06-15T10:30:00Z'
                    last_activity_at: '2025-06-15T10:30:00Z'
                    first_session_at: '2025-06-01T08:00:00Z'
                    tags:
                      - uuid: 9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d
                        tag:
                          uuid: e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b
                          name: VIP
                          color: '#2567FF'
                          description: null
                          source: custom
                          created_at: '2025-05-01T09:00:00Z'
                          updated_at: '2025-05-01T09:00:00Z'
                        added_by_email: analyst@acme.com
                        added_by_name: Jane Analyst
                        created_at: '2025-06-02T11:00:00Z'
                    comments:
                      - uuid: c1111111-2222-4333-8444-555555555555
                        comment_type: STATUS_CHANGED
                        comment: null
                        actor_email: analyst@acme.com
                        actor_name: Jane Analyst
                        previous_status: FLAGGED
                        new_status: ACTIVE
                        previous_value: null
                        new_value: null
                        changed_fields: []
                        metadata: null
                        mentioned_emails: []
                        created_at: '2025-06-01T10:30:00Z'
                    created_at: '2025-06-01T08:00:00Z'
                    updated_at: '2025-06-15T10:30:00Z'
        '401':
          description: >-
            未提供凭证。对 `/v3/users/*` 路径的请求如果不包含 `x-api-key` 请求头（或 `Authorization:
            Bearer` token），将在到达 API 之前被身份验证中间件拒绝。
          content:
            application/json:
              examples:
                Missing credentials:
                  value:
                    detail: >-
                      You must be authenticated with a valid access token to
                      access this endpoint.
        '403':
          description: 无效或已撤销的 API 密钥，或者该密钥无法读取此应用的用户。缺少密钥返回 `403`；错误、已撤销或已过期的密钥返回 `401`。
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: 此应用中不存在具有所提供 `vendor_data` 的用户。
          content:
            application/json:
              examples:
                Not found:
                  value:
                    detail: Not found.
        '429':
          description: 超出速率限制；请退避并在 `Retry-After` 指定的间隔后重试。
          content:
            application/json:
              examples:
                Rate limited:
                  value:
                    detail: Request was throttled. Expected available in 30 seconds.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X GET 'https://verification.didit.me/v3/users/user-abc-123/' \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.users.retrieve(
                "user-abc-123",
            )
            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.users.retrieve("user-abc-123");
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Users.Retrieve(ctx, \"user-abc-123\")\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.users().retrieve("user-abc-123");
            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->users->retrieve('user-abc-123');
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.users.retrieve("user-abc-123")
            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.Users.RetrieveAsync("user-abc-123");
            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    UserDetailItem:
      type: object
      description: 完整的用户详情。在 UserListItem 基础上扩展了元数据、备注和 updated_at。
      allOf:
        - $ref: '#/components/schemas/UserListItem'
        - type: object
          properties:
            metadata:
              type: object
              description: 您附加到此用户的自定义元数据 JSON。默认为 `{}`。
            tags:
              type: array
              description: >-
                标签分配情况。注意：与列表响应中使用的扁平 `{uuid, name, color}`
                结构不同，详情响应中的每个条目均为标签*链接*对象（`{uuid, tag: {...}, added_by_email,
                added_by_name, created_at}`）。
              items:
                type: object
                properties:
                  uuid:
                    type: string
                    format: uuid
                    description: 标签分配的 UUID（而非标签本身的 UUID）。
                  tag:
                    type: object
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      name:
                        type: string
                      color:
                        type: string
                      description:
                        type: string
                        nullable: true
                      source:
                        type: string
                        enum:
                          - didit
                          - custom
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                  added_by_email:
                    type: string
                    nullable: true
                  added_by_name:
                    type: string
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
            comments:
              type: array
              items:
                type: object
                properties:
                  uuid:
                    type: string
                    format: uuid
                  comment_type:
                    type: string
                    enum:
                      - COMMENT
                      - STATUS_CHANGED
                      - METADATA_UPDATED
                      - TAG_ADDED
                      - TAG_REMOVED
                      - PROFILE_UPDATED
                  comment:
                    type: string
                    nullable: true
                  actor_email:
                    type: string
                    nullable: true
                  actor_name:
                    type: string
                    nullable: true
                  previous_status:
                    type: string
                    nullable: true
                    enum:
                      - ACTIVE
                      - FLAGGED
                      - BLOCKED
                      - null
                  new_status:
                    type: string
                    nullable: true
                    enum:
                      - ACTIVE
                      - FLAGGED
                      - BLOCKED
                      - null
                  previous_value:
                    type: object
                    nullable: true
                    description: PROFILE_UPDATED 条目的先前字段值。
                  new_value:
                    type: object
                    nullable: true
                    description: PROFILE_UPDATED 条目的新字段值。
                  changed_fields:
                    type: array
                    items:
                      type: string
                    description: 由 PROFILE_UPDATED 条目更改的字段名称。
                  metadata:
                    type: object
                    nullable: true
                  mentioned_emails:
                    type: array
                    items:
                      type: string
                  created_at:
                    type: string
                    format: date-time
              description: 该用户的活动日志和评论（状态变更、资料修改、手动备注）。
            updated_at:
              type: string
              format: date-time
    UserListItem:
      type: object
      description: 已验证的用户。
      properties:
        didit_internal_id:
          type: string
          format: uuid
          description: Didit 为此用户分配的稳定内部 UUID。
        vendor_data:
          type: string
          nullable: true
          description: 您对此用户的唯一标识符（创建会话时传入）。未提供供应商标识符时可为 null。
        display_name:
          type: string
          nullable: true
          description: 您设置的自定义显示名称
        full_name:
          type: string
          nullable: true
          description: 从已验证证件中提取的姓名
        date_of_birth:
          type: string
          format: date
          nullable: true
        effective_name:
          type: string
          nullable: true
          description: 最佳可用名称：如果已设置则为 display_name，否则为 full_name
        status:
          type: string
          enum:
            - ACTIVE
            - FLAGGED
            - BLOCKED
          description: >-
            用户记录的生命周期状态（并非会话状态）。`ACTIVE` 为默认值，`FLAGGED` 标记该用户需要人工关注，`BLOCKED`
            会阻止该 `vendor_data` 创建新会话。
        portrait_image_url:
          type: string
          nullable: true
          description: 用户肖像照片的预签名 URL（数小时后过期）
        session_count:
          type: integer
          description: 该用户的验证会话总数
        approved_count:
          type: integer
          description: 已通过的会话数量
        declined_count:
          type: integer
          description: 已拒绝的会话数量
        in_review_count:
          type: integer
          description: 审核中的会话数量
        issuing_states:
          type: array
          items:
            type: string
          description: >-
            此用户已通过的身份证件上显示的签发国家/地区的 ISO 3166-1 alpha-3 代码，例如 `["USA",
            "ESP"]`。无时为空数组。
        approved_emails:
          type: array
          items:
            type: string
          description: 从该用户已通过的会话中收集的已验证邮箱地址，例如 `["john@example.com"]`。
        approved_phones:
          type: array
          items:
            type: string
          description: 从该用户已通过的会话中收集的已验证电话号码，例如 `["+14155551234"]`。
        features:
          type: object
          description: >-
            该用户所有会话的每项功能汇总状态。可选键：`ID_VERIFICATION`、`NFC`、`LIVENESS`、`FACE_MATCH`、`POA`、`QUESTIONNAIRE`、`EMAIL_VERIFICATION`、`PHONE`、`AML`、`IP_ANALYSIS`、`AGE_ESTIMATION`、`DATABASE_VALIDATION`。可选值：`Approved`、`Declined`、`In
            Review`、`Not Finished`、`Resub Requested`。
        features_list:
          type: array
          items:
            type: object
            properties:
              feature:
                type: string
              status:
                type: string
          description: 与 `features` 相同的数据，为 `{feature, status}` 对象的有序数组。
        last_session_at:
          type: string
          format: date-time
          nullable: true
          description: 最近一次会话的时间戳
        first_session_at:
          type: string
          format: date-time
          nullable: true
          description: 首次会话的时间戳
        last_activity_at:
          type: string
          format: date-time
          nullable: true
          description: 该用户最近一次活动的时间戳（会话、交易、状态变更、数据编辑等）。
        tags:
          type: array
          items:
            type: object
            properties:
              uuid:
                type: string
                format: uuid
              name:
                type: string
              color:
                type: string
          description: 分配给该用户的标签
        created_at:
          type: string
          format: date-time
  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.