OrganizationInvitation
The OrganizationInvitation
object is the model around an organization invitation.
Properties
- Name
id
- Type
string
- Description
A unique identifier for this organization membership.
- Name
emailAddress
- Type
string
- Description
The email address the invitation has been sent.
- Name
organizationId
- Type
string
- Description
The organization ID of the organization this invitation is for.
- Name
publicMetadata
- Type
object
- Description
The public metadata of the organization membership.
- Name
role
- Type
OrganizationCustomRoleKey
- Description
The role of the current user in the organization.
- Name
status
- Type
'pending' | 'accepted' | 'revoked'
- Description
The status of the invitation.
- Name
createdAt
- Type
Date
- Description
Date of the time the membership was created.
- Name
updatedAt
- Type
Date
- Description
Date of the last time the membership was updated.
OrganizationCustomRoleKey
OrganizationCustomRoleKey
is a string that represents the user's role in the organization. Clerk provides the default roles org:admin
and org:member
. However, you can create custom roles as well.
Methods
revoke()
Revokes the invitation for the email it corresponds to.
revoke()
returns
Type | Description |
---|---|
Promise<OrganizationInvitation> | This method returns a Promise which resolves to the OrganizationInvitation for the revolked invitation. |
revoke()
example
The following example demonstrates how to revoke an organization invitation. It first gets the list of organization invitations using getInvitations()
and then revokes the first invitation in the list.
It assumes:
- you have followed the quickstart in order to add Clerk to your JavaScript application
- you have enabled the Organizations feature in your Clerk Dashboard
Feedback
Last updated on