> 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

# BulkUpdateParticipantTags

# Package: onlinePrograms

# Namespace: ParticipantsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/participants/bulk-update-participant-tags.md

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

## Introduction

Adds or removes tags on multiple participants.

Specify which tags to assign and which tags to unassign. At least one of `assignTags` or `unassignTags` must be provided.

---

## REST API

### Schema

```
 Method: bulkUpdateParticipantTags
 Description: Adds or removes tags on multiple participants.  Specify which tags to assign and which tags to unassign. At least one of `assignTags` or `unassignTags` must be provided.
 URL: https://www.wixapis.com/online-programs/v3/bulk/participants/update-tags
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  participantIds
 Method parameters: 
   param name: assignTags | type: Tags | description: Common object for tags. Should be use as in this example: message Foo { option (.wix.api.decomposite_of) = "wix.commons.v2.tags.Foo"; string id = 1; ... Tags tags = 5 }  example of taggable entity { id: "123" tags: { public_tags: { tag_ids:["11","22"] }, private_tags: { tag_ids: ["33", "44"] } } }  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, typically restricted from site members and visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  
   param name: participantIds | type: array<participantIds> | description: IDs of the participants to update tags for. Provide 1 to 100 GUIDs. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: unassignTags | type: Tags | description: Common object for tags. Should be use as in this example: message Foo { option (.wix.api.decomposite_of) = "wix.commons.v2.tags.Foo"; string id = 1; ... Tags tags = 5 }  example of taggable entity { id: "123" tags: { public_tags: { tag_ids:["11","22"] }, private_tags: { tag_ids: ["33", "44"] } } }  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, typically restricted from site members and visitors.  
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  
 Return type: BulkUpdateParticipantTagsResponse
  - name: results | type: array<BulkUpdateParticipantTagsResult> | description: Results for each participant.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata for this specific item.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata about the bulk operation.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EMPTY_ASSIGN_AND_UNASSIGN_LISTS | Description: none


```

### Examples

### Update tags for multiple participants
Adds a public tag to multiple participants.

```curl
curl -X POST \
'https://www.wixapis.com/online-programs/participants/v3/bulk/participants/update-tags' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "participantIds": [
    "f5b74327-4e94-4d42-a214-03e7f1f805ef"
  ],
  "assignTags": {
    "publicTags": {
      "tagIds": [
        "dUgLV"
      ]
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.onlinePrograms.participants.bulkUpdateParticipantTags(participantIds, options)
 Description: Adds or removes tags on multiple participants.  Specify which tags to assign and which tags to unassign. At least one of `assignTags` or `unassignTags` must be provided.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  participantIds
 Method parameters: 
   param name: options | type: BulkUpdateParticipantTagsOptions  none  
        - name: assignTags | type: Tags | description: Tags to assign to the participants.  
           - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, typically restricted from site members and visitors.  
              - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
           - name: publicTags | type: TagList | description: Tags that are exposed to anyone with access to the entity, including site members and visitors.  
        - name: unassignTags | type: Tags | description: Tags to unassign from the participants.  
   param name: participantIds | type: array<array> | description: IDs of the participants to update tags for. Provide 1 to 100 GUIDs. | required: true | validation: minItems 1, maxItems 100, format GUID
 Return type: PROMISE<BulkUpdateParticipantTagsResponse>
  - name: results | type: array<BulkUpdateParticipantTagsResult> | description: Results for each participant.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata for this specific item.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata about the bulk operation.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EMPTY_ASSIGN_AND_UNASSIGN_LISTS | Description: none


```

### Examples

### Update participant tags in bulk
Assigns a public tag to specified participants.

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

async function bulkUpdateParticipantTags() {
  const response = await participants.bulkUpdateParticipantTags(
    ["43db0e8d-4392-42d8-b3a6-56d412eb71e0"],
    {
      assignTags: {
        publicTags: {
          tagIds: ["a1B2c"],
        },
      },
    },
  );

  return response;
}

/* Promise resolves to:
 * {
 *   "results": [
 *     {
 *       "itemMetadata": {
 *         "_id": "43db0e8d-4392-42d8-b3a6-56d412eb71e0",
 *         "originalIndex": 0,
 *         "success": true
 *       }
 *     }
 *   ],
 *   "bulkActionMetadata": {
 *     "totalSuccesses": 1,
 *     "totalFailures": 0,
 *     "undetailedFailures": 0
 *   }
 * }
 */

```

### bulkUpdateParticipantTags (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 bulkUpdateParticipantTags(participantIds,options) {
  const response = await myWixClient.participants.bulkUpdateParticipantTags(participantIds,options);
};
```

---