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

# 获取 AML 持续监控任务 API

> 通过 Didit 查询从用户或企业端点发起的 AML 持续监控任务的状态、结果计数和每条记录的结果。



获取 AML 监控任务提示
        将提示词复制到剪贴板



      
      

\<pre>

\`Goal: Read the status and the per-record results of an AML ongoing monitoring job started with POST /v3/users/aml-monitoring/ or POST /v3/businesses/aml-monitoring/. Needed whenever the toggle call returned 202 (more than 20 profiles); also works for jobs that already completed inline.

Endpoint: GET https://verification.didit.me/v3/aml-monitoring/jobs/{job_id}/
Auth header: x-api-key: <DIDIT_API_KEY>

Path param:
\- job_id: the job_id returned by the toggle endpoint.

curl:
curl 'https://verification.didit.me/v3/aml-monitoring/jobs/JOB_ID/' \
-H 'x-api-key: YOUR_API_KEY'

Response 200:
\{
"job_id": "<uuid>",
"status": "PROCESSING",            // PENDING | PROCESSING | COMPLETED | FAILED
"is_enabled": true,
"target_type": "user",             // user | business
"total": 120,
"processed": 40,
"outcomes": {"enabled": 12, "screened_and_enabled": 25, "already_enabled": 3, "disabled": 0, "skipped_no_identity_data": 0, "skipped_blocked": 0, "skipped_sandbox": 0, "failed_provider": 0, "failed_insufficient_balance": 0},
"results": [
\{"didit_internal_id": "<uuid>", "vendor_data": "user-123", "outcome": "enabled"},
...one entry per processed profile, in processing order...
],
"error": null,                     // generic message when status is FAILED
"created_at": "<datetime>",
"completed_at": null
}

Polling: request the job every couple of seconds while status is PENDING or PROCESSING. results grows as profiles are processed and is complete once status is COMPLETED. A FAILED job keeps the results recorded before the failure and carries a short generic message in error; re-send the toggle request for the profiles that have no result yet. Per-record results are recorded for jobs started through the API; a job started from the Business Console reports counters only.

Failure modes:
\- 401 - missing/invalid x-api-key.
\- 404 - no such job for this application (jobs are only visible to the application that created them).

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

\</pre>



      
      

粘贴到

## 概览返回通过 [为用户切换 AML 监控](https://docs.didit.me/zh/management-api/aml-monitoring/toggle-users.md) 或 [为企业切换 AML 监控](https://docs.didit.me/zh/management-api/aml-monitoring/toggle-businesses.md) 启动的 AML 持续监控任务，包括其状态、按结果分类的计数器，以及每个已处理用户或企业对应的一条 `results` 记录。超过 20 个档案的选择会在后台运行，切换调用会返回 `202` 和 `PENDING` 状态的任务。请每隔几秒轮询此 endpoint，直到 `status` 变为 `COMPLETED` 或 `FAILED`。`results` 会随档案处理而逐步填充，按处理顺序排列，任务变为 `COMPLETED` 后即完整。仅通过 API 启动的任务会记录每条记录的结果；从企业控制台启动的任务只报告计数器。## 任务状态| `status` | 含义 |
| - | - |
| `PENDING` | 已接受，尚未开始。 |
| `PROCESSING` | 运行中；`processed`、`outcomes` 和 `results` 正在更新。 |
| `COMPLETED` | 每个档案都已有结果。 |
| `FAILED` | 任务提前停止。`error` 包含简短的通用信息，失败前已记录的结果会保留。请为尚无结果的档案重新发送切换请求。 |每条记录的 `outcome` 值在切换页面中有说明。## 权限应用的任何处于活动状态的 API 密钥均可调用此 endpoint。任务仅对创建它的应用可见；使用其他 `job_id` 将返回 `404`。## 相关链接- [为用户切换 AML 监控](https://docs.didit.me/zh/management-api/aml-monitoring/toggle-users.md)
- [为企业切换 AML 监控](https://docs.didit.me/zh/management-api/aml-monitoring/toggle-businesses.md)
- [持续 AML 监控](https://docs.didit.me/zh/core-technology/aml-screening/continuous-monitoring-aml-screening.md)


## OpenAPI

````yaml zh/openapi-25.json GET /v3/aml-monitoring/jobs/{job_id}/
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/aml-monitoring/jobs/{job_id}/:
    get:
      tags:
        - AML Ongoing Monitoring
      summary: 获取 AML 持续监控任务
      description: >-
        从 `POST /v3/users/aml-monitoring/` 或 `POST
        /v3/businesses/aml-monitoring/` 启动的监控切换任务的状态、结果计数器及逐条记录结果。当 `status` 为
        `PENDING` 或 `PROCESSING` 时，每隔几秒轮询一次；一旦变为 `COMPLETED`，`results` 即完整。
      operationId: get_aml_monitoring_job
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: 开关切换 endpoint 返回的 `job_id`。
      responses:
        '200':
          description: 作业。
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                      - PENDING
                      - PROCESSING
                      - COMPLETED
                      - FAILED
                  is_enabled:
                    type: boolean
                    description: 当任务启用监控时为 true，停用监控时为 false。
                  target_type:
                    type: string
                    enum:
                      - user
                      - business
                    description: 该作业切换哪个配置文件系列。
                  total:
                    type: integer
                    description: 该任务处理的档案。
                  processed:
                    type: integer
                    description: 截至目前已处理的档案。
                  outcomes:
                    type: object
                    description: 每条记录的结果计数器。每个选定的个人资料都会准确归入一个计数器；不会静默跳过任何内容。
                    properties:
                      enabled:
                        type: integer
                        description: 已在现有 AML 筛查上启用监控。
                      screened_and_enabled:
                        type: integer
                        description: 已创建新的 AML 筛查（已计费）并对其启用了监控。
                      already_enabled:
                        type: integer
                        description: 监控已处于活动状态；未发生任何更改，也未计费。
                      disabled:
                        type: integer
                        description: 已在该档案的所有 AML 筛查中关闭监控。
                      skipped_no_identity_data:
                        type: integer
                        description: 已跳过：资料缺少进行筛查所需的姓名、出生日期和国家/地区（用户）或名称（企业）。
                      skipped_blocked:
                        type: integer
                        description: 已跳过：用户已被封禁。
                      skipped_sandbox:
                        type: integer
                        description: 已跳过：沙盒应用，不创建筛查。
                      failed_provider:
                        type: integer
                        description: 无法完成筛查；请稍后重试。
                      failed_insufficient_balance:
                        type: integer
                        description: 任务运行时余额耗尽。
                  results:
                    type: array
                    description: >-
                      每个已处理的档案对应一个条目，按处理顺序排列。在任务运行期间逐步增加；状态变为 COMPLETED 时完成。对通过
                      API 启动的任务进行记录；从 Business Console 启动的任务仅报告计数器。
                    items:
                      type: object
                      properties:
                        didit_internal_id:
                          type: string
                          format: uuid
                          description: 个人资料的 Didit 内部 ID。
                        vendor_data:
                          type: string
                          nullable: true
                          description: 您为资料指定的自身标识符。
                        outcome:
                          type: string
                          enum:
                            - enabled
                            - screened_and_enabled
                            - already_enabled
                            - disabled
                            - skipped_no_identity_data
                            - skipped_blocked
                            - skipped_sandbox
                            - failed_provider
                            - failed_insufficient_balance
                  error:
                    type: string
                    nullable: true
                    description: 状态为 FAILED 时的通用失败消息；详细原因保留在平台端。
                  created_at:
                    type: string
                    format: date-time
                  completed_at:
                    type: string
                    format: date-time
                    nullable: true
        '401':
          description: API 密钥缺失或无效。
        '404':
          description: 此应用不存在该作业。
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl 'https://verification.didit.me/v3/aml-monitoring/jobs/JOB_ID/'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.aml_monitoring.retrieve_job(
                "11111111-2222-3333-4444-555555555555",
            )
            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.amlMonitoring.retrieveJob("11111111-2222-3333-4444-555555555555");

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AMLMonitoring.RetrieveJob(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 client = new Didit();


            var result =
            client.amlMonitoring().retrieveJob("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 = new DiditClient();


            $result =
            $didit->amlMonitoring->retrieveJob('11111111-2222-3333-4444-555555555555');

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


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            result =
            didit.aml_monitoring.retrieve_job("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.

            using var client = new DiditClient();


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

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  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.