Skip to main content
Resend Docs
current

Search documentation

Type to search this documentation.

On this pageOverview

Add Contacts

Learn how to add Contacts with Resend.

You can add a Contact in several different ways:

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.

Node.js
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

resend.contacts.create({
  email: 'steve.wozniak@gmail.com',
  firstName: 'Steve',
  lastName: 'Wozniak',
});
PHP
$resend = Resend::client('re_xxxxxxxxx');

$resend->contacts->create(
  parameters: [
    'email' => 'steve.wozniak@gmail.com',
    'first_name' => 'Steve',
    'last_name' => 'Wozniak',
  ]
);
Python
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)
Ruby
require "resend"

Resend.api_key = "re_xxxxxxxxx"

params = {
  "email": "steve.wozniak@gmail.com",
  "first_name": "Steve",
  "last_name": "Wozniak",
}

Resend::Contacts.create(params)
Go
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)
}
Rust
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(())
}
Java
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
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.

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.

  1. Go to the Dashboard page and select **Add contacts**.

  2. Select **Import CSV**.

  3. Upload your CSV file from your computer.

  4. Map the fields you want to use.

    You can map the fields to the included Contact properties such as email and first_name, or any custom Contact properties you've already created.

  5. 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.

  6. 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.

  7. Select **Continue**, review the Contacts, and finish the upload.

  1. Navigate to the Dashboard page.

  2. Select **Add contacts**.

  3. Select **Add Manually** from the dropdown.

  4. Add the email address of the Contact in the text field (separated by commas or new lines for multiple Contacts).

  5. Optionally add the new Contact to one or more existing Segments.

  6. Optionally add the new Contact to one or more existing Topics.

  7. Confirm and click **Add**.

For complete API documentation, see the Contacts API reference.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu