Skip to content
Docs menu

Guides

Features

API

Integrations

Unsubscribe a contact from everything

Unsubscribes a contact from all your marketing email. The contact, its history and its consent record stay.

DELETE /v1/contacts/{id}

Example

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

Response 200:

{
  "id": "con_7Hq2LpXz4VnBw8tRjG6sYe",
  "external_id": "user_8812",
  "email": "[email protected]",
  "first_name": "Maya",
  "last_name": "Okafor",
  "source": "signup-form",
  "status": "unsubscribed",
  "fields": {
    "plan": "pro"
  },
  "lists": [
    {
      "id": "lst_5KfN9cDmA3xUvQ2yRhP8Zt",
      "status": "unsubscribed"
    }
  ],
  "suppression": {
    "reason": "unsubscribe",
    "scope": "marketing"
  }
}

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.

Response

NameTypeRequiredDescription
idstringYesThe contact's id, such as con_….
external_idstringYesYour own id for this person, or null when none is set.
emailstringYesThe contact's address.
first_namestringYesFirst name, or null.
last_namestringYesLast name, or null.
sourcestringYesThe free-text source label, or null.
statusstringYesOne of active, unsubscribed, unreachable, or never_subscribed. Only active contacts receive campaigns and flows.
fieldsobjectYesThe contact's custom field values, keyed by field key, such as { "plan": "pro" }. {} when none is set.
listsarrayYesOne { "id", "status" } for each list the contact is on or has left. Oldest list first.
lists[].idstringYesThe list's id, such as lst_….
lists[].statusstringYessubscribed or unsubscribed.
suppressionobject or nullYesWhy Wakio will not send marketing email to the address, as { "reason", "scope" }, or null when nothing blocks it.

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 the person unticks the newsletter box. It stops marketing email and keeps the contact. It does not erase anyone: for a person who asks to be forgotten, use Erase a contact. When someone closes their account, unsubscribe them from everything if you keep their data, and erase them if you delete it. The contact stays, with its history and its consent record, so you can still read it with Get a contact. Wakio records the withdrawal with the source api, cancels any campaign or flow email still queued for them, and stops all marketing email to the address. Transactional email, such as a password reset, still reaches them.

Calling it again changes nothing and answers 200 with the same contact. So does calling it for a contact who never subscribed: Wakio writes no opt-out for someone who never agreed to anything, so a later Add a contact with subscribed: true can still subscribe them. An unsubscribe sticks: Add a contact with subscribed: true leaves the contact unsubscribed, and only Resubscribe a contact can bring them back, through a confirmation the person clicks.

A 404 means no such contact exists, so there is nobody to stop mailing. A sync can treat it as done.

To leave only some lists, use Unsubscribe a contact.

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