Setup

To use the SiteInvites API, install the @wix/user-management package using npm or Yarn:

Copy

or

Copy

Then import { siteInvites } from @wix/user-management:

Copy
Did this help?

Sample Flows

This article shares some typical use cases you can support, as well as an example flow that supports each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your implementation.

Manage invitations sent to customers for the Wix site your company created for them

If your company creates Wix sites before handing them over to customers, you can invite the relevant customers to manage their sites once the site design and setup are complete.

  1. Select the relevant roles (referred to in Bulk Invite as policies) to apply to the invitees when they accept the invitation. See Roles and Permissions for a list of available roles.
  2. Call Bulk Invite with the relevant email addresses and roles to apply to their access. For example, co-owner or website manager. Each invitee is assigned an invite ID.
  3. If a customer misplaces the invitation email, you can call Resend Invite to trigger a new invite email to the specific invitee, passing the inviteId returned from the Bulk Invite call.
  4. If the customer's invitation to the site needs to be revoked for any reason before it is accepted, you can call Revoke Invite, passing the inviteId returned from the Bulk Invite call.
Did this help?

bulkInvite( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates and sends emails inviting potential site contributors to become contributors in the requesting site.

Important: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.

Method Declaration
Copy
Method Parameters
policyIdsArray<string>Required

Role IDs, referred to as policy IDs, to assign to the contributors.


optionsBulkInviteOptions

Filter options.

Returns
Return Type:Promise<BulkSiteInviteResponse>
Create and send site invites in bulk with an API key
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

resendInvite( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Resends the email invitation to a potential site contributor.

Important: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.

Method Declaration
Copy
Method Parameters
inviteIdstringRequired

Invite ID.


optionsResendInviteOptions

Filter options.

Returns
Return Type:Promise<SiteInviteResponse>
Resend a site invite with an API key
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

revokeInvite( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Revokes a pending site contributor invite.

Important: This call requires an account level API key and cannot be authenticated with the standard authorization header. API keys are currently available to selected beta users only.

Method Declaration
Copy
function revokeInvite(inviteId: string): Promise<void>;
Method Parameters
inviteIdstringRequired

Invite ID.

Revoke a pending site invite with an API key
JavaScript
import { createClient, ApiKeyStrategy } from "@wix/sdk"; import { siteInvites } from "@wix/user-management"; const wixClient = createClient({ modules: { siteInvites }, auth: ApiKeyStrategy({ siteId: "MY-SITE-ID", apiKey: "MY-API-KEY", }), }); async function revokeInvite(inviteId) { const response = await siteInvites.revokeInvite(inviteId); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?