Add Contacts
Learn how to add Contacts with Resend.
Add Contacts
Section titled “Add Contacts”You can add a Contact in several different ways:
Add Contacts programmatically via API
Section titled “Add Contacts programmatically via API”When you create Contacts programmatically using the Contacts API, an email address is the only required property. You can optionally pass Contact properties available by default, or any custom Contact properties you have previously defined.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
resend.contacts.create({
email: 'steve.wozniak@gmail.com',
firstName: 'Steve',
lastName: 'Wozniak',
});$resend = Resend::client('re_xxxxxxxxx');
$resend->contacts->create(
parameters: [
'email' => 'steve.wozniak@gmail.com',
'first_name' => 'Steve',
'last_name' => 'Wozniak',
]
);import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Contacts.CreateParams = {
"email": "steve.wozniak@gmail.com",
"first_name": "Steve",
"last_name": "Wozniak",
}
resend.Contacts.create(params)require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
"email": "steve.wozniak@gmail.com",
"first_name": "Steve",
"last_name": "Wozniak",
}
Resend::Contacts.create(params)package main
import "github.com/resend/resend-go/v4"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
params := &resend.CreateContactRequest{
Email: "steve.wozniak@gmail.com",
FirstName: "Steve",
LastName: "Wozniak",
Unsubscribed: false,
}
client.Contacts.Create(params)
}use resend_rs::{types::CreateContactOptions, Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let contact = CreateContactOptions::new("steve.wozniak@gmail.com")
.with_first_name("Steve")
.with_last_name("Wozniak");
let _contact = resend
.contacts
.create(contact)
.await?;
Ok(())
}import com.resend.*;
import com.resend.core.exception.ResendException;
import com.resend.services.contacts.model.CreateContactOptions;
import com.resend.services.contacts.model.CreateContactResponseSuccess;
public class Main {
public static void main(String[] args) throws ResendException {
Resend resend = new Resend("re_xxxxxxxxx");
CreateContactOptions params = CreateContactOptions.builder()
.email("steve.wozniak@gmail.com")
.firstName("Steve")
.lastName("Wozniak")
.build();
CreateContactResponseSuccess data = resend.contacts().create(params);
}
}curl -X POST 'https://api.resend.com/contacts' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"email": "steve.wozniak@gmail.com",
"first_name": "Steve",
"last_name": "Wozniak"
}'Once a Contact is created, you can update it using the update Contact endpoint. There are also endpoints to add the Contact to a Segment and to update Topics for a Contact.
Add Contacts by uploading a .csv
Section titled “Add Contacts by uploading a .csv”If you already have a list of existing email addresses, you can add multiple Contacts at once by uploading a .csv file on the Dashboard page.
Go to the Dashboard page and select **Add contacts**.
Select **Import CSV**.
Upload your CSV file from your computer.
Map the fields you want to use.
You can map the fields to the included Contact properties such as
emailandfirst_name, or any custom Contact properties you've already created.Optionally add the Contacts to an existing Segment.
Broadcasts are usually sent to a Segment of your Contact list. Add a Segment to determine which marketing emails you will send to the Contacts.
Optionally add the Contacts to an existing Topic.
You can subscribe your Contacts to one or more Broadcast Topics. They will have the option to unsubscribe from your unsubscribe page.
Select **Continue**, review the Contacts, and finish the upload.
Add Contacts manually
Section titled “Add Contacts manually”Select **Add contacts**.
Select **Add Manually** from the dropdown.
Add the email address of the Contact in the text field (separated by commas or new lines for multiple Contacts).
Optionally add the new Contact to one or more existing Segments.
Optionally add the new Contact to one or more existing Topics.
Confirm and click **Add**.
API Reference
Section titled “API Reference”For complete API documentation, see the Contacts API reference.