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