Docs

UserOrganizationInvitation

The OrganizationInvitation object is the model around an organization invitation.

Properties

  • Name
    id
    Type
    string
    Description

    The unique identifier for this organization invitation.

  • Name
    emailAddress
    Type
    string
    Description

    The email address the invitation has been sent to.

  • Name
    publicOrganizationData
    Type
    object
    Description

    Information about the organization the invitation is for. It includes the following properties:

    • hasImage
    • imageUrl
    • name
    • id
    • slug
  • Name
    publicMetadata
    Type
    UserOrganizationInvitationPublicMetadata
    Description

    The public metadata of the organization invitation.

  • 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

    The date when the invitation was created.

  • Name
    updatedAt
    Type
    Date
    Description

    The date when the invitation was last 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

accept()

Accepts the invitation to the organization.

function accept(): Promise<UserOrganizationInvitation>

Example

To see an example of how to use the accept() method, see the custom flow guide for managing invitations.

Feedback

What did you think of this content?

Last updated on