API Reference

Delete contact

DELETE /contacts/:id — remove a contact by id or email.

DELETE/contacts/:id

Remove a contact. The :id segment accepts either the contact id or its email. An id is exact; when addressing by email, append ?domain= to say which of your sending domains the contact lives on.

Path parameters
idstringrequired

The contact’s id *or* its email — either value is accepted in this path segment.

Query parameters
domainstringoptional

The sending domain the contact belongs to. Needed only when addressing by email; an id is exact.

Request
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.contacts.remove({ id: '479e3145-dd0e-4f64-bf48-1d4b6d4cd8f6' });
console.log({ data, error });
Response (200)
{
  "object": "contact",
  "contact": "479e3145-dd0e-4f64-bf48-1d4b6d4cd8f6",
  "deleted": true
}

Audience-scoped variant

The nested route DELETE /audiences/:audience_id/contacts/:id still works and scopes the delete to one audience:

Request (audience-scoped)
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.contacts.remove({ audienceId: 'AUDIENCE_ID', id: 'steve@example.com' });
console.log({ data, error });

An unknown contact (or audience) returns 404 not_found. See Errors.