> 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 # BulkUpdateBranchTags # Package: branches # Namespace: BranchesService # Method link: https://dev.wix.com/docs/api-reference/business-management/branches/bulk-update-branch-tags.md ## Permission Scopes: Manage Site Branches: SCOPE.DC-DOCUMENT-MANAGEMENT.MANAGE-BRANCHES ## Introduction Updates tags on multiple branches. Specify which tags to assign and which tags to unassign. A tag that appears in both the list to assign and the list to unassign will be assigned. To update a single branch's tags, call [Update Branch](https://dev.wix.com/docs/api-reference/business-management/branches/update-branch.md). --- ## REST API ### Schema ``` Method: bulkUpdateBranchTags Description: Updates tags on multiple branches. Specify which tags to assign and which tags to unassign. A tag that appears in both the list to assign and the list to unassign will be assigned. To update a single branch's tags, call [Update Branch](https://dev.wix.com/docs/api-reference/business-management/branches/update-branch.md). URL: https://www.wixapis.com/editor/branches/v1/bulk/branches/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: branchIds Method parameters: param name: assignTags | type: PublicTags - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. - name: tagIds | type: array | description: List of tag GUIDs. param name: branchIds | type: array | description: IDs of the branches to update. | required: true param name: unassignTags | type: PublicTags - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. Return type: BulkUpdateBranchTagsResponse - name: results | type: array | description: Results of the bulk update operation. - name: itemMetadata | type: ItemMetadata | description: Metadata about the result for a specific branch, including whether the operation succeeded. - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible to provide. 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 succeeded for this item. When `false`, the `error` field provides failure details. - name: error | type: ApplicationError | description: Details about the error if the operation failed for this item. - 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 for the bulk operation, including counts of successes and failures. - 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 detailed error information because the detailed failure threshold was exceeded. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EMPTY_ASSIGN_AND_UNASSIGN_LISTS | Description: No tags were specified to assign or unassign. ``` ### Examples ### Bulk update branch tags ```curl curl -X POST \ 'https://www.wixapis.com/branches/v1/bulk/branches/update-tags' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ --data-raw '{ "branch_ids": [ "11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222" ], "assign_tags": { "tags": ["1234", "5678"] }, }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.branches.BranchesService.bulkUpdateBranchTags(branchIds, options) Description: Updates tags on multiple branches. Specify which tags to assign and which tags to unassign. A tag that appears in both the list to assign and the list to unassign will be assigned. To update a single branch's tags, call [Update Branch](https://dev.wix.com/docs/api-reference/business-management/branches/update-branch.md). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: branchIds Method parameters: param name: branchIds | type: array | description: IDs of the branches to update. | required: true param name: options | type: BulkUpdateBranchTagsOptions none - name: assignTags | type: PublicTags | description: Tags to assign to the branches. - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. - name: tagIds | type: array | description: List of tag GUIDs. - name: unassignTags | type: PublicTags | description: Tags to unassign from the branches. Return type: PROMISE - name: results | type: array | description: Results of the bulk update operation. - name: itemMetadata | type: ItemMetadata | description: Metadata about the result for a specific branch, including whether the operation succeeded. - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible to provide. 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 succeeded for this item. When `false`, the `error` field provides failure details. - name: error | type: ApplicationError | description: Details about the error if the operation failed for this item. - 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 for the bulk operation, including counts of successes and failures. - 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 detailed error information because the detailed failure threshold was exceeded. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EMPTY_ASSIGN_AND_UNASSIGN_LISTS | Description: No tags were specified to assign or unassign. ``` ### Examples ### bulkUpdateBranchTags ```javascript import { branches } from '@wix/editor-branches'; async function bulkUpdateBranchTags(branchIds,options) { const response = await branches.bulkUpdateBranchTags(branchIds,options); }; ``` ### bulkUpdateBranchTags (with elevated permissions) ```javascript import { branches } from '@wix/editor-branches'; import { auth } from '@wix/essentials'; async function myBulkUpdateBranchTagsMethod(branchIds,options) { const elevatedBulkUpdateBranchTags = auth.elevate(branches.bulkUpdateBranchTags); const response = await elevatedBulkUpdateBranchTags(branchIds,options); } ``` ### bulkUpdateBranchTags (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 { branches } from '@wix/editor-branches'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { branches }, // Include the auth strategy and host as relevant }); async function bulkUpdateBranchTags(branchIds,options) { const response = await myWixClient.branches.bulkUpdateBranchTags(branchIds,options); }; ``` ---