webhook.onDeleted
A subscription no longer exists — remove what you stored.
Fires when a subscription is deleted — through the API, or because the provider removed it (reason distinguishes). Remove the stored record.
hooks: {
webhook: {
onDeleted: async (event) => {
await prisma.webhook.deleteMany({
where: { id: event.webhookId },
});
},
},
},
Payload
PropType
id?string
Type
stringemailDriverstring
Type
stringactionWebhookLifecycleAction
Type
WebhookLifecycleActionsourceWebhookLifecycleSource
Type
WebhookLifecycleSourcereasonWebhookLifecycleReason
Type
WebhookLifecycleReasonrecommendedActions?WebhookRecommendedAction[]
Type
WebhookRecommendedAction[]scopeWebhookScope
Type
WebhookScopewebhook?Webhook
Type
WebhookpreviousWebhook?Webhook
Type
WebhookwebhookId?string
Type
stringproviderId?string
Type
stringsubscriptionId?string
Type
stringtarget?WebhookLifecycleTarget
Type
WebhookLifecycleTargetstatus?WebhookStatus
Type
WebhookStatuspreviousStatus?WebhookStatus
Type
WebhookStatusexpiresAt?Date
Type
DaterenewAfter?Date
Type
DatereceivedAt?Date
Type
Dateseverity?"info" | "warning" | "critical"
Type
"info" | "warning" | "critical"context?unknown
Type
unknownraw?unknown
Type
unknown