Creates or 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 to create or update.
Newly created or updated marketing consent.
Marketing consent confirmation or cancelation link.
curl -X POST \
https://www.wixapis.com/marketing-consent/v1/marketing-consent/upsert \
-H 'Authorization: <AUTH>'
-d '{
"details": {
"type": "EMAIL",
"email": "test@test.com"
},
"state": "PENDING",
"lastConfirmationActivity": {
"source": "IN_PERSON",
"description": "Person filled a printed document.",
"updated_date": "2023-05-01T00:00:00Z",
"optInLevel": "DOUBLE_CONFIRMATION"
}
}'
{
"marketingConsent": {
"id": "aa8a62f5-9a79-4b21-b1a4-5c835c08d937",
"revision": "3",
"details": {
"type": "EMAIL",
"email": "test@test.com"
},
"state": "PENDING",
"lastConfirmationActivity": {
"source": "IN_PERSON",
"description": "Person filled a printed document.",
"updated_date": "2023-05-01T00:00:00Z",
"optInLevel": "DOUBLE_CONFIRMATION"
},
"extendedFields": {},
"created_date": "2022-11-16T14:07:50.150Z",
"updated_date": "2022-11-16T14:07:50.150Z"
},
"link": {
"type": "CONFIRMATION",
"url": "https://some-domain/_manage-consent/subscribe?token=JWE.eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiZkhJbFA4M1cifQ.l0rBPnrV81dCCO2SWFce15SwFhMWpa-ts2z9aeC4BB9Dh1Pveo2x9Q.q2FnvSlGJ6pEfDDsvo1U0A.BTTYsIwIn59_vW6N7oicfB2LoQHkP8Hqrzs2pM4DYYIp3c7cIUrFEv1e3kxBvab3a17nhypf9xVEDTwT-ZfWzLhdlvodtHGN4LW73azS98hhME5klJR6GgQEQrkJo9dumQNTN2WOswttB05IjoYIjHPQsrNSzY1-iWf36Qbxc1iCxhjlsG0NMjO76CgaLlr1DnMV4PF4J1CPupDr_1-n2oX4trQY0G0S7C7Jx8grZqIgKFM0p9oE0RLju2kCp-Ck0YTKB9KEqYt3CZkvygVqvA.TN0Ec9bGgivYSGJOVrLbeA"
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.