webhook.onActionRequired
A subscription needs your app's help — auth revoked, endpoint unreachable.
Fires when emailkit can’t fix a subscription on its own — auth was revoked, the endpoint is unreachable, deliveries are failing. reason says what happened and recommendedActions say what to do next (reauthorize, recreate, fix_endpoint, …).
hooks: {
webhook: {
onActionRequired: async (event) => {
if (event.recommendedActions?.includes("reauthorize")) {
await askUserToReconnect(event.target?.mailboxEmail);
} else {
await alertOps("webhook needs attention", event);
}
},
},
},
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