> 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`).
> - 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. | 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: failedEmails | type: array<string> | description: Invites that failed.  


```

### 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: 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
   param name: policyIds | type: array<array> | description: Role GUIDs, referred to as policy GUIDs, to assign to the contributors. | required: true 
 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: failedEmails | type: array<string> | description: Invites that failed.  


```

### 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-hosted)
Self-hosted 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);
};
```

---