Monitor

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 event

external_id is idempotent within the source: sending it again answers the event already recorded (200, duplicate: true). A first send answers 201.

FieldValues
railach, wire, rtp, card, bank_transfer, crypto, p2p, internal, bill_payment, cash, other
directioninbound, outbound, internal
amount_usdOptional. Computed from currency when it is absent
counterparty.accountA masked number, never full card data
counterparty.address, chainA crypto address and its chain, screened (Crypto)

Up to 100 events at once: POST /lens/events/batch with { events: [...] }.

Detections

DetectionRaised when
Large amountOne event above the project's threshold
VelocityToo many events in a sliding hour
StructuringSeveral events just under a threshold
Listed counterpartyThe counterparty is on your lists or on a shared list
ScoreThe 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.

On this page