Subscribersrequires confirm HTTP API
DELETE/api/v1/projects/{project_id}/subscribers/{subscriber_id}
erase_subscriber
Erases a subscriber for good, on the person’s request to delete their data: its row (address, attributes, status) is deleted, and in its events and the address’s suppression events the address is replaced by an erased:<hash> marker, in the background; subscriber.erased records it. The address’s suppressions stay, so it gets no mail it opted out of if it is added again.
- Call it
- only when the data must go; to stop mail, unsubscribe instead.
- Needs
- an admin key with
project_id, or a project key with scopewrite(its own project; the argument is ignored), the subscriber’s id, andconfirm: true; without it the call changes nothing and tells what it would erase. - Returns
outcome(would_erase,erased),effectin words and the subscriber asget_subscriberreturns it after the call (nullonce erased; a second call isnot_found); the API’sDELETE /api/v1/projects/{project_id}/subscribers/{subscriber_id}answers 204.
Arguments
- object
-
subscriber_idstring · uuidrequiredThe subscriber’s id.
-
confirmbooleantrueerases the subscriber. Without it the call only tells what would be erased and changes nothing.default
false -
project_idstring · uuid | nullThe subscriber’s project. An admin key must pass it; a project key’s own project is used and this is ignored.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
effectstringWhat is or would be erased, in words, for the agent and its user.
-
outcomeErasureOutcomeOutputWhat
erase_subscriberdid or, withoutconfirm: true, would do.would_eraseA dry run: nothing changed; a call withconfirm: trueerases.erasedErased now. An erased subscriber is gone: a second call isnot_found. -
subscriberSubscriber | nullThe subscriber as it is now;
nullonce erased.12 fields
- Subscriber object · all fields required
-
attributesmap of string → string | number | booleanThe subscriber’s attributes: a map of string, number or boolean values.
-
confirmed_atstring · date-time | nullWhen the subscriber confirmed a double opt-in;
nullotherwise. -
created_atstring · date-time -
emailstring · email -
idstring · uuid -
list_idstring · uuidThe list the subscriber is on.
-
project_idstring · uuidThe subscriber’s project.
-
soft_bounce_streakinteger · uint32Soft bounces in a row; reset by a delivery (P4+).
≥ 0
-
sourcestringHow the subscriber was added:
api,importorconfirm. -
statusstringpending,active,unsubscribed,bouncedorcomplained. -
unsubscribed_atstring · date-time | nullWhen the subscriber unsubscribed;
nullotherwise. -
updated_atstring · date-timeThe latest change: creation, an attribute merge.
Definitions
ErasureOutcomeOutput
What erase_subscriber did or, without confirm: true, would do.
string · enum
would_erase A dry run: nothing changed; a call with confirm: true erases.
erased Erased now. An erased subscriber is gone: a second call is
not_found.
Subscriber
A subscriber of a list (add_subscriber, find_subscriber,
get_subscriber, update_subscriber_attributes).
- object · all fields required
-
attributesmap of string → string | number | booleanThe subscriber’s attributes: a map of string, number or boolean values.
-
confirmed_atstring · date-time | nullWhen the subscriber confirmed a double opt-in;
nullotherwise. -
created_atstring · date-time -
emailstring · email -
idstring · uuid -
list_idstring · uuidThe list the subscriber is on.
-
project_idstring · uuidThe subscriber’s project.
-
soft_bounce_streakinteger · uint32Soft bounces in a row; reset by a delivery (P4+).
≥ 0
-
sourcestringHow the subscriber was added:
api,importorconfirm. -
statusstringpending,active,unsubscribed,bouncedorcomplained. -
unsubscribed_atstring · date-time | nullWhen the subscriber unsubscribed;
nullotherwise. -
updated_atstring · date-timeThe latest change: creation, an attribute merge.
Errors
A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors
HTTP API
The same operation over HTTP: DELETE /api/v1/projects/{project_id}/subscribers/{subscriber_id}