PATCH
/
audiences
/
:audience_id
/
contacts
/
:id
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

// Update by contact id
resend.contacts.update({
  id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
  audienceId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  unsubscribed: true,
});

// Update by contact email
resend.contacts.update({
  email: 'acme@example.com',
  audienceId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  unsubscribed: true,
});
{
  "object": "contact",
  "id": "479e3145-dd38-476b-932c-529ceb705947"
}

Path Parameters

audienceId
string
required

The Audience ID.

Either id or email must be provided.

id
string

The Contact ID.

email
string

The Contact Email.

Body Parameters

first_name
string

The first name of the contact.

last_name
string

The last name of the contact.

unsubscribed
boolean

The subscription status.

import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

// Update by contact id
resend.contacts.update({
  id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
  audienceId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  unsubscribed: true,
});

// Update by contact email
resend.contacts.update({
  email: 'acme@example.com',
  audienceId: '78261eea-8f8b-4381-83c6-79fa7120f1cf',
  unsubscribed: true,
});
{
  "object": "contact",
  "id": "479e3145-dd38-476b-932c-529ceb705947"
}