> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# BulkInvite

# Package: sites

# Namespace: SiteInvitesApi

# Method link: https://dev.wix.com/docs/api-reference/account-level/user-management/sites/site-invites/bulk-invite.md

## Permission Scopes:
Manage Contributors: SCOPE.DC-IDENTITY.MANAGE-CONTRIBUTORS

## Introduction

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.

---

## REST API

### Schema

```
 Method: bulkInvite
 Description: 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.
 URL: https://www.wixapis.com/invites/site-invite/bulk
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  policyIds, emails
 Method parameters: 
   param name: defaultEmailLanguage | type: defaultEmailLanguage | description: Language of emails to send. Relevant only for recipients that don't currently have a Wix user GUID. Default: Site owner's language.  
   param name: emails | type: array<emails> | description: Email addresses to which the invites should be sent. | required: true | validation: minItems 1, maxItems 10
   param name: invitePurpose | type: invitePurpose | description: Details explaining the purpose of the invite.  
   param name: locationRestriction | type: LocationRestriction    
        - name: locationIds | type: array<string> | description:   | validation: maxItems 20, format GUID
   param name: policyIds | type: array<policyIds> | description: Role GUIDs, referred to as policy GUIDs, to assign to the contributors. Ignored when `child_site_roles` is set. | required: true 
 Return type: BulkSiteInviteResponse
  - name: invites | type: array<SiteInvite> | description: Invites that were sent successfully.  
     - name: id | type: string | description: Invite GUID.  | read-only: true | validation: format GUID
     - name: siteId | type: string | description: Site GUID the user is invited to as a collaborator.  | read-only: true | validation: format GUID
     - name: email | type: string | description: Email address where the invite was sent.  | validation: format EMAIL
     - name: policyIds | type: array<string> | description: Role GUIDs included in the invite.  
     - name: status | type: InviteStatus | description: Invite Status.  Supported values: - **Pending:** The invite has been sent and is valid, waiting for the user's response. - **Used:** The invite has been accepted. - **Deleted:** The invite has been deleted or revoked. - **Declined:** The user declined the invite. - **Expired:** The invite has expired without being accepted.  
         - enum: Pending, Used, Deleted, Declined, Expired
     - name: acceptLink | type: string | description: Link to accept the invite.  
     - name: inviterAccountId | type: string | description: Inviting account GUID.  | read-only: true | validation: format GUID
     - name: acceptedByAccountId | type: string | description: Account GUID that accepted the invite. Populated only once the invite is accepted.  | read-only: true | validation: format GUID
     - name: dateCreated | type: string | description: Date the invite was created.  | validation: format date-time
     - name: staffId | type: string | description: User's Wix Bookings staff GUID, if relevant.  | validation: format GUID
     - name: expirationDate | type: string | description: Invite expiration date  | validation: format date-time
     - name: locationIds | type: array<string> | description: Location ids included in the invite  | read-only: true | validation: maxItems 20, format GUID
     - name: callerCapabilities | type: array<string> | description: A set of capability keys representing the actions that the caller is allowed to perform on this specific contributor. This field is calculated based on the identity of the request sender and may differ between callers.  | validation: maxItems 20, maxLength 20
  - name: failedInvites | type: array<FailedSiteInvite> | description: Invites that failed, with the reason for each.  
     - name: email | type: string | description: Email address the invite was addressed to.  | validation: format EMAIL
     - name: reason | type: SiteInviteFailureReason | description: Why this invite failed.  
         - enum:
         -     UNKNOWN_FAILURE_REASON: Failure reason could not be determined.
         -     USER_IS_SITE_OWNER: This person owns the site.
         -     USER_ON_REQUESTER_TEAM: This person has access to the site as a member of the requester's team.
         -     USER_ON_ANOTHER_TEAM: This person has access to the site as a member of a team that is not the requester's.
         -     USER_VIA_COLLABORATOR_ACCOUNT: This person's own account holds a collaborator assignment on the site.
         -     USER_ALREADY_HAS_ACCESS: This person already has access, but the source could not be determined.
         -     INVITE_ALREADY_EXISTS: An invite for this email address already exists on the site - pending, declined or expired.


```

### Examples

### Invite contributor to site
```curl
curl -X POST \
'https://www.wixapis.com/invites/site-invite/bulk' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
        "policyIds": [
          "6600344420111308827"
        ],
        "emails": [
          "some@email.com"
        ]
      }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.userManagement.siteInvites.bulkInvite(policyIds, options)
 Description: 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.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  policyIds, options.emails, options
 Method parameters: 
   param name: policyIds | type: array<string> | description: Role GUIDs, referred to as policy GUIDs, to assign to the contributors. Ignored when `child_site_roles` is set. | required: true 
   param name: options | type: BulkInviteOptions  none | required: true 
        - name: emails | type: array<string> | description: Email addresses to which the invites should be sent. | required: true | validation: minItems 1, maxItems 10
        - name: invitePurpose | type: string | description: Details explaining the purpose of the invite.  
        - name: defaultEmailLanguage | type: string | description: Language of emails to send. Relevant only for recipients that don't currently have a Wix user GUID. Default: Site owner's language.  
        - name: locationRestriction | type: LocationRestriction | description: Location restriction for the invite.  
           - name: locationIds | type: array<string> | description:   | validation: maxItems 20, format GUID
 Return type: PROMISE<BulkSiteInviteResponse>
  - name: invites | type: array<SiteInvite> | description: Invites that were sent successfully.  
     - name: _id | type: string | description: Invite GUID.  | read-only: true | validation: format GUID
     - name: siteId | type: string | description: Site GUID the user is invited to as a collaborator.  | read-only: true | validation: format GUID
     - name: email | type: string | description: Email address where the invite was sent.  | validation: format EMAIL
     - name: policyIds | type: array<string> | description: Role GUIDs included in the invite.  
     - name: status | type: InviteStatus | description: Invite Status.  Supported values: - **Pending:** The invite has been sent and is valid, waiting for the user's response. - **Used:** The invite has been accepted. - **Deleted:** The invite has been deleted or revoked. - **Declined:** The user declined the invite. - **Expired:** The invite has expired without being accepted.  
         - enum: Pending, Used, Deleted, Declined, Expired
     - name: acceptLink | type: string | description: Link to accept the invite.  
     - name: inviterAccountId | type: string | description: Inviting account GUID.  | read-only: true | validation: format GUID
     - name: acceptedByAccountId | type: string | description: Account GUID that accepted the invite. Populated only once the invite is accepted.  | read-only: true | validation: format GUID
     - name: dateCreated | type: Date | description: Date the invite was created.  
     - name: staffId | type: string | description: User's Wix Bookings staff GUID, if relevant.  | validation: format GUID
     - name: expirationDate | type: Date | description: Invite expiration date  
     - name: locationIds | type: array<string> | description: Location ids included in the invite  | read-only: true | validation: maxItems 20, format GUID
     - name: callerCapabilities | type: array<string> | description: A set of capability keys representing the actions that the caller is allowed to perform on this specific contributor. This field is calculated based on the identity of the request sender and may differ between callers.  | validation: maxItems 20, maxLength 20
  - name: failedInvites | type: array<FailedSiteInvite> | description: Invites that failed, with the reason for each.  
     - name: email | type: string | description: Email address the invite was addressed to.  | validation: format EMAIL
     - name: reason | type: SiteInviteFailureReason | description: Why this invite failed.  
         - enum:
         -     UNKNOWN_FAILURE_REASON: Failure reason could not be determined.
         -     USER_IS_SITE_OWNER: This person owns the site.
         -     USER_ON_REQUESTER_TEAM: This person has access to the site as a member of the requester's team.
         -     USER_ON_ANOTHER_TEAM: This person has access to the site as a member of a team that is not the requester's.
         -     USER_VIA_COLLABORATOR_ACCOUNT: This person's own account holds a collaborator assignment on the site.
         -     USER_ALREADY_HAS_ACCESS: This person already has access, but the source could not be determined.
         -     INVITE_ALREADY_EXISTS: An invite for this email address already exists on the site - pending, declined or expired.


```

### Examples

### Create and send site invites in bulk 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 bulkInvite(policyIds, options) {
  const response = await siteInvites.bulkInvite(policyIds, options);
}

```

### bulkInvite (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { siteInvites } from '@wix/user-management';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { siteInvites },
  // Include the auth strategy and host as relevant
});


async function bulkInvite(policyIds,options) {
  const response = await myWixClient.siteInvites.bulkInvite(policyIds,options);
};
```

---