Skip to content
emailkit
Esc
navigateopen⌘Jpreview
On this page

mailbox.onDeleted

A mailbox was deleted or disconnected — clean up your records.

Fires when a mailbox is deleted through emailkit.mailboxes.delete(), or when a provider that hosts the connection (AIInbx) reports a disconnect by webhook — there it also carries the context you passed to mailboxes.connect(). Remove what you stored for it — the mailbox record and its auth.

hooks: {
  mailbox: {
    onDeleted: async ({ mailbox }) => {
      await prisma.connectedMailbox.deleteMany({
        where: { email: mailbox.email },
      });
    },
  },
},

Payload

PropType
emailDriverstring
Typestring
mailboxMailbox
TypeMailbox
context?unknown
Typeunknown

Last updated on September 20, 2026

Was this page helpful?