Update Contact
Update a contact by ID or email address. All body fields are optional; only provided fields will be updated.
/contacts/{contact_id_or_email}Resend Compatibility: Partial -- Postflare supports lookup by email, and adds properties and topics fields.
Requires an API key with contacts:write permission.
Path Parameters
contact_id_or_emailstringrequiredThe contact ID (UUID) or email address.
Body Parameters
emailstringNew email address for the contact.
first_namestring | nullContact first name. Pass null to clear.
last_namestring | nullContact last name. Pass null to clear.
unsubscribedbooleanWhether the contact should be unsubscribed.
propertiesobjectCustom key-value properties to set. Only the keys you pass change; the contact's other properties keep their values. Pass null as a value to remove that property.
topicsarrayTopic subscription updates. Only provided topics are updated; others remain unchanged.
idstringrequiredTopic ID.
subscriptionstringrequiredSubscription status: opt_in or opt_out.
Response Fields
objectstringAlways "contact".
idstringThe contact ID.
curl -X PATCH 'https://api.postflare.dev/contacts/e169aa45-1ecf-4183-9955-b1499d5701d3' \
-H 'Authorization: Bearer sk_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "Jane",
"unsubscribed": true
}'// Set RESEND_BASE_URL=https://api.postflare.dev in the environment before
// the process starts. Without it the SDK sends to api.resend.com, silently.
import { Resend } from 'resend';
const resend = new Resend('sk_xxxxxxxxx');
const { data, error } = await resend.contacts.update({
id: 'e169aa45-1ecf-4183-9955-b1499d5701d3',
firstName: 'Jane',
unsubscribed: true,
});Response
{
"object": "contact",
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3"
}