# Update Communication Permissions v2.0Beta
The Update Communication Permissions endpoint updates the communication permissions for a customer profile. The updated permissions will reflect immediately in the preferences for the profile.
The endpoint allows the permissions to be set individually or in bulk. In other words, only the permission that is to be updated can be supplied in the array. If a permission is not provided, it is effectively ignored and therefore not updated. Alternatively, all the permissions can be provided in the array.
Due to the list of permissions being dynamic, the list of permissions that may be updated must be retrieved from the Get Communication Preferences endpoint.
# Request
# Authorization
An OAuth 2.0 Bearer token with the Profile.Write
scope is required. For more information, see Authentication.
# Path Parameters
A list of the supported path parameters is described below.
Name | Required | Type | Description |
---|---|---|---|
profileKey | true | string | The profile key for the customer. This value can be retrieved from the profileKey claim in the token returned from our SSO solution. |
# Request Body
The request body must contain an UpdateCommunicationPermissions object which is described below. Valid values for the permissions array must be taken from the Get Communication Preferences endpoint.
# UpdateCommunicationPermissions
Name | Required | Type | Description |
---|---|---|---|
permissions | true | UpdatePermission[] | The list of permissions to update. Valid values for the array must be taken from the Get Communication Preferences endpoint. If a permission from the GET request is not provided, it is ignored and not updated. |
# UpdatePermission
Name | Required | Type | Description |
---|---|---|---|
communicationType | true | string(50) | The communication type to set the permission for. |
communicationName | true | string(100) | The communication name to set the permission for. |
enabled | true | boolean | If the permission should be enabled for the customer or not. |
# Sample
{
"permissions": [
{
"communicationType": "MarketingPermission",
"communicationName": "AllowMarketingEMAIL",
"enabled": false
},
{
"communicationType": "MarketingPermission",
"communicationName": "AllowMarketingSMS",
"enabled": true
},
{
"communicationType": "Subscription",
"communicationName": "Newsletter",
"enabled": false
}
]
}
# Response
# Response Body
The endpoint returns our ApiResponse envelope.
# Sample
{
"message": "The operation succeeded!",
"notifications": [
{
"severity": "Success",
"text": "The communication permissions have been updated.",
"code": null,
"additionalData": null
}
]
}
# Errors
The standard error responses apply.