🎉 Unlimited Free KYC - Forever!!

Identity Verification
API Reference
AML Screening

AML Screening API

The AML (Anti-Money Laundering) Screening API allows you to check individuals against global sanctions lists, PEP (Politically Exposed Persons) databases, and other compliance watchlists. This helps you meet regulatory requirements and reduce risk exposure.

  • Base URL: https://verification.didit.me
  • Endpoint: /v2/aml/
  • Authentication: Client Token (Bearer Token)
⚠️

The authentication endpoint uses a different base URL than the API endpoints. Ensure you use the correct URLs to avoid connectivity issues.

This API requires a Pro Plan subscription and has an associated cost per call. Results won't be saved in your console. For pricing details, visit our API Pricing page (opens in a new tab).

Process Overview

Follow these steps to perform AML screening:

Step 1: Authenticate

Obtain a valid access_token by following the Authentication documentation. This token is required in the Authorization header of your request.

ℹ️

The access_token is valid for 24 hours. You only need to re-authenticate once it expires.

Step 2: Prepare Request Parameters

ParameterTypeRequired?DescriptionExample Value
full_namestringYesFull name of the person to screen"John Michael Doe"
date_of_birthstringYesDate of birth in YYYY-MM-DD format"1985-05-15"
nationalitystringYesNationality in ISO 3166-1 alpha-3 format"USA"
document_numberstringNoDocument identification number (recommended for more accurate results)"AB123456"
optionsobjectNoCustomization options for AML screeningSee options details below

Options Object

The options parameter allows you to customize the AML screening process:

OptionTypeRequired?DescriptionDefault Value
aml_score_approve_thresholdnumberNoAML risk scores below this will be approved, above will be declined.80
⚠️

The full_name, date_of_birth, and nationality fields are mandatory. Always provide these fields to ensure accurate AML screening results.

Step 3: Send the Request

Make a POST request to /v2/aml/ with the prepared parameters and include the access_token obtained in step 1 in the header.

Example Request

POST /v2/aml/ HTTP/1.1
Host: verification.didit.me
Content-Type: application/json
Authorization: Bearer {access_token}
 
{
  "full_name": "John Michael Doe",
  "date_of_birth": "1985-05-15",
  "nationality": "USA",
  "document_number": "AB123456",
  "options": {
    "aml_score_approve_threshold": 75,
  }
}

Response

The response provides detailed information about the AML screening results, including potential matches and risk scores.

Example Response

{
  "request_id": "11111111-2222-3333-4444-555555555555",
  "aml": {
    "status": "Declined",
    "total_hits": 1,
    "hits": [
      {
        "id": "cl-info-probidad-3fd0f04facc53bd94ebec9aaedf56d18",
        "match": false,
        "score": 0.4,
        "target": true,
        "caption": "PABLO ALFONSO ESCOBAR NAVARRO",
        "datasets": ["cl_info_probidad"],
        "features": {
          "country_mismatch": 1.0,
          "person_name_phonetic_match": 0.67
        },
        "last_seen": "2024-10-28T02:50:03",
        "first_seen": "2024-01-17T02:50:01",
        "properties": {
          "name": ["PABLO ALFONSO ESCOBAR NAVARRO"],
          "topics": ["role.pep"],
          "country": ["cl"]
        }
      }
    ],
    "score": 40.0,
    "screened_data": {
      "full_name": "Pablo Escobar",
      "nationality": "COL",
      "date_of_birth": "1975-12-01",
      "document_number": "CAA000000"
    },
    "warnings": [
      {
        "risk": "POSSIBLE_MATCH_FOUND",
        "additional_data": null,
        "log_type": "warning",
        "short_description": "Possible match found in AML screening",
        "long_description": "The Anti-Money Laundering (AML) screening process identified potential matches with watchlists or high-risk databases, requiring further review."
      }
    ]
  },
  "created_at": "2024-07-24T08:54:25.443172Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique identifier for the API request
aml.statusstringAML screening status (Approved, or Declined)
aml.total_hitsnumberTotal number of potential matches found
aml.scorenumberOverall risk score (0-100, higher values indicate higher risk)
aml.hitsarrayArray of potential matches found
aml.hits[].idstringUnique identifier for the match
aml.hits[].matchbooleanIndicates if it's considered a definite match
aml.hits[].scorenumberMatch confidence score (0-1)
aml.hits[].targetbooleanIndicates if this is a primary target match
aml.hits[].captionstringDisplay name of the match
aml.hits[].datasetsarrayLists of data sources where the match was found
aml.hits[].featuresobjectMatching criteria and scores
aml.hits[].last_seenstringDate when the match was last seen in the database
aml.hits[].first_seenstringDate when the match was first seen in the database
aml.hits[].propertiesobjectAdditional information about the match
aml.screened_dataobjectThe data that was used for screening
aml.warningsarrayList of warnings for the verification
created_atstringTimestamp when the request was created

Error Handling

Status CodeErrorDescription
400Bad RequestInvalid parameters or missing required fields
401UnauthorizedInvalid or missing access_token
403ForbiddenNot authorized to access this API or insufficient subscription plan

Example Error Response

{
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Missing required field: nationality"
  }
}

Common Error Codes

Error CodeDescription
MISSING_REQUIRED_FIELDA mandatory field is missing in the request
INVALID_DATE_FORMATDate of birth is not in the required YYYY-MM-DD format
INVALID_NATIONALITYNationality code is not in the valid ISO 3166-1 alpha-3 format

Code Examples

async function submitAmlScreening(accessToken, fullName, dateOfBirth, nationality, documentNumber = null, options = null) {
  const url = `https://verification.didit.me/v2/aml/`;
 
  // Prepare request data
  const requestData = {
    full_name: fullName,
    date_of_birth: dateOfBirth,
    nationality: nationality
  };
 
  // Add optional document number if provided
  if (documentNumber) {
    requestData.document_number = documentNumber;
  }
 
  // Add options if provided
  if (options) {
    requestData.options = options;
  }
 
  const requestOptions = {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${accessToken}`
    },
    body: JSON.stringify(requestData)
  };
 
  try {
    const response = await fetch(url, requestOptions);
 
    if (!response.ok) {
      const errorData = await response.json();
      throw new Error(errorData.error?.message || errorData.detail || 'Unknown error occurred');
    }
 
    return await response.json();
  } catch (error) {
    console.error('Error in AML screening:', error);
    throw error;
  }
}
 
// Example usage
async function performAmlScreening() {
  try {
    // 1. Get client token (implement based on auth documentation)
    const token = await getClientToken();
 
    // 2. Custom options (optional)
    const options = {
      aml_score_approve_threshold: 75,
    };
 
    // 3. Submit AML screening
    const result = await submitAmlScreening(
      token.access_token,
      'John Michael Doe',
      '1985-05-15',
      'USA',
      'AB123456', // Optional document number
      options     // Optional customization options
    );
 
    console.log('AML screening result:', result);
 
    // Handle the screening result
    if (result.aml.status === 'Approved') {
      console.log('No significant AML risks detected.');
    } else if (result.aml.status === 'Declined') {
      console.log('High-risk AML matches detected.');
    }
 
    return result;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
}
import requests
from datetime import datetime
 
def submit_aml_screening(access_token, full_name, date_of_birth, nationality, document_number=None, options=None):
    """
    Submit AML screening for an individual.
 
    Args:
        access_token (str): The access token for authentication.
        full_name (str): Full name of the person to screen.
        date_of_birth (str): Date of birth in YYYY-MM-DD format.
        nationality (str): Nationality in ISO 3166-1 alpha-3 format.
        document_number (str, optional): Document identification number.
        options (dict, optional): Customization options for AML screening.
 
    Returns:
        dict: The AML screening results.
    """
    url = "https://verification.didit.me/v2/aml/"
 
    # Validate date format
    try:
        # Ensure date is in YYYY-MM-DD format
        datetime.strptime(date_of_birth, '%Y-%m-%d')
    except ValueError:
        raise ValueError("Invalid date format. Date of birth must be in YYYY-MM-DD format")
 
    # Prepare request data
    request_data = {
        "full_name": full_name,
        "date_of_birth": date_of_birth,
        "nationality": nationality
    }
 
    # Add optional document number if provided
    if document_number:
        request_data["document_number"] = document_number
 
    # Add options if provided
    if options:
        request_data["options"] = options
 
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {access_token}"
    }
 
    try:
        response = requests.post(url, headers=headers, json=request_data)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f"Error in AML screening: {e}")
        if hasattr(e, 'response') and e.response:
            print(f"Response: {e.response.text}")
        raise
 
# Example usage
def perform_aml_screening():
    try:
        # 1. Get client token (implement based on auth documentation)
        token = get_client_token()
 
        # 2. Custom options (optional)
        options = {
            "aml_score_approve_threshold": 75,
        }
 
        # 3. Submit AML screening
        result = submit_aml_screening(
            token["access_token"],
            "John Michael Doe",
            "1985-05-15",
            "USA",
            "AB123456",  # Optional document number
            options      # Optional customization options
        )
 
        print(f"AML screening status: {result['aml']['status']}")
        print(f"Total hits: {result['aml']['total_hits']}")
        print(f"Risk score: {result['aml']['score']}")
 
        # Handle the screening result
        if result['aml']['status'] == 'Approved':
            print("No significant AML risks detected.")
        elif result['aml']['status'] == 'Declined':
            print("High-risk AML matches detected.")
 
        return result
    except Exception as e:
        print(f"Error: {e}")
        raise

AML Monitoring

When using the AML API, you have the option to enable ongoing monitoring for screened individuals. If enabled, we will continuously monitor all approved individuals against new additions to global watchlists and alert you if new matches are found.

AML Monitoring is an optional paid add-on service that costs only $0.07 additional per check. You can enable or disable this feature in your Verification Settings.

Best Practices

  1. Data Accuracy:

    • Provide complete and accurate information to minimize false positives.
    • Include all known aliases or variations of the person's name.
    • Always include the document number when available for more precise matching.
  2. Match Review:

    • Review all potential matches, even those with lower scores.
    • Pay special attention to matches from sanctions lists, which have higher regulatory impact.
    • Consider the recency of the match data when evaluating risk.
  3. Threshold Configuration:

    • Configure your risk score thresholds based on your risk appetite using the options parameter.
    • Set the aml_score_approve_threshold according to your compliance requirements.