Try our conversational search powered by Generative AI!

Philipp Gaska
Jul 8, 2021
(1 votes)

Right to be forgotten: Deleting recipient data

Data security and protecting the privacy of your customers and newsletter recipients is vital important. With the introduction of the General Data Protection Regulation (GDPR) at the latest, you must provide the possibility of deleting personal data upon request. This is embodied in Article 17 of the GDPR – the so-called "Right to be forgotten".

To irrevocably delete all recipient data from Episerver Campaign (except blocklist entries which is anonymized data), you can use the recipient history in the Episerver Campaign user interface.

A more flexible way is using the Episerver Campaign REST API. This lets you delete recipient data remotely – without logging in to Episerver Campaign. You can, for example, use the Swagger Try it out feature, enter the curl request in the Windows command prompt, or implement a deletion option right into your system, such as a CRM software.

To delete recipient data via REST API, use the DELETE /{clientId}​/recipients operation.

You need the following information:

  • Client ID. The ID of the client the REST API is set up for. You can find the client ID in Episerver Campaign under Administration > API Overview > REST API.
  • Reason. Reason for data deletion.
  • Recipient key. Recipient ID, usually the email address.

The request in curl looks as follows:

curl -X DELETE "" -H "Authorization: BASIC k783r3fjn989dhnfjjdr83dgds1383NDfv="

The following example shows the request as PHP code.

Note: The PHP code is a basic example and is not ready to use in your live system. Use it only as a template for testing and adapt the code to your company's internal requirements.
$user = ''; // API user name, usually your email address 
$password = 'password'; // password of your API user
$clientId = 123456789; // ID of the client the REST API is set up for
$recipientId = ''; // ID of the recipient whose data is to be deleted
$reason = 'customerrequest'; // reason for data deletion (without blanks)
$URL = ''.$clientId.'/recipients?recipientKey='.$recipientId.'&reason='.$reason;

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,$URL);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_USERPWD, "$user:$password");

$result = curl_exec ($curl);
$result = json_decode($result, true);
echo '<pre>';
var_dump ($result);
echo '</pre><br>';

curl_close ($curl);       

Tip: To delete the recipient's blocklist entry, you can use the DELETE​/{clientId}​/blacklistentries​/{entry} operation.
Jul 08, 2021


Please login to comment.
Latest blogs
From Procrastination to Proficiency: Navigating Your Journey to Web Experimentation Certification

Hey there, Optimizely enthusiasts!   Join me in celebrating a milestone – I'm officially a certified web experimentation expert! It's an exhilarati...

Silvio Pacitto | May 17, 2024

GPT-4o Now Available for Optimizely via the AI-Assistant plugin!

I am excited to announce that GPT-4o is now available for Optimizely users through the Epicweb AI-Assistant integration. This means you can leverag...

Luc Gosso (MVP) | May 17, 2024 | Syndicated blog

The downside of being too fast

Today when I was tracking down some changes, I came across this commit comment Who wrote this? Me, almost 5 years ago. I did have a chuckle in my...

Quan Mai | May 17, 2024 | Syndicated blog

Optimizely Forms: Safeguarding Your Data

With the rise of cyber threats and privacy concerns, safeguarding sensitive information has become a top priority for businesses across all...

K Khan | May 16, 2024