Guides
LENS
Transaction monitoring — send events, read scores and alerts, give feedback.
LENS watches what your customers do. You send each transaction or account event in a neutral format, with your own identifiers. LENS scores the customer, raises alerts and keeps a profile.
Send an event
const event = await dc.lens.events.create({
external_id: 'txn_88213',
source: 'core-banking',
occurred_at: '2026-11-30T15:10:00Z',
rail: 'ach',
operation: 'withdrawal',
direction: 'outbound',
status: 'completed',
amount: 12400,
currency: 'USD',
subject: { reference: 'cus_10442', name: 'Emily Carter', country: 'US' },
counterparty: { reference: 'ext_acct_51', account: '****6789', country: 'US' },
device_id: 'dev_a91f',
ip: '73.162.10.4',
});
event.score; // 0 to 100
event.alert_ids; // alerts raised by this eventexternal_id is idempotent within the source: sending it again answers the event already recorded
(200, duplicate: true). A first send answers 201.
| Field | Values |
|---|---|
rail | ach, wire, rtp, card, bank_transfer, crypto, p2p, internal, bill_payment, cash, other |
direction | inbound, outbound, internal |
amount_usd | Optional. Computed from currency when it is absent |
counterparty.account | A masked number, never full card data |
counterparty.address, chain | A crypto address and its chain, screened (Crypto) |
Up to 100 events at once: POST /lens/events/batch with { events: [...] }.
Detections
| Detection | Raised when |
|---|---|
| Large amount | One event above the project's threshold |
| Velocity | Too many events in a sliding hour |
| Structuring | Several events just under a threshold |
| Listed counterparty | The counterparty is on your lists or on a shared list |
| Score | The customer's score crosses a threshold |
Thresholds are set in GET and PATCH /lens/detection-settings. Each alert sends lens.alert.
Feedback
await dc.lens.feedback.create({ target_type: 'alert', target_id: alert.id, label: 'false_positive', note: 'Known payroll transfer' });label: fraud, false_positive, chargeback, legitimate, money_laundering,
account_takeover. A false positive resolves the alert. Fraud, chargeback, money laundering or
account takeover puts the customer under enhanced monitoring and enters their score.

