Skip to main content

Methods

Create

Creates a new contact.

CreateWithContext

Creates a new contact with context support.

Request Parameters

CreateContactRequest

string
required
The email address of the contact
string
Deprecated: The audience ID to add the contact to. Omit this field to create a global contact. Use the Segments API for contact organization instead.
bool
Whether the contact is unsubscribed from emails. Defaults to false.
string
The contact’s first name
string
The contact’s last name
map[string]any
Custom key-value pairs for global contacts (when audience_id is omitted).Important: Currently, the Resend API only accepts string values for properties. Non-string values (numbers, booleans, etc.) will be rejected by the API with a validation error.Example: map[string]any{"tier": "premium", "age": "30", "active": "true"}

Response

CreateContactResponse

string
Object type (“contact”)
string
The unique identifier for the created contact

Examples

Create Global Contact

Create Contact with Properties

Create Audience Contact (Deprecated)

With Context

Notes

  • Global contacts (without audience_id) support custom properties
  • Audience-specific contacts (with audience_id) do not support custom properties
  • The audience_id field is deprecated; use the Segments API for organizing contacts