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.
You can only call this method when authenticated as a Wix app or Wix user identity.
Marketing consent ID.
Marketing consent to update.
Explicit list of fields to update
Updated marketing consent.
Marketing consent confirmation or cancelation link.
curl -X PATCH \
https://www.wixapis.com/marketing-consent/v1/marketing-consent/aa8a62f5-9a79-4b21-b1a4-5c835c08d937 \
-H 'Authorization: <AUTH>'
-d '{
"marketingConsent": {
"details": {
"type": "EMAIL",
"email": "mytest@test.com"
},
"state": "REVOKED",
"revision": 3,
"lastConfirmationActivity": {
"source": "IN_PERSON"
}
},
"mask": {
"paths": [
"state",
"lastConfirmationActivity.source"
]
}
}'
{
"marketingConsent": {
"id": "aa8a62f5-9a79-4b21-b1a4-5c835c08d937",
"revision": "3",
"details": {
"type": "EMAIL",
"email": "mytest@test.com"
},
"state": "REVOKED",
"lastConfirmationActivity": {
"source": "IN_PERSON",
"description": "person filled a printed document",
"updatedDate": "2023-01-01T00:00:00Z",
"optInLevel": "DOUBLE_CONFIRMATION"
},
"extendedFields": {},
"created_date": "2022-11-16T14:07:50.150Z",
"updated_date": "2022-11-16T14:07:50.150Z"
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.