> 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

# BulkCreateParticipantsForAllMembers

# Package: onlinePrograms

# Namespace: ParticipantsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/participants/bulk-create-participants-for-all-members.md

## Permission Scopes:
Manage Online Programs: SCOPE.CHALLENGES.MANAGE

## Introduction

Creates participants in bulk for all site members in a program, with an optional exclusion filter.

Participants are created in the `JOINED` state with the join path set to `ADDED`.
Members who are already participants in the program will be skipped.
Only members who are not yet participants will be added.

---

## REST API

### Schema

```
 Method: bulkCreateParticipantsForAllMembers
 Description: Creates participants in bulk for all site members in a program, with an optional exclusion filter.  Participants are created in the `JOINED` state with the join path set to `ADDED`. Members who are already participants in the program will be skipped. Only members who are not yet participants will be added.
 URL: https://www.wixapis.com/online-programs/v3/bulk/participants/create-for-all-members
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  programId
 Method parameters: 
   param name: excludeMemberIds | type: array<excludeMemberIds> | description: Site member GUIDs to exclude from bulk participant creation. Maximum 100 member GUIDs can be excluded.  | validation: minItems 0, maxItems 100, format GUID
   param name: programId | type: programId | description: GUID of the program for which to create participants for all site members in bulk. | required: true | validation: format GUID
 Return type: BulkCreateParticipantsForAllMembersResponse
  - name: jobId | type: string | description: Job GUID. Pass this GUID to [Get Async Job](https://dev.wix.com/docs/api-reference/business-management/async-job/get-async-job.md) to retrieve the status of the asynchronous operation.  | validation: format GUID


```

### Examples

### Bulk create participants for all members
Creates participants in bulk for all site members in a program, with exclusions

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/participants/v3/bulk/participants/create-for-all-members' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "programId": "5f2d6b0e-8f8f-4e6e-a1b1-6f6a8427c3d7",
  "excludeMemberIds": [
    "6c7c7b22-67a2-43c7-9d27-3b8ed07d9a45",
    "2a01d8c7-54e5-4f42-9c9f-7a5d4d2ec4f1"
  ]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.participants.bulkCreateParticipantsForAllMembers(programId, options)
 Description: Creates participants in bulk for all site members in a program, with an optional exclusion filter.  Participants are created in the `JOINED` state with the join path set to `ADDED`. Members who are already participants in the program will be skipped. Only members who are not yet participants will be added.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  programId
 Method parameters: 
   param name: options | type: BulkCreateParticipantsForAllMembersOptions  none  
        - name: excludeMemberIds | type: array<string> | description: Site member GUIDs to exclude from bulk participant creation. Maximum 100 member GUIDs can be excluded.  | validation: minItems 0, maxItems 100, format GUID
   param name: programId | type: string | description: GUID of the program for which to create participants for all site members in bulk. | required: true | validation: format GUID
 Return type: PROMISE<BulkCreateParticipantsForAllMembersResponse>
  - name: jobId | type: string | description: Job GUID. Pass this GUID to [Get Async Job](https://dev.wix.com/docs/api-reference/business-management/async-job/get-async-job.md) to retrieve the status of the asynchronous operation.  | validation: format GUID


```

### Examples

### Create participants for all members
Starts an asynchronous bulk enrollment for site members in a program.

```javascript
import { participants } from "@wix/online-programs";

async function bulkCreateParticipantsForAllMembers() {
  const response = await participants.bulkCreateParticipantsForAllMembers(
    "1a87c246-5c3a-4eea-a7c8-e5e2cf5d61c0",
    {
      excludeMemberIds: ["35a3edce-aed7-4b80-9fba-5ec3f2dff1b4"],
    },
  );

  return response;
}

/* Promise resolves to:
 * {
 *   "jobId": "bbdd6e3e-3148-4e41-9d7e-b4415902908a"
 * }
 */

```

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

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


async function bulkCreateParticipantsForAllMembers(programId,options) {
  const response = await myWixClient.participants.bulkCreateParticipantsForAllMembers(programId,options);
};
```

---