> 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

# GenerateAccountInviteLinks

# Package: eligibility

# Namespace: OrganizationService

# Method link: https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/generate-account-invite-links.md

## Permission Scopes:
Manage Channels Account Codes: SCOPE.CHANNELS.MANAGE_ACCOUNT_KEYS

## Introduction

Generates sign-in invite links that link your users' Wix accounts to your account.


Each invite link is a full sign-in URL that contains a one-time-use account code. For example,
`https://users.wix.com/signin?organizationId=<accountId>&organizationInviteCode=<code>`.
When a user opens the link and signs up or logs in to Wix, their account is linked to
your account as a sub-account. Links in the same batch differ only by the value of the
`organizationInviteCode` query parameter.

Your account must be set up by Wix as a Channel organization account. Otherwise, the call
fails with `ORGANIZATION_NOT_ELIGIBLE`.

By default, the account codes never expire: they stay redeemable until they're
redeemed or deleted. To have them expire, specify a lifetime of up to 5 years in
`expirationDurationInSeconds`.

Optionally, specify a `batchLabel` to group the account codes, for example by campaign.
You can later delete every unredeemed account code in the batch at once with
[Delete Account Codes By Batch Label](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-codes-by-batch-label.md).

An account can have up to 5,000,000 active account codes, meaning codes that haven't been
redeemed and haven't expired. If generating the batch would exceed this limit, the call
fails and no account codes are created.

To delete account codes you no longer want to be redeemable, call
[Delete Account Code](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-code.md),
[Bulk Delete Account Codes](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/bulk-delete-account-codes.md),
or [Delete Account Codes By Batch Label](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-codes-by-batch-label.md).

The account the invite links are issued for is always the calling channel's own
account, taken from the identity of the API key used to make the call. It's never
taken from a value passed in the request.

---

## REST API

### Schema

```
 Method: generateAccountInviteLinks
 Description: Generates sign-in invite links that link your users' Wix accounts to your account.   Each invite link is a full sign-in URL that contains a one-time-use account code. For example, `https://users.wix.com/signin?organizationId=<accountId>&organizationInviteCode=<code>`. When a user opens the link and signs up or logs in to Wix, their account is linked to your account as a sub-account. Links in the same batch differ only by the value of the `organizationInviteCode` query parameter.  Your account must be set up by Wix as a Channel organization account. Otherwise, the call fails with `ORGANIZATION_NOT_ELIGIBLE`.  By default, the account codes never expire: they stay redeemable until they're redeemed or deleted. To have them expire, specify a lifetime of up to 5 years in `expirationDurationInSeconds`.  Optionally, specify a `batchLabel` to group the account codes, for example by campaign. You can later delete every unredeemed account code in the batch at once with [Delete Account Codes By Batch Label](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-codes-by-batch-label.md).  An account can have up to 5,000,000 active account codes, meaning codes that haven't been redeemed and haven't expired. If generating the batch would exceed this limit, the call fails and no account codes are created.  To delete account codes you no longer want to be redeemable, call [Delete Account Code](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-code.md), [Bulk Delete Account Codes](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/bulk-delete-account-codes.md), or [Delete Account Codes By Batch Label](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-codes-by-batch-label.md).  The account the invite links are issued for is always the calling channel's own account, taken from the identity of the API key used to make the call. It's never taken from a value passed in the request.
 URL: https://www.wixapis.com/channels-eligibility/v1/channels-eligibility/account-codes/generate-invite-links
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  count
 Method parameters: 
   param name: batchLabel | type: batchLabel | description: Channel-defined label that groups the generated account codes into a batch, for example a campaign name. Use it later to delete every unredeemed code in the batch at once with [Delete Account Codes By Batch Label](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-codes-by-batch-label.md). Several calls can use the same batch label, for example to build a campaign of more than 5,000 codes.  The batch label is included in each generated invite code, and anyone who has the invite link can read it, so don't include sensitive information. An invite code is at most 99 characters, which leaves room for a batch label of up to 21 English letters, digits, or simple punctuation marks. Other characters take more room. If the batch label doesn't fit, the call fails with `BATCH_LABEL_TOO_LONG`.  | validation: maxLength 100
   param name: count | type: count | description: Number of invite links to generate. | required: true | validation: minimum 1, maximum 5000
   param name: expirationDurationInSeconds | type: expirationDurationInSeconds | description: Number of seconds the generated account codes stay redeemable. For example, `2592000` for 30 days. If not specified, the account codes never expire: they stay redeemable until they're redeemed or deleted. An account code that expires stays redeemable until the end of its expiration day, in UTC.  Min: `60` (1 minute) Max: `157680000` (5 years)  | validation: minimum 60, maximum 157680000, format int32
 Return type: GenerateAccountInviteLinksResponse
  - name: inviteLinks | type: array<string> | description: Generated sign-in invite links, one for each account code that was created. For example, `https://users.wix.com/signin?organizationId=<accountId>&organizationInviteCode=<code>`. Send each link to a user without modifying it.  May contain fewer links than the requested `count` if some account codes couldn't be created. If none of the account codes could be created, the call fails.  | validation: maxItems 5000, maxLength 2200
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Bulk action metadata. `totalSuccesses` equals the number of links in `inviteLinks`, and `totalFailures` is the number of requested account codes that couldn't be created.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  | validation: minimum 0
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  | validation: minimum 0
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  | validation: minimum 0

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: BATCH_LABEL_TOO_LONG | Description: `batchLabel` is too long to fit in an invite code. Specify a shorter batch label.
   HTTP Code: 401 | Status Code: UNAUTHENTICATED | Application Code: MISSING_IDENTITY | Description: Couldn't identify the calling account. Call this method with an account-level API key.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ACCOUNT_ACTIVE_CODE_LIMIT_EXCEEDED | Description: Generating this batch would exceed the account's limit of 5,000,000 active account codes. Delete unredeemed codes or wait for codes to expire, or specify a smaller `count`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORGANIZATION_NOT_ELIGIBLE | Description: Your account isn't set up by Wix as a Channel organization account. Contact your Wix partner manager to get set up.


```

### Examples

### Generate account invite links
```curl
curl -X POST \
'https://www.wixapis.com/channels-eligibility/v1/channels-eligibility/account-codes/generate-invite-links' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "count": 2,
  "expirationDurationInSeconds": 604800,
  "batchLabel": "spring-campaign-2026"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.channels.accountCodes.generateAccountInviteLinks(count, options)
 Description: Generates sign-in invite links that link your users' Wix accounts to your account.   Each invite link is a full sign-in URL that contains a one-time-use account code. For example, `https://users.wix.com/signin?organizationId=<accountId>&organizationInviteCode=<code>`. When a user opens the link and signs up or logs in to Wix, their account is linked to your account as a sub-account. Links in the same batch differ only by the value of the `organizationInviteCode` query parameter.  Your account must be set up by Wix as a Channel organization account. Otherwise, the call fails with `ORGANIZATION_NOT_ELIGIBLE`.  By default, the account codes never expire: they stay redeemable until they're redeemed or deleted. To have them expire, specify a lifetime of up to 5 years in `expirationDurationInSeconds`.  Optionally, specify a `batchLabel` to group the account codes, for example by campaign. You can later delete every unredeemed account code in the batch at once with [Delete Account Codes By Batch Label](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-codes-by-batch-label.md).  An account can have up to 5,000,000 active account codes, meaning codes that haven't been redeemed and haven't expired. If generating the batch would exceed this limit, the call fails and no account codes are created.  To delete account codes you no longer want to be redeemable, call [Delete Account Code](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-code.md), [Bulk Delete Account Codes](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/bulk-delete-account-codes.md), or [Delete Account Codes By Batch Label](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-codes-by-batch-label.md).  The account the invite links are issued for is always the calling channel's own account, taken from the identity of the API key used to make the call. It's never taken from a value passed in the request.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  count
 Method parameters: 
   param name: count | type: integer | description: Number of invite links to generate. | required: true | validation: minimum 1, maximum 5000
   param name: options | type: GenerateAccountInviteLinksOptions  none  
        - name: expirationDurationInSeconds | type: integer | description: Number of seconds the generated account codes stay redeemable. For example, `2592000` for 30 days. If not specified, the account codes never expire: they stay redeemable until they're redeemed or deleted. An account code that expires stays redeemable until the end of its expiration day, in UTC.  Min: `60` (1 minute) Max: `157680000` (5 years)  | validation: minimum 60, maximum 157680000, format int32
        - name: batchLabel | type: string | description: Channel-defined label that groups the generated account codes into a batch, for example a campaign name. Use it later to delete every unredeemed code in the batch at once with [Delete Account Codes By Batch Label](https://dev.wix.com/docs/api-reference/account-level/channels/eligibility/account-code-v1/delete-account-codes-by-batch-label.md). Several calls can use the same batch label, for example to build a campaign of more than 5,000 codes.  The batch label is included in each generated invite code, and anyone who has the invite link can read it, so don't include sensitive information. An invite code is at most 99 characters, which leaves room for a batch label of up to 21 English letters, digits, or simple punctuation marks. Other characters take more room. If the batch label doesn't fit, the call fails with `BATCH_LABEL_TOO_LONG`.  | validation: maxLength 100
 Return type: PROMISE<GenerateAccountInviteLinksResponse>
  - name: inviteLinks | type: array<string> | description: Generated sign-in invite links, one for each account code that was created. For example, `https://users.wix.com/signin?organizationId=<accountId>&organizationInviteCode=<code>`. Send each link to a user without modifying it.  May contain fewer links than the requested `count` if some account codes couldn't be created. If none of the account codes could be created, the call fails.  | validation: maxItems 5000, maxLength 2200
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Bulk action metadata. `totalSuccesses` equals the number of links in `inviteLinks`, and `totalFailures` is the number of requested account codes that couldn't be created.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  | validation: minimum 0
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  | validation: minimum 0
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  | validation: minimum 0

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: BATCH_LABEL_TOO_LONG | Description: `batchLabel` is too long to fit in an invite code. Specify a shorter batch label.
   HTTP Code: 401 | Status Code: UNAUTHENTICATED | Application Code: MISSING_IDENTITY | Description: Couldn't identify the calling account. Call this method with an account-level API key.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ACCOUNT_ACTIVE_CODE_LIMIT_EXCEEDED | Description: Generating this batch would exceed the account's limit of 5,000,000 active account codes. Delete unredeemed codes or wait for codes to expire, or specify a smaller `count`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORGANIZATION_NOT_ELIGIBLE | Description: Your account isn't set up by Wix as a Channel organization account. Contact your Wix partner manager to get set up.


```

### Examples

### Generate account invite links
```javascript
import { accountCodes } from "@wix/channels";

async function generateAccountInviteLinks() {
  const response = await accountCodes.generateAccountInviteLinks(
    2,
    { expirationDurationInSeconds: 604800, batchLabel: "spring-campaign-2026" },
  );
}

/* Promise resolves to:
 * {
 *   "inviteLinks": [
 *     "https://users.wix.com/signin?organizationId=6b1f9e6a-3c2d-4f0e-9a1b-7e5d2c8f4a6b&organizationInviteCode=eyJsIjoic3ByaW5nLWNhbXBhaWduLTIwMjYiLCJlIjoyMDU4MH0.C1Sxwn0-T2qcHS6PWns8TQ.rCNqC_Ez3raSNxSl46l-cQ",
 *     "https://users.wix.com/signin?organizationId=6b1f9e6a-3c2d-4f0e-9a1b-7e5d2c8f4a6b&organizationInviteCode=eyJsIjoic3ByaW5nLWNhbXBhaWduLTIwMjYiLCJlIjoyMDU4MH0.x6keNUjSSw-m45Hw0sS4pw.4SlAWxXGSnzikOa-jKXPww"
 *   ],
 *   "bulkActionMetadata": {
 *     "totalSuccesses": 2,
 *     "totalFailures": 0,
 *     "undetailedFailures": 0
 *   }
 * }
 */

```

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

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


async function generateAccountInviteLinks(count,options) {
  const response = await myWixClient.accountCodes.generateAccountInviteLinks(count,options);
};
```

---