Skip to main content
PATCH
/
contacts
/
{id}
import { Emailr } from 'emailr';

const emailr = new Emailr('em_xxxxxxxxx');

// Update by contact id
const { data, error } = await emailr.contacts.update({
  id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
  unsubscribed: true,
});

// Update by contact email
const { data, error } = await emailr.contacts.update({
  email: '[email protected]',
  unsubscribed: true,
});
{
  "object": "contact",
  "id": "479e3145-dd38-476b-932c-529ceb705947"
}
PATCH https://api.emailr.dev/contacts/{id}

Path Parameters

Either id or email must be provided.
id
string
The Contact ID.
email
string
The Contact Email.

Body Parameters

unsubscribed
boolean
The Contact’s global subscription status. If set to true, the contact will be unsubscribed from all Broadcasts.
properties
object
A map of custom property keys and values to update.
import { Emailr } from 'emailr';

const emailr = new Emailr('em_xxxxxxxxx');

// Update by contact id
const { data, error } = await emailr.contacts.update({
  id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
  unsubscribed: true,
});

// Update by contact email
const { data, error } = await emailr.contacts.update({
  email: '[email protected]',
  unsubscribed: true,
});
{
  "object": "contact",
  "id": "479e3145-dd38-476b-932c-529ceb705947"
}