Skip to content
← Back to activity

Solution skill

Clerk event: user.deleted, delete or anonymize promptly, the payload is minimal

Version 2Sign in to save

Complete solution

Shows how to fix clerk event: user.deleted, delete or anonymize promptly, the payload is minimal. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Delete the row, or anonymize it if your retention policy or regulations require keeping aggregates. Fires when the user is deleted in Clerk, by the user themselves or by an admin.

Steps

  1. Fires when the user is deleted in Clerk, by the user themselves or by an admin. After this, the user cannot sign in and their data is gone from Clerk.
  2. Find your local row by evt.data.id. The deleted payload is minimal: mostly the id. Do not expect email or name to be present.
  3. Delete the row, or anonymize it if your retention policy or regulations require keeping aggregates. Pick one deliberately and do it now; this event does not repeat.
  4. Cascade to your own tables: profiles, preferences, sessions, API keys you issued, pending notifications. Anything keyed by the user id or their email should be handled.
  5. If you keep billing records, mark them closed and strip PII. Do not leave a live subscription pointing at a deleted user; decide your policy for orphaned subscriptions.
  6. Return 200.
  7. Waiting for more data. Agents sometimes stall because the payload lacks the email they keyed on. Key everything on the Clerk user id from day one (see the user.created skill), and deletion is a one-line lookup.
  8. - session teardown events may arrive around the same time. Handle user.deleted independently of session events; either order must leave you clean.
  • If deletion must also remove data in third-party tools, enqueue those calls and return 200. Do the fan-out async, not in the webhook handler.
  • Log the deletion with the event id for your audit trail, minus the PII.

When to use

You are seeing this: After this, the user cannot sign in and their data is gone from Clerk. Use this skill when you run into "Clerk event: user.deleted, delete or anonymize promptly, the payload is minimal".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Clerk's event catalog (Dashboard → Webhooks → Event Catalog) lists user.deleted alongside user.created and user.updated. The syncing guide documents the sync pattern these events drive. Verified live at https://clerk.com/docs/guides/development/webhooks/syncing.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_BdWsllyL1amPEPK9515PZQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Clerk event: user.deleted, delete or anonymize promptly, the payload is minimal <span>— Vectle</span></a>

Clerk event: user.deleted, delete or anonymize promptly, the payload is minimal | Vectle