Skip to content
Docs menu

Guides

Features

API

Integrations

Erase a contact

Erases a contact when the person asks to be forgotten. It cannot be undone. Wakio keeps the opt-out, and a delivery history without the address or content. Marketing email to the address stops, except for a contact who never subscribed.

POST /v1/contacts/{id}/erase

Example

curl -X POST https://api.wakio.net/v1/contacts/con_7Hq2LpXz4VnBw8tRjG6sYe/erase \
  -H "Authorization: Bearer $WAKIO_API_KEY"

Response 204 with no body.

Parameters

NameTypeRequiredDescription
idstringYesIn the path: the contact's Wakio id, such as con_…, or your own external_id. Escape any / in an external_id as %2F.

Errors

Every error this endpoint itself returns is {"error": "<code>"}, sometimes with one more field that explains it. The API overview lists the responses that do not follow that shape.

StatusCodeWhat happenedWhat to do
401invalid_api_keyThe Authorization header is missing, malformed, or names no active key.Send Authorization: Bearer <key> with an active key from API keys in the dashboard.
403insufficient_scopeThe key does not carry the scope this endpoint needs. scope names it.Issue a key with Can manage contacts ticked under API keys, and use it for this call.
404contact_not_foundNo contact in your account has this id. A con_… id is only ever looked up as a Wakio id, never as an external_id.Check the id, or use the external_id you stored on the contact.

Notes

Use this when a person asks to be forgotten. Wakio deletes the contact and scrubs the address from your delivery history, but keeps the opt-out listed under What Wakio still holds, so do not tell them everything is gone. Answers 204 with no body. It cannot be undone. To stop marketing email for someone who only unticked a box or closed their account, use Unsubscribe a contact from everything and keep the contact.

In one step, Wakio:

  • stops all marketing email to the address and cancels any email still queued for it, including email you sent through the API;
  • deletes the contact, its custom field values, its list memberships, its flow enrollments and its consent record;
  • finds every delivery to the address, whether or not it was linked to the contact, and replaces the address with [email protected], deletes the name, subject, message bodies, merge data, metadata, reply-to, idempotency key and attachments, and empties the provider data stored with its events;
  • deletes your webhook events about the address, and import error rows that contain it;
  • writes an audit row with the contact's Wakio id, the API key and the time, and no address.

A contact who never subscribed is deleted without an opt-out, because they never agreed to anything. Sending that address to Add a contact again creates a new contact, so stop your sync for a person you erased.

What Wakio still holds about the address

Tell the person about these if they ask what is left:

  • the suppression list and brand withdrawals, kept to honor the opt-out, including any bounce or complaint on file. Wakio lifts one only on your written instruction, and once lifted nothing stops you mailing the address again;
  • each delivery's status, source and times, with no address or content, so your sending history still adds up;
  • the files you uploaded for imports, until 30 days after each import finishes;
  • for up to 24 hours, stored responses to requests that carried an Idempotency-Key.

A notice about one of these deliveries that arrives after the erase is stored without its contents. If it reports a hard bounce or a spam complaint, Wakio adds the address it names to your suppression list, so you cannot mail a dead or complaining address by adding it again. Nothing else changes, and opens and clicks on these messages are no longer recorded.

A 404 means no contact exists for that address or id. An address you only sent transactional mail to has no contact, but its deliveries still hold it: to erase it, add it with Add a contact, then erase that contact.

To stop marketing email and keep the contact and its history, use Unsubscribe a contact from everything.

This call needs a key with the Can manage contacts scope.