The Delete Subscription commands allow you to permanently delete an existing Subscription to a List. Subscription deletion is not the same as a Contact initiated unsubscribe or opt out request and does not result in a tracking event. It also does not support Force Opt Out, which would prevent future subscriptions.
DELETE /subscriptions
https://[siteurl]/rest/subscriptions
Request Body Parameters
The Delete Subscription by Contact command requires the Contact ID and List ID defined within the submitted JSON in order to delete. No additional fields are required in the JSON. Delete cannot be undone.
Request Body Example
Using Delete Subscription, line breaks in JSON for readability:
curl --request DELETE \
--url 'https://mail.mydomain.com/rest/subscriptions' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--data '{
"subscriberId": 7160984,
"listId": 5 }' \
--include
Response Body
The response returns an HTTP status code only with no additional JSON. Based on the example above, the response returns:
HTTP/1.1 204 NO CONTENT
Server: serverName
Content-Type: application/json
Content-Length: 6
Link: <https://mail.mydomain.com/rest/subscriptions>;
Date: Fri, 17 Jun 2016 12:54:44 GMT
{
}
Error Response
Error Response Codes include both Client Errors (4xx) and Server Errors (5xx). Descriptions of each can be found in Response Codes.
For example, if the List does not exist, the error would appear as:
{
"error": "Delete Failed: Unable to find resource to delete"
"status": "Not Found"
"statusCode": 404
}