Create Contact

Create a new contact for the organization.

POST/contacts

Resend Compatibility: Partial -- Postflare adds properties, segments, and topics fields.

Requires a full_access API key.

Body Parameters

emailstringrequired

Contact email address.

first_namestring

Contact first name.

last_namestring

Contact last name.

unsubscribedboolean

Whether the contact is unsubscribed. Default false.

propertiesobject

Custom key-value properties for the contact. Values can be strings or numbers.

segmentsstring[]

Array of segment IDs to add the contact to.

topicsarray

Array of topic subscriptions.

idstringrequired

Topic ID.

subscriptionstring

Subscription status: opt_in or opt_out. Defaults to the topic's default subscription.

Response Fields

objectstring

Always "contact".

idstring

The 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

Response
{
  "object": "contact",
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3"
}