POST /contacts/v1/contacts/preferences

Overview 

Adds consent management information to contact records for data protection and privacy concerns. The request can include multiple contact IDs in a single JSON payload. For best performance, use batches of contact ID values whenever possible.

JSON Parameters 

NameTypeDescription
itemsarrayRequiredArray of contact IDs and other properties to add.
items.contactIDlongRequiredUnique ID for the contact.
items.hasOptedOutTrackingbooleanIndicates whether a contact opted out of tracking information.

Responses 

StatusNameTypeDescription
200  Added contact preferences.
 itemsarrayArray of contact IDs and other properties to add.
 items.contactIDlongUnique ID for the contact.
 items.hasOptedOutTrackingbooleanIndicates whether a contact opted out of tracking information.
 rowsInsertedintegerNumber of preferences inserted.
 rowsUpdatedintegerNumber of preferences updated.
 rowsDeletedintegerNumber of preferences deleted.
 requestServiceMessageIDguidService message ID for the request.
 responseDateTimeintegerDate and time of the retry response in UTC.
 resultMessagesarrayArray of messages about the request. Includes details, such as resulttype and resultcode, about a bad request.
 serviceMessageIDguidService message ID for the response.

Usage 

To issue a request, you must have these permissions.

  • Contacts | Read
  • Contacts | Write
  • Contacts | Access

Required Scope 

  • Documents and Images, Read and Write
  • Saved Content, Read and Write

Example Request 

1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2POST /contacts/v1/contacts/preferences
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7   "items":[
8      {
9         "contactID":45678,
10         "hasOptedOutTracking":false
11      },
12      {
13         "contactID":12345,
14         "hasOptedOutTracking":false
15      }
16   ]
17}

Example Response 

1HTTP/1.1 200 OK
2
3{
4   "items":[
5      {
6         "contactID":45678,
7         "hasOptedOutTracking":false
8      },
9      {
10         "contactID":12345,
11         "hasOptedOutTracking":false
12      }
13   ],
14   "rowsInserted":2,
15   "rowsUpdated":0,
16   "rowsDeleted":0,
17   "requestServiceMessageID":"4d08d1ff-1377-4f7b-9afe-937e3805c67f",
18   "responseDateTime":"2019-01-22T16:17:32.0041492-06:00",
19   "resultMessages":[
20
21   ],
22   "serviceMessageID":"47ec0720-81d1-4fee-8e03-d8a9d42af1c1"
23}

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!