Skip to content
emailkit
Esc
navigateopen⌘Jpreview
On this page

webhook.onUpdated

A subscription was renewed or its status changed — store the new state.

Fires when a subscription is renewed, refreshed, or changes status — reason says which. Store the new webhook state; previousWebhook shows what changed.

hooks: {
  webhook: {
    onUpdated: async (event) => {
      await prisma.webhook.update({
        where: { id: event.webhook.id },
        data: {
          expiresAt: event.webhook.expiresAt,
          data: event.webhook,
        },
      });
    },
  },
},

Payload

webhook is always set for this action.

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?