> 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

# CreateInvite

# Package: accounts

# Namespace: AccountInvitesApi

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

## Permission Scopes:
Manage Team Members: SCOPE.IDENTITY.MANAGE-TEAM-MEMBERS

## Introduction

Creates and sends invite emails to a list of potential team members, inviting them to become team members of the requesting account.
The invites may be limited to a specific resource (site or other asset).
Maximum 50 invitees can be specified per call.

> **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: createInvite
 Description: Creates and sends invite emails to a list of potential team members, inviting them to become team members of the requesting account. The invites may be limited to a specific resource (site or other asset). Maximum 50 invitees can be specified per call.  > **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/account-invite/create
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  subjectsAssignments
 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: subjectsAssignments | type: array<subjectsAssignments> | description: Array of potential team members' email addresses and their corresponding assignments (how they will be assigned when they accept the invite). | required: true | validation: minItems 1, maxItems 50
              - name: subjectEmail | type: string | description: Invitee's email address.  | validation: format EMAIL
              - name: assignments | type: array<InviteResourceAssignment> | description: Mapping of roles (referred to here as policies) and assets (referred to here as resources) that will be assigned to the invitee when they accept the invite. When no resources are specified, the invitee will be given access to everything within the account.  
                 - name: policyId | type: string | description: Role GUID.  
                 - name: assignments | type: array<InviteAssignment> | description: Resources the user will be able to access.  
                    - name: fullNameResource | type: FullNameResource | description: Full name of resource to be assigned.  
                       - ONE-OF: 
                          - name: siteContext | type: SiteResourceContext | description: Specific site details.  
                             - name: metasiteId | type: string | description: Site GUID.  
                          - name: accountContext | type: AccountResourceContext | description: Specific account details.  
                             - name: accountId | type: string | description: Account GUID.  
 Return type: CreateInviteResponse
  - name: successfulInvites | type: array<AccountInvite> | description: Invites that were sent successfully.  
     - name: id | type: string | description: Invite GUID.  | read-only: true | validation: format GUID
     - name: accountId | type: string | description: Account GUID.  | read-only: true | validation: format GUID
     - name: email | type: string | description: Email address where the invite was sent.  | validation: format EMAIL
     - 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 has 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: policyIds | type: array<string> | description: Role GUIDs included in the invite.  
     - name: dateUpdated | type: string | description: Date the invite was last updated.  | validation: format date-time
     - name: assignments | type: array<InviteResourceAssignment> | description: Assets the users are invited to join.  
        - name: policyId | type: string | description: Role GUID.  
        - name: assignments | type: array<InviteAssignment> | description: Resources the user will be able to access.  
           - name: fullNameResource | type: FullNameResource | description: Full name of resource to be assigned.  
              - ONE-OF: 
                 - name: siteContext | type: SiteResourceContext | description: Specific site details.  
                    - name: metasiteId | type: string | description: Site GUID.  
                 - name: accountContext | type: AccountResourceContext | description: Specific account details.  
                    - name: accountId | type: string | description: Account GUID.  
     - name: expirationDate | type: string | description: Invite expiration date.  | validation: format date-time
  - name: failedInvites | type: array<InviteFailure> | description: Invites that failed.  
     - name: subjectEmail | type: string | description: Email address of the failed invite.  | validation: format EMAIL
     - name: errorMessage | type: string | description: Error description.  


```

### Examples

### Invite team member to account
```curl
curl -X POST \
'https://www.wixapis.com/invites/account-invite/create' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
        "subjectsAssignments": [
          {
            "assignments": [
              {
                "policyId": "6600344420111308827",
                "assignments": []
              }
            ],
            "subjectEmail": "some@email.com"
          }
        ],
      }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.userManagement.accountInvites.createInvite(subjectsAssignments, options)
 Description: Creates and sends invite emails to a list of potential team members, inviting them to become team members of the requesting account. The invites may be limited to a specific resource (site or other asset). Maximum 50 invitees can be specified per call.  > **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:  subjectsAssignments
 Method parameters: 
   param name: subjectsAssignments | type: array<SubjectInviteAssignments> | description: Array of potential team members' email addresses and their corresponding assignments (how they will be assigned when they accept the invite). | required: true | validation: minItems 1, maxItems 50
              - name: subjectEmail | type: string | description: Invitee's email address.  | validation: format EMAIL
              - name: assignments | type: array<InviteResourceAssignment> | description: Mapping of roles (referred to here as policies) and assets (referred to here as resources) that will be assigned to the invitee when they accept the invite. When no resources are specified, the invitee will be given access to everything within the account.  
                 - name: policyId | type: string | description: Role GUID.  
                 - name: assignments | type: array<InviteAssignment> | description: Resources the user will be able to access.  
                    - name: fullNameResource | type: FullNameResource | description: Full name of resource to be assigned.  
                       - ONE-OF: 
                          - name: siteContext | type: SiteResourceContext | description: Specific site details.  
                             - name: metasiteId | type: string | description: Site GUID.  
                          - name: accountContext | type: AccountResourceContext | description: Specific account details.  
                             - name: accountId | type: string | description: Account GUID.  
   param name: options | type: CreateInviteOptions  none  
        - 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.  
 Return type: PROMISE<CreateInviteResponse>
  - name: successfulInvites | type: array<AccountInvite> | description: Invites that were sent successfully.  
     - name: _id | type: string | description: Invite GUID.  | read-only: true | validation: format GUID
     - name: accountId | type: string | description: Account GUID.  | read-only: true | validation: format GUID
     - name: email | type: string | description: Email address where the invite was sent.  | validation: format EMAIL
     - 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 has 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: policyIds | type: array<string> | description: Role GUIDs included in the invite.  
     - name: dateUpdated | type: Date | description: Date the invite was last updated.  
     - name: assignments | type: array<InviteResourceAssignment> | description: Assets the users are invited to join.  
        - name: policyId | type: string | description: Role GUID.  
        - name: assignments | type: array<InviteAssignment> | description: Resources the user will be able to access.  
           - name: fullNameResource | type: FullNameResource | description: Full name of resource to be assigned.  
              - ONE-OF: 
                 - name: siteContext | type: SiteResourceContext | description: Specific site details.  
                    - name: metasiteId | type: string | description: Site GUID.  
                 - name: accountContext | type: AccountResourceContext | description: Specific account details.  
                    - name: accountId | type: string | description: Account GUID.  
     - name: expirationDate | type: Date | description: Invite expiration date.  
  - name: failedInvites | type: array<InviteFailure> | description: Invites that failed.  
     - name: subjectEmail | type: string | description: Email address of the failed invite.  | validation: format EMAIL
     - name: errorMessage | type: string | description: Error description.  


```

### Examples

### Create and send account invites in bulk with an API key
```javascript
import { createClient, ApiKeyStrategy } from "@wix/sdk";
import { accountInvites } from "@wix/user-management";

const wixClient = createClient({
 modules: { accountInvites },
 auth: ApiKeyStrategy({
    apiKey: "MY-API-KEY",
  }),
});

async function createInvite(subjectsAssignments, options) {
  const response = await accountInvites.createInvite(
    subjectsAssignments,
    options,
  );
}

```

### createInvite (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 { accountInvites } from '@wix/user-management';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function createInvite(subjectsAssignments,options) {
  const response = await myWixClient.accountInvites.createInvite(subjectsAssignments,options);
};
```

---