Request data removal (GDPR)

Erase a recipient’s personal data across your account — GDPR right to erasure via one API call.

When a data subject asks you to erase their data, one call handles the wemail side. The erasure runs as a background job and is irreversible and audit-logged. It requires a full_access key.

POST /v3/data-removals

Body parameters

ParameterTypeRequiredDescription
emailstringRequiredThe data subject’s address (lowercased before matching).
notify_webhook_urlstringOptionalOptional URL we POST { removal_id, status, completed_at } to when the erasure finishes (best-effort — polling is the source of truth).

What gets erased

Scope of erasure
ParameterTypeRequiredDescription
MessagesredactedOptionalEvery message addressed to the person: their address is replaced in to/cc/bcc/reply-to, and subject, HTML/text bodies, template variables, custom headers and metadata are cleared.
EventsanonymisedOptionalDelivery/open/click event rows keep their type and timestamp (your analytics counts stay truthful) but the recipient is redacted and metadata cleared.
Verification resultsdeletedOptionalEmail-verification rows for the address are deleted, cached verdicts invalidated, and the address is redacted from stored job sources.
Download logsclearedOptionalHosted-upload download attribution for the recipient is cleared.

Responses

StatusDescription
202{ removal_id, status: "pending" } — poll GET /v3/data-removals/{id}.
403Key scope does not allow mutations (full_access required).
429Rate limit exceeded (10 calls/minute).

Code examples

cURL
curl -X POST https://api.wemail.io/v3/data-removals \
  -H "Authorization: Bearer afn_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "email": "person@example.com" }'
Node.js
const res = await fetch("https://api.wemail.io/v3/data-removals", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ "email": "person@example.com" }),
});
const data = await res.json();
Python
import os, requests

r = requests.post(
    "https://api.wemail.io/v3/data-removals",
    headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
    json={ "email": "person@example.com" },
)
data = r.json()