Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Account Events

Account events are triggered when user accounts are created.

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;
}

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"
}

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
}
}