Account Events
Account events are triggered when user accounts are created.
TypeScript Interfaces
Section titled “TypeScript Interfaces”Copy these interfaces to type your webhook handlers:
/** Base event properties included in all webhook events */interface BaseEvent { /** Unique event identifier (UUID) */ id: string; /** Event type */ kind: string; /** ISO 8601 timestamp */ time: string; /** Transaction identifier for grouping related events */ transactionId: string;}account.created
Section titled “account.created”Triggered when a new user account is created.
{ "id": "evt_abc123", "kind": "account.created", "time": "2024-01-15T10:30:00Z", "transactionId": "txn_xyz789", "userId": "user_456", "firstName": "John", "lastName": "Smith", "email": "john.smith@example.com", "facilityName": "Main Warehouse"}interface AccountCreatedEvent extends BaseEvent { kind: "account.created"; /** User UUID */ userId: string; /** User's first name */ firstName: string; /** User's last name */ lastName: string; /** User's email address */ email: string; /** Facility name the user belongs to */ facilityName: string;}Example Handler
Section titled “Example Handler”async function handleAccountWebhook(event: AccountCreatedEvent) { if (event.kind === "account.created") { console.log(`New account created for ${event.firstName} ${event.lastName}`); // Provision access in external systems // Send welcome notification }}