> 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

# BulkUpdateContactSubscriptions

# Package: contacts

# Namespace: ContactSubscriptions

# Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts-v5/bulk-update-contact-subscriptions.md

## Permission Scopes:
Manage Stores: SCOPE.STORES.MANAGE-STORES

## Introduction

Updates the email and SMS marketing subscription statuses of multiple contacts that match the provided filter. Works asynchronously.

If a requested subscription status matches a contact's current status, that contact is left unchanged. Provide at least one of `emailSubscriptionStatus` or `phoneSubscriptionStatus`.

To check the status of the bulk update, pass the returned `jobId` to [Get Async Job](https://dev.wix.com/docs/api-reference/business-management/async-job/get-async-job.md).

---

## REST API

### Schema

```
 Method: bulkUpdateContactSubscriptions
 Description: Updates the email and SMS marketing subscription statuses of multiple contacts that match the provided filter. Works asynchronously.  If a requested subscription status matches a contact's current status, that contact is left unchanged. Provide at least one of `emailSubscriptionStatus` or `phoneSubscriptionStatus`.  To check the status of the bulk update, pass the returned `jobId` to [Get Async Job](https://dev.wix.com/docs/api-reference/business-management/async-job/get-async-job.md).
 URL: https://www.wixapis.com/contacts/v5/bulk/contacts/subscriptions/update
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  filter
 Method parameters: 
   param name: emailSubscriptionStatus | type: SubscriptionStatus    
      - enum:
           NOT_SET - No subscription status has been reported yet.
           SUBSCRIBED - Opted in to receive marketing messages.
           UNSUBSCRIBED - Opted out of receiving marketing messages.
   param name: filter | type: filter | description: A filter for the contacts that the subscription statuses will be applied to.  Example: `{ "filter": { "name.last": "Smith" } }` | required: true 
   param name: phoneSubscriptionStatus | type: SubscriptionStatus    
      - enum:
           NOT_SET - No subscription status has been reported yet.
           SUBSCRIBED - Opted in to receive marketing messages.
           UNSUBSCRIBED - Opted out of receiving marketing messages.
   param name: search | type: SearchDetails    
        - name: mode | type: Mode | description: How separate search terms in `expression` are combined.  
             - enum:
             -     OR: Any of the search terms must be present.
             -     AND: All search terms must be present.
        - name: expression | type: string | description: Search term or expression.  | validation: maxLength 100
        - name: fields | type: array<string> | description: Fields to search in. If empty, searches all searchable fields. Use dot notation to specify the JSON path.  | validation: maxItems 20, maxLength 200
        - name: fuzzy | type: boolean | description: Whether to use fuzzy search, which allows typos using a managed proximity algorithm.  
 Return type: BulkUpdateContactSubscriptionsResponse
  - 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

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MISSING_SUBSCRIPTION_STATUS | Description: At least one of the subscription statuses must be requested.


```

### Examples

### Update contact subscriptions by filter
Asynchronously updates email and phone subscription statuses for all contacts matching a filter. Returns a job ID to poll for status.

```curl
curl -X POST \
'https://www.wixapis.com/contacts/v5/bulk/contacts/subscriptions/update' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "filter": {
    "company.name": "ExampleCo"
  },
  "emailSubscriptionStatus": "SUBSCRIBED"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.crm.contactsV5.bulkUpdateContactSubscriptions(filter, options)
 Description: Updates the email and SMS marketing subscription statuses of multiple contacts that match the provided filter. Works asynchronously.  If a requested subscription status matches a contact's current status, that contact is left unchanged. Provide at least one of `emailSubscriptionStatus` or `phoneSubscriptionStatus`.  To check the status of the bulk update, pass the returned `jobId` to [Get Async Job](https://dev.wix.com/docs/api-reference/business-management/async-job/get-async-job.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  filter
 Method parameters: 
   param name: filter | type: object | description: A filter for the contacts that the subscription statuses will be applied to.  Example: `{ "filter": { "name.last": "Smith" } }` | required: true 
   param name: options | type: BulkUpdateContactSubscriptionsOptions  none  
        - name: search | type: SearchDetails | description: Free text to match in searchable fields for the contacts that the subscription statuses will be applied to.  
           - name: mode | type: Mode | description: How separate search terms in `expression` are combined.  
                 - enum:
                 -     OR: Any of the search terms must be present.
                 -     AND: All search terms must be present.
           - name: expression | type: string | description: Search term or expression.  | validation: maxLength 100
           - name: fields | type: array<string> | description: Fields to search in. If empty, searches all searchable fields. Use dot notation to specify the JSON path.  | validation: maxItems 20, maxLength 200
           - name: fuzzy | type: boolean | description: Whether to use fuzzy search, which allows typos using a managed proximity algorithm.  
        - name: emailSubscriptionStatus | type: SubscriptionStatus | description: The subscription status to apply to the contact's email address.  
             - enum:
             -     NOT_SET: No subscription status has been reported yet.
             -     SUBSCRIBED: Opted in to receive marketing messages.
             -     UNSUBSCRIBED: Opted out of receiving marketing messages.
        - name: phoneSubscriptionStatus | type: SubscriptionStatus | description: The subscription status to apply to the contact's phone.  
 Return type: PROMISE<BulkUpdateContactSubscriptionsResponse>
  - 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

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MISSING_SUBSCRIPTION_STATUS | Description: At least one of the subscription statuses must be requested.


```

### Examples

### bulkUpdateContactSubscriptions
```javascript
import { contactsV5 } from '@wix/crm';

async function bulkUpdateContactSubscriptions(filter,options) {
  const response = await contactsV5.bulkUpdateContactSubscriptions(filter,options);
};
```

### bulkUpdateContactSubscriptions (with elevated permissions)
```javascript
import { contactsV5 } from '@wix/crm';
import { auth } from '@wix/essentials';

async function myBulkUpdateContactSubscriptionsMethod(filter,options) {
  const elevatedBulkUpdateContactSubscriptions = auth.elevate(contactsV5.bulkUpdateContactSubscriptions);
  const response = await elevatedBulkUpdateContactSubscriptions(filter,options);
}
```

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

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


async function bulkUpdateContactSubscriptions(filter,options) {
  const response = await myWixClient.contactsV5.bulkUpdateContactSubscriptions(filter,options);
};
```

---