Skip to main content

Webhooks and Demo Agent

This repository includes two public webhook routes and one public demo-agent stream route.

Public operational routes

MethodRoutePurpose
POST/api/webhooks/bridgeReceive Bridge transfer and KYC events
POST/api/webhooks/tempoReceive Tempo transaction confirmation events
POST/api/demo/run-agentStream the demo agent terminal sequence as SSE

Bridge webhook

Verification

  • Header: canonical x-webhook-signature
  • Compatibility header: bridge-signature
  • Primary verification: RSA-SHA256 with BRIDGE_WEBHOOK_SECRET
  • Fallback verification: HMAC-SHA256 for test or sandbox-style secrets

Canonical events handled

Event typeEffect
transfer.payment_processedUpdates payment_items.status by transfer id
customer.updatedUpdates employee kyc_status and records a compliance event
card_transaction.createdAccepted without local persistence in the current code

Compatibility events also accepted

  • transfer.state_changed
  • kyc.status_updated
  • card.transaction

Tempo webhook

Verification

  • Header: x-tempo-signature
  • Secret: TEMPO_WEBHOOK_SECRET
  • Scheme: HMAC-SHA256 with sha256= prefix

Events currently handled

Event typeEffect
transaction.confirmedMarks a payroll run as completed and confirms its payment items
transaction.failedMarks the payroll run and payment items as failed

Demo agent route

POST /api/demo/run-agent returns text/event-stream. The current implementation emits a scripted sequence that mirrors the sixty-second pitch:
  1. Session open
  2. Yield-rate request
  3. Treasury balance request
  4. Compliance sweep
  5. Payroll execute request
  6. Session close
Each event carries:
{
  "type": "system",
  "text": "Remlo Agent v1.0 ...",
  "timestamp": "14:03:22"
}
The employer dashboard demo terminal and the standalone scripts/demo-agent.ts script are built around this flow.