Docs

revokeInvitation()

Revokes an Invitation.

Revoking an invitation makes the invitation email link unusable. However, it doesn't prevent the user from signing up if they follow the sign up flow.

Only active (i.e. non-revoked) invitations can be revoked.

function revokeInvitation(invitationId: string): Promise<Invitation>
  • Name
    invitationId
    Type
    string
    Description

    The ID of the invitation to revoke.

const invitationId = 'inv_123'

const response = await clerkClient.invitations.revokeInvitation(invitationId)

console.log(response)
/*
_Invitation {
  id: 'inv_123',
  emailAddress: 'invite@example.com',
  publicMetadata: { example: 'metadata', example_nested: [Object] },
  createdAt: 1705531674576,
  updatedAt: 1705533499411,
  status: 'revoked',
  revoked: true
}
*/

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint POST/invitations/{invitation_id}/revoke. See the BAPI reference for more details.

Feedback

What did you think of this content?

Last updated on