> 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 # Method name: bulkUpsertMarketingConsent(info: Array) # Method package: wixMarketingV2 # Method menu location: wixMarketingV2 --> marketingConsent --> bulkUpsertMarketingConsent # Method Link: https://dev.wix.com/docs/velo/apis/wix-marketing-v2/marketing-consent/bulk-upsert-marketing-consent.md # Method Description: Creates or updates multiple marketing consents. Required fields: - `details.type`. - `details.email` OR `details.phone`. - `state`. When a marketing consent's `state` is `PENDING` or `CONFIRMED`, the `info.lastConfirmationActivity` field is required. When a marketing consent's `state` is `REVOKED`, the `info.lastRevokeActivity` field is required. >**Note:** For existing marketing consents with `{"type": "EMAIL"}`, you can't update the `state` to `UNKNOWN_STATE`. Trying to do so maintains the current state. However, you can create a new marketing consent and set the `state` to `UNKNOWN_STATE`. Note that you can't create more than a single consent per email or phone number. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## bulkUpsertMarketingConsent example for dashboard page code ```javascript import { marketingConsent } from 'wix-marketing.v2'; async function bulkUpsertMarketingConsent(info) { try { const result = await marketingConsent.bulkUpsertMarketingConsent(info); return result; } catch (error) { console.error(error); // Handle the error } } ``` ## bulkUpsertMarketingConsent example for exporting from backend code ```javascript import { marketingConsent } from 'wix-marketing.v2'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; const elevatedBulkUpsertMarketingConsent = elevate(marketingConsent.bulkUpsertMarketingConsent); export const bulkUpsertMarketingConsent = webMethod( Permissions.Anyone, async (info) => { try { const result = await elevatedBulkUpsertMarketingConsent(info); return result; } catch (error) { console.error(error); // Handle the error } } ); ``` ---