Skip to main content

deleteInvitation()

Permanently deletes the given invitation and the copies of the invitation email Clerk stored for its recipient.

Unlike revoking, deleting removes the invitation record itself, which helps honor a data erasure request from someone who was invited but never signed up. Other records that contain the same email address, such as users or organization invitations, are not affected.

Invitations of any status can be deleted.

Returns the DeletedObject object.

function deleteInvitation(invitationId: string): Promise<DeletedObject>
  • Name
    invitationId
    Type
    string
    Description

    The ID of the invitation to delete.

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const invitationId = 'inv_123'

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

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on