Webhook Events
This page documents all webhook event types and their payloads.
Quick Reference
| Category | Events |
|---|
| Transactions | transaction.authorized, transaction.completed, transaction.declined, transaction.reversed |
| Cards | card.created, card.frozen, card.closed, card.expired, card.merchant_drift |
| Agents | agent.created, agent.suspended, agent.activated, agent.limit_exceeded, agent.limit_approaching |
| Users | user.created, user.updated, user.deleted, user.balance.updated |
| KYC | verification.initiated, user.application.approved, user.application.denied, user.application.needs_info |
| Deposits | deposit.address_ready, deposit.received |
| Withdrawals | withdrawal.submitted, withdrawal.confirmed, withdrawal.failed |
| Attestation | credential.accessed, spend.attested, spend.unattested |
| Intents | intent.pending_approval, intent.approved, intent.rejected, intent.matched, intent.mismatched, intent.expired |
| Anomalies | anomaly.duplicate, anomaly.velocity, anomaly.spend_spike, anomaly.unattested, anomaly.intent_mismatch, anomaly.cooldown, anomaly.merchant_drift |
| Auto-Actions | card.auto_frozen, agent.auto_suspended |
| 3DS | challenge.requested |
| Disputes | dispute.created, dispute.resolved |
Transaction Events
transaction.authorized
Sent when a transaction is authorized (pending hold placed).
{
"id": "evt_abc123",
"type": "transaction.authorized",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"userId": "user_abc",
"amount": 2500,
"currency": "USD",
"merchantName": "DoorDash",
"merchantCategory": "Restaurants",
"merchantCategoryCode": "5812",
"status": "pending",
"attestationStatus": "attested"
}
}
transaction.completed
Sent when a transaction settles (funds captured).
{
"id": "evt_abc123",
"type": "transaction.completed",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"userId": "user_abc",
"amount": 2500,
"authorizedAmount": 2500,
"currency": "USD",
"merchantName": "DoorDash",
"status": "completed",
"postedAt": 1703606400000
}
}
transaction.declined
Sent when a transaction is declined.
{
"id": "evt_abc123",
"type": "transaction.declined",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"amount": 50000,
"currency": "USD",
"merchantName": "Suspicious Merchant",
"status": "declined",
"declinedReason": "insufficient_funds"
}
}
Decline Reasons:
insufficient_funds - Credit limit exceeded
card_frozen - Card is frozen
card_closed - Card is closed
spending_limit_exceeded - Card or agent limit exceeded
blocked_merchant - Merchant on block list
blocked_mcc - Merchant category blocked
fraud_suspected - Fraud detection triggered
transaction.reversed
Sent when a refund is processed.
{
"id": "evt_abc123",
"type": "transaction.reversed",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"originalAmount": 2500,
"reversedAmount": 2500,
"currency": "USD",
"merchantName": "DoorDash",
"status": "reversed"
}
}
Card Events
card.created
Sent when a new card is issued.
{
"id": "evt_abc123",
"type": "card.created",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"cardId": "card_456",
"agentId": "agent_789",
"userId": "user_abc",
"type": "single",
"purpose": "Order dinner on DoorDash",
"last4": "4242",
"status": "active"
}
}
card.frozen
Sent when a card is frozen (manually or by policy).
{
"id": "evt_abc123",
"type": "card.frozen",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"cardId": "card_456",
"agentId": "agent_789",
"reason": "manual",
"frozenBy": "api"
}
}
Freeze Reasons:
manual - Frozen via API
agent_suspended - Parent agent was suspended
spending_limit_exceeded - Card limit exceeded
unattested_spend - Unattested transaction detected
merchant_drift - Unexpected merchant
card.closed
Sent when a card is closed.
{
"id": "evt_abc123",
"type": "card.closed",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"cardId": "card_456",
"agentId": "agent_789",
"reason": "single_use_completed",
"closedBy": "system"
}
}
Close Reasons:
manual - Closed via API
single_use_completed - Single-use card after successful transaction
ttl_expired - Card TTL reached
agent_deleted - Parent agent was deleted
card.expired
Sent when a card’s TTL is reached and the card is auto-frozen or closed.
{
"id": "evt_abc123",
"type": "card.expired",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"cardId": "card_456",
"agentId": "agent_789",
"userId": "user_abc",
"action": "close",
"previousStatus": "active",
"newStatus": "closed",
"expiresAt": 1703520000000,
"ttlMinutes": 60,
"reason": "ttl_expired"
}
}
card.merchant_drift
Sent when a transaction occurs at an unexpected merchant (doesn’t match merchantHint).
{
"id": "evt_abc123",
"type": "card.merchant_drift",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"cardId": "card_456",
"agentId": "agent_789",
"transactionId": "txn_123",
"expectedMerchant": "doordash",
"actualMerchant": "UBER EATS",
"amount": 2500,
"action": "allowed"
}
}
Actions:
allowed - Transaction proceeded (policy onDrift: "allow")
frozen - Card was frozen (policy onDrift: "freeze")
Agent Events
agent.created
Sent when a new agent is created.
{
"id": "evt_abc123",
"type": "agent.created",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"agentId": "agent_789",
"userId": "user_abc",
"name": "checkout-bot",
"status": "active"
}
}
agent.suspended
Sent when an agent is suspended.
{
"id": "evt_abc123",
"type": "agent.suspended",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"agentId": "agent_789",
"userId": "user_abc",
"reason": "spending_limit_exceeded",
"suspendedBy": "system"
}
}
Suspend Reasons:
manual - Suspended via API
spending_limit_exceeded - Agent limit exceeded
agent.activated
Sent when a suspended agent is reactivated.
{
"id": "evt_abc123",
"type": "agent.activated",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"agentId": "agent_789",
"userId": "user_abc",
"previousStatus": "suspended",
"activatedBy": "api"
}
}
agent.limit_exceeded
Sent when an agent hits its spending limit.
{
"id": "evt_abc123",
"type": "agent.limit_exceeded",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"agentId": "agent_789",
"userId": "user_abc",
"spendingLimit": 50000,
"currentSpend": 50250,
"frequency": "perMonth",
"action": "suspended"
}
}
agent.limit_approaching
Sent when an agent reaches 80% of their spending limit.
{
"id": "evt_abc123",
"type": "agent.limit_approaching",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"agentId": "agent_789",
"userId": "user_abc",
"spendingLimit": 50000,
"currentSpend": 40000,
"percentUsed": 80,
"frequency": "perMonth"
}
}
Verification Events
verification.initiated
Sent when KYC verification is initiated for a user.
{
"id": "evt_abc123",
"type": "verification.initiated",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"rainUserId": "rain_xyz",
"applicationStatus": "pending"
}
}
User Events
user.created
Sent when a new user is created.
{
"id": "evt_abc123",
"type": "user.created",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe"
}
}
user.updated
Sent when a user’s details are updated.
{
"id": "evt_abc123",
"type": "user.updated",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"email": "[email protected]",
"updatedFields": ["firstName", "lastName"]
}
}
user.deleted
Sent when a user is deleted or deactivated.
{
"id": "evt_abc123",
"type": "user.deleted",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"email": "[email protected]"
}
}
user.application.approved
Sent when a user’s KYC application is approved.
{
"id": "evt_abc123",
"type": "user.application.approved",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"email": "[email protected]",
"applicationStatus": "approved"
}
}
user.application.denied
Sent when a user’s KYC application is denied.
{
"id": "evt_abc123",
"type": "user.application.denied",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"email": "[email protected]",
"applicationStatus": "denied",
"reason": "identity_verification_failed"
}
}
user.application.needs_info
Sent when a user’s KYC application needs additional information.
{
"id": "evt_abc123",
"type": "user.application.needs_info",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"email": "[email protected]",
"applicationStatus": "needsInformation",
"requiredFields": ["governmentId", "proofOfAddress"]
}
}
user.balance.updated
Sent when a user’s balance changes.
{
"id": "evt_abc123",
"type": "user.balance.updated",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"available": 7500,
"pending": 1500,
"deposited": 10000,
"currency": "USD"
}
}
Deposit & Withdrawal Events
deposit.address_ready
Sent when a user’s deposit address is ready for receiving funds.
{
"id": "evt_abc123",
"type": "deposit.address_ready",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"chainId": 8453,
"depositAddress": "0x1234...abcd",
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
}
deposit.received
Sent when a deposit is received.
{
"id": "evt_abc123",
"type": "deposit.received",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"userId": "user_abc",
"chainId": 8453,
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": 10000,
"transactionHash": "0x..."
}
}
withdrawal.submitted
Sent when a withdrawal request is submitted.
{
"id": "evt_abc123",
"type": "withdrawal.submitted",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"withdrawalId": "withdrawal_xyz",
"userId": "user_abc",
"chainId": 8453,
"amount": 5000,
"recipientAddress": "0x...",
"status": "pending"
}
}
withdrawal.confirmed
Sent when a withdrawal is confirmed on-chain.
{
"id": "evt_abc123",
"type": "withdrawal.confirmed",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"withdrawalId": "withdrawal_xyz",
"userId": "user_abc",
"chainId": 8453,
"amount": 5000,
"recipientAddress": "0x...",
"transactionHash": "0x..."
}
}
withdrawal.failed
Sent when a withdrawal fails (e.g., on-chain error, insufficient gas).
{
"id": "evt_abc123",
"type": "withdrawal.failed",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"withdrawalId": "withdrawal_xyz",
"userId": "user_abc",
"chainId": 8453,
"amount": 5000,
"recipientAddress": "0x...",
"reason": "transaction_reverted",
"transactionHash": "0x..."
}
}
3DS Events
challenge.requested
Sent when a 3DS challenge (OTP) is available.
{
"id": "evt_abc123",
"type": "challenge.requested",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"challengeId": "challenge_xyz",
"cardId": "card_456",
"transactionId": "txn_123",
"otp": "123456",
"expiresAt": 1703520300000,
"deliveryMethod": "webhook"
}
}
The OTP is included directly in the webhook payload. Use this to complete 3DS challenges in your browser automation.
Attestation Events
credential.accessed
Sent when card credentials are retrieved.
{
"id": "evt_abc123",
"type": "credential.accessed",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"accessEventId": "evt_xyz",
"cardId": "card_456",
"agentId": "agent_789",
"exposureMode": "rawPan",
"summary": "Order dinner on DoorDash",
"expectedAmount": 2500
}
}
spend.unattested
Sent when a transaction occurs without a recent attestation.
{
"id": "evt_abc123",
"type": "spend.unattested",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"amount": 2500,
"merchantName": "Unknown Merchant",
"lastCredentialAccess": null
}
}
spend.attested
Sent when a transaction matches a prior credential access (attestation).
{
"id": "evt_abc123",
"type": "spend.attested",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"amount": 2500,
"merchantName": "DoorDash",
"attestedAt": 1703519900000,
"summary": "Order dinner on DoorDash",
"expectedAmount": 2500
}
}
Intent Events
intent.pending_approval
Sent when an intent is created that requires human approval before the agent can proceed.
{
"id": "evt_abc123",
"type": "intent.pending_approval",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"intentId": "int_xyz",
"customerIntentId": "order-123",
"cardId": "card_456",
"agentId": "agent_789",
"userId": "user_abc",
"summary": "Order laptop on Amazon",
"expectedAmount": 125000,
"expectedMerchant": "Amazon",
"expiresAt": 1703521800000,
"status": "pending_approval"
}
}
Respond to this webhook by calling POST /v1/intents/{intentId}/approve or POST /v1/intents/{intentId}/reject to allow or block the agent’s spending.
intent.approved
Sent when a pending intent is approved by a human.
{
"id": "evt_abc123",
"type": "intent.approved",
"organizationId": "org_xyz",
"createdAt": 1703520600000,
"data": {
"intentId": "int_xyz",
"customerIntentId": "order-123",
"cardId": "card_456",
"agentId": "agent_789",
"summary": "Order laptop on Amazon",
"expectedAmount": 125000,
"status": "pending",
"approvedAt": 1703520600000,
"approvedBy": "lk_live_abc..."
}
}
intent.rejected
Sent when a pending intent is rejected by a human.
{
"id": "evt_abc123",
"type": "intent.rejected",
"organizationId": "org_xyz",
"createdAt": 1703520600000,
"data": {
"intentId": "int_xyz",
"customerIntentId": "order-123",
"cardId": "card_456",
"agentId": "agent_789",
"summary": "Order laptop on Amazon",
"expectedAmount": 125000,
"status": "rejected",
"rejectedAt": 1703520600000,
"rejectedBy": "lk_live_abc...",
"rejectionReason": "Amount exceeds approved budget"
}
}
intent.matched
Sent when a transaction matches an intent within tolerance.
{
"id": "evt_abc123",
"type": "intent.matched",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"intentId": "int_xyz",
"customerIntentId": "order-123",
"cardId": "card_456",
"agentId": "agent_789",
"transactionId": "txn_123",
"summary": "Order lunch on DoorDash",
"expectedAmount": 2500,
"actualAmount": 2450,
"expectedMerchant": "DoorDash",
"actualMerchant": "DOORDASH",
"matchResult": {
"amountMatch": true,
"merchantMatch": true
}
}
}
intent.mismatched
Sent when a transaction matches an intent but is outside tolerance.
{
"id": "evt_abc123",
"type": "intent.mismatched",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"intentId": "int_xyz",
"customerIntentId": "order-123",
"cardId": "card_456",
"agentId": "agent_789",
"transactionId": "txn_123",
"summary": "Order lunch on DoorDash",
"expectedAmount": 2500,
"tolerance": 500,
"actualAmount": 5000,
"expectedMerchant": "DoorDash",
"actualMerchant": "DOORDASH",
"matchResult": {
"amountMatch": false,
"merchantMatch": true
}
}
}
A mismatched intent indicates the agent spent more (or less) than declared, or at a different merchant. Investigate for potential misuse.
intent.expired
Sent when an intent expires without a matching transaction.
{
"id": "evt_abc123",
"type": "intent.expired",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"intentId": "int_xyz",
"customerIntentId": "order-123",
"cardId": "card_456",
"agentId": "agent_789",
"summary": "Order lunch on DoorDash",
"expectedAmount": 2500,
"ttlMinutes": 30,
"createdAt": 1703518200000,
"expiredAt": 1703520000000
}
}
Dispute Events
dispute.created
Sent when a chargeback is initiated.
{
"id": "evt_abc123",
"type": "dispute.created",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"disputeId": "dispute_xyz",
"transactionId": "txn_123",
"cardId": "card_456",
"amount": 2500,
"reason": "fraud",
"status": "open"
}
}
dispute.resolved
Sent when a dispute is resolved.
{
"id": "evt_abc123",
"type": "dispute.resolved",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"disputeId": "dispute_xyz",
"transactionId": "txn_123",
"amount": 2500,
"outcome": "won",
"status": "closed"
}
}
Anomaly Events
Anomaly events are emitted by the risk engine when suspicious spending patterns are detected. See Risk Policies for configuration details.
anomaly.duplicate
Sent when a duplicate transaction is detected (same merchant + amount within time window).
{
"id": "evt_abc123",
"type": "anomaly.duplicate",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"action": "freeze_card",
"dryRun": false,
"details": {
"previousTransactionId": "txn_122",
"windowMinutes": 5,
"amount": 2500,
"merchantName": "AMAZON.COM"
}
}
}
anomaly.velocity
Sent when transaction velocity exceeds configured limits.
{
"id": "evt_abc123",
"type": "anomaly.velocity",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"action": "alert",
"dryRun": false,
"details": {
"count": 25,
"limit": 20,
"window": "hour"
}
}
}
anomaly.spend_spike
Sent when current spending rate exceeds historical baseline.
{
"id": "evt_abc123",
"type": "anomaly.spend_spike",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"action": "freeze_card",
"dryRun": false,
"details": {
"currentRate": 15000,
"baselineRate": 3000,
"multiplier": 5.0,
"threshold": 3.0,
"windowMinutes": 60
}
}
}
anomaly.unattested
Sent when a transaction occurs without prior credential attestation.
{
"id": "evt_abc123",
"type": "anomaly.unattested",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"action": "alert",
"dryRun": false,
"details": {
"amount": 2500,
"merchantName": "UNKNOWN MERCHANT",
"lastCredentialAccess": null
}
}
}
anomaly.intent_mismatch
Sent when a transaction doesn’t match the declared spending intent.
{
"id": "evt_abc123",
"type": "anomaly.intent_mismatch",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"intentId": "int_xyz",
"action": "alert",
"dryRun": false,
"details": {
"expectedAmount": 2500,
"actualAmount": 5000,
"expectedMerchant": "DoorDash",
"actualMerchant": "UBER EATS"
}
}
}
anomaly.cooldown
Sent when a transaction violates the card’s cooldown period.
{
"id": "evt_abc123",
"type": "anomaly.cooldown",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"action": "alert",
"dryRun": false,
"details": {
"cooldownMinutes": 5,
"lastTransactionAt": 1703519800000,
"timeSinceLastMinutes": 2
}
}
}
anomaly.merchant_drift
Sent when a multi-use card is used at an unexpected merchant.
{
"id": "evt_abc123",
"type": "anomaly.merchant_drift",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"transactionId": "txn_123",
"cardId": "card_456",
"agentId": "agent_789",
"action": "freeze_card",
"dryRun": false,
"details": {
"pinnedMerchant": "DOORDASH",
"actualMerchant": "UBER EATS",
"pinnedMcc": "5812",
"actualMcc": "5812"
}
}
}
Auto-Action Events
These events are emitted when the risk engine automatically takes action on a card or agent.
card.auto_frozen
Sent when a card is automatically frozen by the risk engine.
{
"id": "evt_abc123",
"type": "card.auto_frozen",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"cardId": "card_456",
"agentId": "agent_789",
"transactionId": "txn_123",
"reason": "anomaly_velocity",
"anomalyType": "velocity",
"dryRun": false
}
}
Reasons:
anomaly_duplicate - Duplicate transaction detected
anomaly_velocity - Velocity limit exceeded
anomaly_spend_spike - Spending spike detected
anomaly_unattested - Unattested spend
anomaly_intent_mismatch - Intent mismatch
anomaly_cooldown - Cooldown violation
anomaly_merchant_drift - Merchant drift detected
agent.auto_suspended
Sent when an agent is automatically suspended by the risk engine.
{
"id": "evt_abc123",
"type": "agent.auto_suspended",
"organizationId": "org_xyz",
"createdAt": 1703520000000,
"data": {
"agentId": "agent_789",
"userId": "user_abc",
"transactionId": "txn_123",
"reason": "anomaly_velocity",
"anomalyType": "velocity",
"dryRun": false,
"cardsFrozen": 3
}
}
When an agent is auto-suspended, all of its active cards are also frozen. Review the triggering transaction and anomaly details before reactivating.
If dryRun: true, the anomaly was detected but no action was taken. Use dry-run mode to tune your risk policies before enforcement.