Go Headless

/

SDK
Articles
Get Started
Work with the SDK
Set up a Client
Use the Wix MCP
What's New

Core Modules
sdk
sdk-react (deprecated)
essentials
web-methods

Host Modules
About Host Modules
dashboard
dashboard-react (deprecated)
editor
site

Backend Modules
activity-counters
analytics
async-jobs
ai-site-chat
app-management
auth-management
automations
benefit-programs
billing
blog
bookings
business-tools
cache
calendar
captcha
categories
comments
consent-policy
crm
dashboard-management
data
data-extension-schemas
ecom
email-marketing
email-subscriptions
events
forms
forum
get-paid
groups
http-functions
identity
inbox
loyalty
marketing
marketing-consent
Introduction
Setup
bulkUpsertMarketingConsent()
createMarketingConsent()
deleteMarketingConsent()
getMarketingConsent()
getMarketingConsentByIdentifier()
queryMarketingConsent()
removeMarketingConsent()
updateMarketingConsent()
upsertMarketingConsent()
onMarketingConsentCreated()
onMarketingConsentDeleted()
onMarketingConsentUpdated()
MarketingConsentQueryBuilder
MarketingConsentQueryResult
marketing-tags
media
members
multilingual
notifications
payments
portfolio
pricing-plans
pro-gallery
redirects
reports
restaurants
reviews
secrets
stores
tags
urls
site-plugins
sender-details
sender-emails
realtime

Account Level Modules
About Account Level APIs
b2b-site-management
domains
resellers
user-management
sites

Frontend Modules
bookings
crm
ecom
events
location
members
mobile
navigate-mobile
pay
pricing-plans
seo
site
storage
stores
window
site-realtime

updateMarketingConsent( )


Updates a marketing consent. 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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Marketing Consents
Manage Stores
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Marketing consent ID.


optionsUpdateMarketingConsentOptions

Field options. The following fields must be passed: details.type, the relevant email OR phone, and state.

Returns
Return Type:Promise<MarketingConsent>
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?