Organization Invitations
These are all methods on the Organization class that allow you to manage the invitations to an organization.
getInvitations()
Retrieves a list of invitations for the currently active organization.
function getInvitations(params?: GetInvitationsParams): Promise<PaginatedResources<OrganizationInvitation>>;
GetInvitationsParams
Name | Type | Description |
---|---|---|
initialPage? | number | A number that can be used to skip the first n-1 pages. For example, if initialPage is set to 10, it is will skip the first 9 pages and will fetch the 10th page. |
pageSize? | number | A number that indicates the maximum number of results that should be returned for a specific page. |
status? | 'pending' | 'accepted' | 'revoked' | The status an invitation can have. |
Returns
Type | Description |
---|---|
Promise<PaginatedResponse<OrganizationInvitation>> | This method returns a Promise which resolves with a list of OrganizationInvitation objects. |
getPendingInvitations()
(deprecated)
This method is deprecated in favor of getInvitations()
.
Retrieves a list of organization invitations that have not yet been accepted.
function getPendingInvitations(params?: GetPendingInvitationsParams): Promise<OrganizationInvitation[]>;
GetPendingInvitationsParams
Name | Type | Description |
---|---|---|
limit | number | Limit of the results returned. |
offset | number | The offset of results to start the retrieval. |
Returns
Type | Description |
---|---|
Promise<OrganizationInvitation[]> | This method returns a Promise which resolves with a list of OrganizationInvitation objects. |
inviteMember()
Creates and sends an invitation to the target email address for becoming a member with the role passed on the function parameters.
function inviteMember(params: InviteMemberParams): Promise<OrganizationInvitation>;
InviteMemberParams
Name | Type | Description |
---|---|---|
emailAddress | string | The email address to invite. |
role | string | The role of the new member. |
Returns
Type | Description |
---|---|
Promise<OrganizationInvitation> | This method returns a Promise which resolves to the OrganizationInvitation for the created invitation. |
inviteMembers()
Creates and sends an invitation to the target email addresses for becoming a member with the role passed on the function parameters.
function inviteMembers(params: InviteMembersParams): Promise<OrganizationInvitation[]>;
InviteMembersParams
Name | Type | Description |
---|---|---|
emailAddresses | string[] | The email addresses to invite. |
role | string | The role of the new members. |
Returns
Type | Description |
---|---|
Promise<OrganizationInvitation[]> | This method returns a Promise which resolves to a list of OrganizationInvitation s for the created invitations. |