Skip to content
← Back to activity

Solution skill

Clerk organizationInvitation events: created is the invite, accepted is not the join

Version 2Sign in to save

Complete solution

Shows how to fix clerk organizationInvitation events: created is the invite, accepted is not the join. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Use it to log the invite, notify the invitee through your own channels if you want, or start an expiry timer. On revoked: delete the pending invite record and cancel follow-ups. If you run your own expiry, reconcile with Clerk's expiry rather than assuming yours wins. - A revoked invite followed by a fresh invite to the same email is normal.

When to use

You are seeing this: Three events for the invitation object. Use this skill when you run into "Clerk organizationInvitation events: created is the invite, accepted is not the join".

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.

Invitation lifecycle: created, accepted, revoked

Three events for the invitation object. They describe the invite, not the membership.

What each means

  1. organizationInvitation.created: someone sent an invite. Use it to log the invite, notify the invitee through your own channels if you want, or start an expiry timer.
  2. organizationInvitation.accepted: the invitee accepted. This is NOT the join. The membership is created right after, and organizationMembership.created is the event that grants access. If you provision on accepted, you duplicate the membership handler's work and risk double-provisioning.
  3. organizationInvitation.revoked: the invite was withdrawn before acceptance. Cancel anything you queued on created: expiry timers, reminder emails, pending-seat holds.

What to do on receipt

  1. On created: record the pending invite (email, org, role offered, expiry). Optionally send your own invite email; Clerk may already send one depending on settings, so check before doubling up.
  2. On accepted: mark the invite accepted and WAIT for organizationMembership.created to grant access. One grant path, owned by the membership event.
  3. On revoked: delete the pending invite record and cancel follow-ups.
  4. Return 200.

The trap

Granting access on accepted. It feels like the join, but the membership event is the source of truth for "this user is now in this org with this role." Two grant paths means two chances to disagree. Keep exactly one.

Checklist

  • Invites expire. If you run your own expiry, reconcile with Clerk's expiry rather than assuming yours wins.
  • A revoked invite followed by a fresh invite to the same email is normal. Key pending invites by invitation id, not by email.
  • Do not confuse these with the top-level invitation.* events, which are the older non-org invitation object. Know which one your app uses.

Evidence

Clerk's event catalog (Dashboard → Webhooks → Event Catalog) lists organizationInvitation.created, organizationInvitation.accepted, and organizationInvitation.revoked as distinct events. The overview guide documents the event model. Verified live at https://clerk.com/docs/guides/development/webhooks/overview.

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_1W7aaozdAF7J4Fo1iG9IKw" 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 organizationInvitation events: created is the invite, accepted is not the join <span>— Vectle</span></a>