For the complete documentation index, see llms.txt. This page is also available as Markdown.

Crypto AML Integration Guide

Who it's for: backend developers who want to screen crypto wallets and transactions for AML risk from their own server. Time to integrate: ~30 minutes. What you need to know: basic HTTP/JSON and Node.js (the examples use it, but the logic is the same in any language).


What you will have at the end

Your backend will be able to:

  1. Submit a wallet address or a transaction hash for screening.

  2. Get the result (via a webhook or polling): risk score, sources of funds, and related entities.

  3. Generate and download a PDF report for compliance.

How it works

Your server                        Allpass
    │  1. POST /crypto-aml/search      │
    │ ───────────────────────────────► │  state: PROCESSING
    │ ◄─────────────────────────────── │  { id: amlId, state }
    │                                   │  ...the check runs asynchronously...
    │  2. webhook cryptoAmlResult       │
    │ ◄─────────────────────────────── │  full result: score, sources of funds, entities
    │  3. POST /{id}/pdf-reports        │
    │ ───────────────────────────────► │  202 Accepted, status: PENDING
    │  4. webhook cryptoAmlPdfReportResult
    │ ◄─────────────────────────────── │  status: GENERATED, path
    │  5. GET /api/public/file/{path}   │  download the PDF

The check is asynchronous. The search request does not return a score. It returns the check id (amlId), and the result is delivered later by a webhook (or can be polled).


Step 0. Preparation

0.1. Create an Application in Workplace

  1. Open Applications in Workplace and create a new Application.

  2. Choose an Encryption Method: AES-256-CBC or AES-256-GCM.

  3. Save. After saving, the following keys appear:

Key
Purpose

Private App Key

Authorizes requests to the Public API (x-private-app-key header)

Crypto Key

Encrypts/decrypts data (hex, 32 bytes)

HMAC Key

AES-256-CBC only: signs data

0.2. Set up a webhook

In your Application, open the Webhook tab, click Add notifications via webhook, and enter the URL of your endpoint (for example, https://your-app.com/webhooks/allpass).

Your endpoint must respond with HTTP 200. Otherwise Allpass retries: first after 30 seconds, then with exponential backoff, up to 10 attempts. Failed deliveries are listed in the Failed Webhook Deliveries tab.

0.3. Test vs Live

Use Test mode (sandbox) for development and switch to Live in production. Each mode has its own keys. Details: Test and Live Modes.

0.4. Environment variables


Step 1. Response format and encryption

Response envelope

All Public API responses share the same wrapper:

The data field is always encrypted with your Crypto Key. What the x-allpass-signature header contains depends on the Encryption Method of your Application:

  • AES-256-CBC: the header contains an HMAC-SHA256 of the data string (IV + ciphertext), computed with your HMAC Key. Verify it before decrypting.

  • AES-256-GCM: the header contains the GCM auth tag. Pass it to the decipher: decryption fails if the data was modified. There is no separate HMAC step.

Encrypted data format

AES-256-CBC
AES-256-GCM

IV

16 bytes, hex, at the start of the string (32 characters)

12 bytes, hex, at the start of the string (24 characters)

Rest of the string

ciphertext in hex

ciphertext in hex

x-allpass-signature

HMAC-SHA256(hmacKey, iv+ciphertext) in hex

auth tag in hex

Keys

Crypto Key + HMAC Key

Crypto Key only

Integrity check

Manual: compare the HMAC before decrypting

Built in: decipher.final() throws on mismatch

Encryption helper

Use the tab that matches the Encryption Method of your Application. Both variants are saved as allpass-crypto.js and expose the same decrypt and encrypt functions, so the rest of the guide works with either.

The request body can be sent either as plain JSON or encrypted ({ "data": "<encrypted>" } plus the x-allpass-signature header). The examples below send plain JSON requests and always decrypt the responses.

API client

The following steps use allpass(...).


Step 2. Start a check

POST /api/public/crypto-aml/search

Pass the blockchain and exactly one of address or txHash.

Field
Type
Description

blockchain

enum

One of: BTC, LTC, BSV, ETH, TRON, POLYGON, BNB, ARBITRUM, BASE, AVALANCHE, MOONBEAM, DOT, SOLANA, TON, CARDANO, WORLDCOIN

address

string

Wallet address. Mutually exclusive with txHash

txHash

string

Transaction hash (64 hex characters, 0x optional). Mutually exclusive with address

Check a wallet:

Check a transaction:

Response (201 Created, after decryption):

The id is the amlId used in the following steps.

Notes:

  • Passing both address and txHash (or neither) returns 400.

  • Every check is charged to your balance. If the balance is insufficient, the request is rejected before the check starts.

  • An address format that is invalid for the chosen blockchain returns 400.


Step 3. Get the result

Check states (state):

State
Meaning

INITIAL

Created, not yet picked up

PROCESSING

Analysis in progress

FINISHED

Done, the result can be read

FAILED

Error, the reason is in errReason

When the check finishes, Allpass sends a cryptoAmlResult event to your webhook. The data field of the event contains the full check result, so no additional request is needed. It is the same object that polling returns (see Option B), except that pdfReports is included only in the polling response.

The request body uses the same envelope as API responses (data is encrypted, the signature is in x-allpass-signature). The decrypted event looks like this:

Field
Description

type

Event type: cryptoAmlResult or cryptoAmlPdfReportResult

id

Entity the event is about: the amlId for cryptoAmlResult, the requestId for cryptoAmlPdfReportResult

appKey

Key of the Application the event belongs to

data

Event payload (the check result, or the PDF report status)

timestamp

Time the event was created, in Unix milliseconds

eventId

Unique identifier of this delivery. Stays the same on every retry of the same delivery. Use it for idempotency

If the check could not be completed, data contains { statusCode, error, details } instead of the result.

Webhooks may be delivered more than once (retries), so the handler must be idempotent: store the eventId of every processed event and skip repeats. Do not deduplicate by id: the same amlId can legitimately appear in more than one event.

Option B: polling (fallback)

If a webhook is not available, poll the details endpoint every 2–5 seconds with an overall time limit:

GET /api/public/crypto-aml/{amlId}/details?type=WALLET|TRANSACTION

Result fields

For a wallet (type: WALLET):

Field
Description

id, blockchain, address

Check identification

state, errReason

State and error reason

score

Risk score

sof / uof

Sources of funds (sof) and uses of funds (uof): a list with owner, type, share, amount, depth

entities

Related entities (exchanges, mixers, etc.): name, scoreType, score

sharesByType, riskByType

Breakdown by risk type

addressInfo

Balance, transaction count, tags, first/last seen

isMonitoring

Whether the wallet is under monitoring

reviewStatus

UNKNOWN / APPROVED / REJECTED, the manual review decision

pdfReports

PDF report history (polling response only)

For a transaction (type: TRANSACTION): hash, score, state, blockNumber, timestamp, amount, uof, sof, assets, entities.


Step 4. PDF report (optional)

PDF generation is asynchronous and follows the same pattern: request, status, download.

4.1. Request generation

POST /api/public/crypto-aml/{amlId}/pdf-reports → 202 Accepted

The requestId (a UUID) is generated on your side and identifies the report request.

4.2. Check the status

Statuses: PENDING → GENERATED (with a path field) or FAILED (with an error: { code, message } object).

  • Webhook event: cryptoAmlPdfReportResult (id = requestId, report status in data).

  • Or request: GET /api/public/crypto-aml/{amlId}/pdf-reports/{requestId}.

  • History of all reports: GET /api/public/crypto-aml/{amlId}/pdf-reports?limit=20&offset=0 (limit 1–100, default 20). Response: { rows: [...], total }.

4.3. Download the file

When status = GENERATED, path looks like crypto-reports/<dir>/<clientKey>/<id>/<file>.pdf. The file is served at:

Streamed files are encrypted differently from JSON: always aes-256-cbc, Crypto Key only, no HMAC, regardless of the Encryption Method of your Application. The IV is taken from the x-initialization-vector response header (hex, 16 bytes).

File access is restricted to your clientKey: reports that belong to someone else return 404.


Step 5. Complete example

A single scenario file: screen a wallet, get the result, make a decision, and download the PDF if needed. It uses allpass-crypto.js and allpass-client.js from Step 1.

Run it:

Requires Node.js 20.6+ for --env-file, and Node 18+ for the built-in fetch.


Common errors and how to fix them

Symptom
Cause
Fix

401 App private key is empty / not correct

Missing or wrong x-private-app-key

Check the key and that it belongs to the right mode (Test/Live)

400 Decrypted input data is not correct

You encrypt the request body, but the signature/key/method do not match

Check that the helper matches the Encryption Method of your Application, the Crypto/HMAC keys, and the x-allpass-signature header

Invalid x-allpass-signature during decryption

Wrong HMAC Key or encryption method, or the Crypto Key was regenerated

Compare the keys with the Application in Workplace

400 on /search

Both address and txHash passed, or neither; or an invalid address/hash format

Pass exactly one field, in the format for the chosen blockchain

400 on /details

type is missing or wrong

?type=WALLET or ?type=TRANSACTION

Request rejected before the check starts

Insufficient balance

Top up your balance in Billing

Webhook arrives many times

Your endpoint did not respond 200 in time

Respond 200 immediately, move processing to a queue, and deduplicate by eventId

state: FAILED

Blockchain data could not be retrieved

See errReason; retry search if needed

404 when downloading a PDF

path does not belong to your clientKey, or is wrong

Use the path from the report status unchanged