Create Contact
Create a new contact for the organization.
POST
/contactsResend Compatibility: Partial -- Postflare adds properties, segments, and topics fields.
Requires a full_access API key.
Body Parameters
emailstringrequiredContact email address.
first_namestringContact first name.
last_namestringContact last name.
unsubscribedbooleanWhether the contact is unsubscribed. Default false.
propertiesobjectCustom key-value properties for the contact. Values can be strings or numbers.
segmentsstring[]Array of segment IDs to add the contact to.
topicsarrayArray of topic subscriptions.
idstringrequiredTopic ID.
subscriptionstringSubscription status: opt_in or opt_out. Defaults to the topic's default subscription.
Response Fields
objectstringAlways "contact".
idstringThe newly created contact ID.
curl -X POST 'https://api.postflare.app/contacts' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"email": "user@example.com",
"first_name": "John",
"last_name": "Doe",
"unsubscribed": false
}'import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.contacts.create({
email: 'user@example.com',
firstName: 'John',
lastName: 'Doe',
unsubscribed: false,
audienceId: '<audience_id>', // Required by Resend SDK
});Response
{
"object": "contact",
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3"
}