---
schema_version: "1"
id: e4068841f5bd2534632562f2d9bded23536b660f7c2f8b56544abd68dd2d81da
title: POST /contacts/v1/contacts/id:{contactId}/Preferences
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-apis/addContactPreferencesById.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/references/mc_rest_contacts/addContactPreferencesById.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5a2379a29f9252938b0f39fcc1b39f8e239b01c232fb9a9c7536bea9cace2e6c
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# POST /contacts/v1/contacts/id:{contactId}/Preferences

Adds consent management information to contact records by contact ID for data protection and privacy concerns.

## URL Parameters

| Name          | Type   |              | Description                |
| ------------- | ------ | ------------ | -------------------------- |
| **contactId** | string | **Required** | Unique ID for the contact. |

## JSON Parameters

| Name                          | Type    |              | Description                                                    |
| ----------------------------- | ------- | ------------ | -------------------------------------------------------------- |
| **value**                     | object  | **Required** | Array of contact IDs and other properties to add.              |
| **value.contactID**           | long    | **Required** | Unique ID for the contact.                                     |
| **value.hasOptedOutTracking** | boolean |              | Indicates whether a contact opted out of tracking information. |

## Responses

| Status  | Name                      | Type    | Description                                                                                                    |
| ------- | ------------------------- | ------- | -------------------------------------------------------------------------------------------------------------- |
| **200** | &nbsp;                    | &nbsp;  | **Added contact preferences by contact ID.**                                                                   |
| &nbsp;  | value                     | object  | Contains the contact ID and other properties to add.                                                           |
| &nbsp;  | value.contactID           | long    | Unique ID for the contact.                                                                                     |
| &nbsp;  | value.hasOptedOutTracking | boolean | Indicates whether a contact opted out of tracking information.                                                 |
| &nbsp;  | rowsInserted              | integer | Number of preferences inserted.                                                                                |
| &nbsp;  | rowsUpdated               | integer | Number of preferences updated.                                                                                 |
| &nbsp;  | rowsDeleted               | integer | Number of preferences deleted.                                                                                 |
| &nbsp;  | requestServiceMessageID   | guid    | Service message ID for the request.                                                                            |
| &nbsp;  | responseDateTime          | integer | Date and time of the retry response in UTC.                                                                    |
| &nbsp;  | resultMessages            | array   | Array of messages about the request. Includes details, such as resulttype and resultcode, about a bad request. |
| &nbsp;  | serviceMessageID          | guid    | Service message ID for the response.                                                                           |

## Usage

To issue a request, you must have the Assets | Upload and Assets | Publish permissions.

### Required Scope

- Documents and Images, Read and Write
- Saved Content, Read and Write

### Example Request

```js
Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
POST /contacts/v1/contacts/id:1234/Preferences
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN

{
   "value":{
      "contactID":1234,
      "hasOptedOutTracking":false
   }
}
```

### Example Response

```js
HTTP/1.1 200 OK
{
   "value":{
      "contactID":1234,
      "hasOptedOutTracking":false
   },
   "rowsInserted":1,
   "rowsUpdated":0,
   "rowsDeleted":0,
   "requestServiceMessageID":"1e17845f-d020-48a8-8621-c318c964b5a6",
   "responseDateTime":"2019-01-24T11:37:13.1845624-06:00",
   "resultMessages":[

   ],
   "serviceMessageID":"a5866bea-02a0-4989-bd1d-7edd4dd95519"
}
```
