revokeInvitation()
Revokes an invitation with the provided invitationId
. Throws an error if invitationId
is invalid.
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>;
revokeInvitation()
parameters
Name | Type | Description |
---|---|---|
invitationId | string | The ID of the invitation to revoke. |
revokeInvitation()
example
const invitationId = 'inv_123'; const response = await clerkClient.invitations.revokeInvitation(invitationId); console.log(response); /* In this example, you can see that the response is an Invitation object. The status is set to 'revoked' and the `revoked` property is set to `true`. _Invitation { id: 'inv_2b6NfrkHKSU6mSYx2FwX4AtzeFi', 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(opens in a new tab) for more details.
Last updated on March 7, 2024