> For the complete documentation index, see [llms.txt](https://docs.misttrack.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.misttrack.io/for-compliance-plan/create-aml-screening.md).

# Create AML Screening

Creates one or more AML Screening address records for the current user. This endpoint is only available to Compliance/Enterprise Plan users.

```shell
POST https://openapi.misttrack.io/v1/aml_screening_create
```

## Request

| Header       | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |

JSON Body

<table><thead><tr><th width="148.37890625">Parameter</th><th width="138.625">Type</th><th width="84.234375">Required</th><th>Description</th></tr></thead><tbody><tr><td>api_key</td><td>string</td><td>yes</td><td>Your API key.</td></tr><tr><td>data</td><td>array</td><td>yes</td><td>Non-empty array of address records to create or update.</td></tr><tr><td>data[].coin</td><td>string or array of strings</td><td>yes</td><td>One supported coin code, comma-separated codes, or a list of codes. Codes are trimmed and repeated codes are removed. Supported values are listed <a href="broken://pages/6715c54df6b33a855a51b81a095e4f16d65cbab1#multi-chain-support">here</a>.</td></tr><tr><td>data[].address</td><td>string</td><td>yes</td><td>Valid supported-chain address, at most 100 characters.</td></tr><tr><td>data[].note</td><td>string</td><td>no</td><td>Optional note. Omitted or <code>null</code> becomes an empty string.</td></tr></tbody></table>

Request Example

```shell
curl --location 'https://openapi.misttrack.io/v1/aml_screening_create' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "YourApiKey",
    "data": [
      {
        "coin": ["ETH", "USDT-ERC20"],
        "address": "0xb3065fe2125c413e973829108f23e872e1db9a6b",
        "note": "Treasury"
      },
      {
        "coin": ["TRX", "USDT-TRC20", "USDC-TRC20"],
        "address": "TEvwn7VF4KWfWfUSKipy6mFgjxPREPwFk2",
        "note": "TRON monitoring"
      }
    ]
  }'
```

## Response

Sample Response

```json
{
  "success": true,
  "msg": "",
  "data": {
    "created_count": 2
  }
}
```

`created_count` represents the number of newly created records plus the number of records restored after being soft-deleted, rather than the total number of records submitted.

The rules are as follows:

1. New records: Successfully created records are counted toward `created_count`.
2. Updating existing records: If the address is already being monitored by the same user, submitting it again updates the associated coins and note but does not increase `created_count`.
3. Restoring deleted records: If the user's record for the address was previously soft-deleted, submitting it again restores the record, and it is counted toward `created_count`.
4. Duplicate addresses: If the same address is submitted multiple times in a single request, it is processed only once. Duplicate detection is case-insensitive.

After creating or updating records, you can call `/v1/aml_screening_query` to retrieve the address records and their corresponding record IDs.

## Error Responses

<table><thead><tr><th width="109.55859375">HTTP Status</th><th>Response</th><th>Meaning</th></tr></thead><tbody><tr><td>200</td><td><code>{"success": false, "msg": "InvalidPostJson"}</code></td><td>The POST body is not valid JSON.</td></tr><tr><td>200</td><td><code>{"success": false, "msg": "InvalidParameter"}</code></td><td>The body is not an object or <code>data</code> is not a non-empty array.</td></tr><tr><td>200</td><td><code>{"success": false, "msg": "", "data": {"invalid_items": [...]}}</code></td><td>One or more <code>data</code> items are invalid; no items from this request are written. Each entry contains a zero-based <code>index</code> and <code>msg</code> (<code>InvalidParameter</code> or <code>UnsupportedToken</code>).</td></tr><tr><td>200</td><td><code>{"success": false, "msg": "InvalidApiKey"}</code></td><td>API key is invalid or deleted.</td></tr><tr><td>402</td><td><code>{"success": false, "msg": "ExpiredPlan"}</code></td><td>The API plan has expired.</td></tr><tr><td>403</td><td><code>{"success": false, "msg": "PermissionDenied"}</code></td><td>The user does not have AML Screening access.</td></tr></tbody></table>

A non-POST request returns plain text `Only POST allow` rather than JSON.
