Cancel a pending invitation
An administrator withdraws an invitation before the recipient accepts it.
Clerk · Module
Revokes an active Clerk invitation by ID and makes its invitation email link unusable. The call returns the revoked Invitation resource.
Call the Backend API method with an invitation identifier. Clerk invalidates the invitation's email link and resolves with the revoked Invitation object; the method is intended for active invitations only.
function revokeInvitation(invitationId: string): Promise<Invitation>| Name | Type | Description |
|---|---|---|
invitationId | string | The ID of the invitation to revoke. |
Promise<Invitation>
import { clerkClient } from '@clerk/nextjs/server'
export async function POST() {
const invitation = await clerkClient.invitations.revokeInvitation({
invitationId: 'invitation_123',
})
return Response.json({ message: 'Invitation revoked', invitation })
}Revokes the specified invitation and returns the revoked invitation.
An administrator withdraws an invitation before the recipient accepts it.
A backend endpoint needs to invalidate an invitation link.
An application displays the updated invitation state after cancellation.
It takes an invitation ID and returns a Promise<Invitation>. The operation revokes the invitation and makes its email link unusable.
Follow-up: What happens if the invitation was already revoked? It cannot be revoked again because only active invitations are eligible.
Use the Backend API through Clerk's clerkClient wrapper, passing the invitation ID to the method. The wrapper handles the corresponding backend operation for the SDK.
Follow-up: What is the underlying endpoint? It is POST /invitations/{invitation_id}/revoke.
Revoking an invitation only invalidates the invitation link. It does not prevent the recipient from entering the normal signup flow independently.
Follow-up: How would you restrict registration to invited users? Use Clerk's invite-only access mode rather than relying on revocation.
InvitationclerkClientPOST /invitations/{invitation_id}/revoke