Skip to content
emailkit
Esc
navigateopen⌘Jpreview
On this page

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
Typestring
emailDriverstring
Typestring
actionWebhookLifecycleAction
TypeWebhookLifecycleAction
sourceWebhookLifecycleSource
TypeWebhookLifecycleSource
reasonWebhookLifecycleReason
TypeWebhookLifecycleReason
recommendedActions?WebhookRecommendedAction[]
TypeWebhookRecommendedAction[]
scopeWebhookScope
TypeWebhookScope
webhook?Webhook
TypeWebhook
previousWebhook?Webhook
TypeWebhook
webhookId?string
Typestring
providerId?string
Typestring
subscriptionId?string
Typestring
target?WebhookLifecycleTarget
TypeWebhookLifecycleTarget
status?WebhookStatus
TypeWebhookStatus
previousStatus?WebhookStatus
TypeWebhookStatus
expiresAt?Date
TypeDate
renewAfter?Date
TypeDate
receivedAt?Date
TypeDate
severity?"info" | "warning" | "critical"
Type"info" | "warning" | "critical"
context?unknown
Typeunknown
raw?unknown
Typeunknown

Last updated on July 24, 2026

Was this page helpful?