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.
You can only call this method when authenticated as a Wix app or Wix user identity.
List of marketing consent information to update or create.
List of created or updated marketing consents.
Numbers of successful and failed actions.
curl -X POST \
https://www.wixapis.com/marketing-consent/v1/bulk/marketing-consent/upsert \
-H 'Authorization: <AUTH>'
-d '{
"info" : [
{
"details": {
"type": "EMAIL",
"email": "test1@test.com"
},
"state": "PENDING",
"lastConfirmationActivity": {
"source": "IN_PERSON",
"description": "Person filed a printed document.",
"updatedDate": "2023-01-01T00:00:00Z",
"optInLevel": "DOUBLE_CONFIRMATION"
}
},
{
"details": {
"type": "EMAIL",
"email": "test2@test.com"
},
"state": "CONFIRMED",
"lastConfirmationActivity": {
"source": "LINK_CONFIRMATION",
"description": "Person clicked a link.",
"updatedDate": "2023-01-03T00:00:00Z",
"optInLevel": "SINGLE_CONFIRMATION"
}
}
]
}'
{
"results": [
{
"originalIndex": 0,
"marketingConsent": {
"id": "f5d258dd-64e9-49f6-b8af-2b5b616ddb22",
"details": {
"type": "EMAIL",
"email": "test1@test.com"
},
"state": "PENDING",
"lastConfirmationActivity": {
"source": "IN_PERSON",
"description": "Person filed 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"
},
"link": {
"type": "CONFIRMATION",
"url": "https://rebeccask.wixsite.com/testing-test-sites/_manage-consent/subscribe?token=JWE.eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiZkhJbFA4M1cifQ.UmKgcTrpm13hqOqrrbKBC6sLTK7ZF694DN9ozHFFXhB9l_0TZBIOfw.7Qhmn9yQl99V0z8wzlMHGQ.dpcSFTlxBJeh52asYrarRcYL1KVkDRs8zUTT4jrC7gFhFIHn-S678kDO4FSSwM92Ncg7nrq-A9d5hWkdeg5EQTq4A3Ludxxt3YjQnfVOUWggYXvdsoWcSh6UNqt3FKoXtVDHBJQDRJun2LVJ_IDbBPo8O89Y0bJ72d5S2hlOCrul8bj72nYDY1Mcrc4gSabbM5cRVmJuVSJJwU2ProAwUlC4RCi9bvKM7ZnonbFSsqzO4pfoKOs6Rl0JDTIe-Z0r7vwkq1uhdN5DlQkDN9PD0g.VJAjLxKf0xcIpocwcjZXOA"
}
},
{
"originalIndex": 1,
"marketingConsent": {
"id": "a4f96b5b-1ab6-48e9-91d7-8317466fe801",
"details": {
"type": "EMAIL",
"email": "test2@test.com"
},
"state": "CONFIRMED",
"lastConfirmationActivity": {
"source": "LINK_CONFIRMATION",
"description": "Person clicked a link",
"updatedDate": "2023-01-03T00:00:00Z",
"optInLevel": "SINGLE_CONFIRMATION"
},
"extendedFields": {}
},
"link": {
"type": "REVOKE_CONFIRMATION",
"url": "https://rebeccask.wixsite.com/testing-test-sites/_manage-consent/unsubscribe?token=JWE.eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiZkhJbFA4M1cifQ.2Rrc2yCSu8hAtQ2R-QVqOowE6VaJ4Tz2CrF9yYahoGylKQhiaxkB9g.t31uuAdT2d__GZ5RhltuwQ._MkLlPHPy05IwOgNFYgH5et8D_ujdheZUa9SLFnTxDfCFGSBXWaE4SxxKKx8hJAFf5qo8s5HnLUHUHCC_T0ve6k8xyzB86dUZTLTt_Y_20xY3Bolxh6e8DC1-0mYS6Ufs9FInvTt4nSP3FtMvItk9DPkOFOaFyHXObGqwW9lXpijCcvVXJemWzsiEwIknc291W8hUSwWnqlvPZG6i05Umq03Mwf8-7Wk0KdYRC5xcY7nzTZ0ax1SQ_zh2LcKTDC2RIKGAkx-m9fTBDAQwBfwfg.jXxMG8F5v3IgtokmQPKD_Q"
}
}
],
"metadata": {
"totalSuccess": 2,
"totalFailure": 0
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.