Skip to content

Data Removal

Igor Balos edited this page Oct 9, 2023 · 4 revisions

For these API requests you will need to use a account API token. Once you obtain it, you will need to use account API client.

AccountApiClient client = Postmark.getAccountApiClient(<account token>);

Create a Data removal request

DataRemoval dataRemoval = new DataRemoval("[email protected]", "[email protected]", false);
DataRemovalStatus dataRemovalStatus = accountClient.requestDataRemoval(dataRemoval);
System.out.println(dataRemovalStatus.getStatus());
System.out.println(dataRemovalStatus.getId());

Retrieve data removal status

DataRemovalStatus dataRemovalStatus = accountClient.getDataRemovalStatus(1);
System.out.println(dataRemovalStatus.getStatus());
System.out.println(dataRemovalStatus.getId());