# Add Contacts

## Add Contacts

You can add a Contact in several different ways:

- [CSV upload](#add-contacts-by-uploading-a-csv)
- [API](#add-contacts-programmatically-via-api)
- [CLI](/guides/resources-cli#contacts)
- [manually in the Dashboard](#add-contacts-manually)

:::callout{intent="note"}
Contacts are also created automatically when an
[Automation](/guides/learn-dashboard-automations-introduction) runs for an email address
that doesn't yet exist in your Contact list.
:::

### Add Contacts programmatically via API

When you create Contacts programmatically using the [Contacts API](/guides/contacts-create-contact), an email address is the only required property. You can optionally pass [Contact properties available by default](/guides/learn-dashboard-contacts-properties#included-properties), or any [custom Contact properties](/guides/learn-dashboard-contacts-properties#add-custom-contact-properties) you have previously defined.

:::code-group
```ts 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 PHP
$resend = Resend::client('re_xxxxxxxxx');

$resend->contacts->create(
  parameters: [
    'email' => 'steve.wozniak@gmail.com',
    'first_name' => 'Steve',
    'last_name' => 'Wozniak',
  ]
);
```

```python 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 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 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 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 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);
    }
}
```

```bash 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](/guides/contacts-update-contact) endpoint. There are also endpoints to [add the Contact to a Segment](/guides/contacts-add-contact-to-segment) and to [update Topics for a Contact](/guides/contacts-update-contact-topics).

### 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](https://resend.com/audience).

::::steps
:::step{title="Go to the Dashboard page and select **Add contacts**."}
:::

:::step{title="Select **Import CSV**."}
:::

:::step{title="Upload your CSV file from your computer."}
:::

:::step{title="Map the fields you want to use."}
You can map the fields to the [included Contact
properties](/guides/learn-dashboard-contacts-properties#included-properties) such as
`email` and `first_name`, or any [custom Contact
properties](/guides/learn-dashboard-contacts-properties#add-custom-contact-properties)
you've already created.
:::

:::step{title="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.
:::

:::step{title="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.
:::

:::step{title="Select **Continue**, review the Contacts, and finish the upload."}
:::
::::

### Add Contacts manually

:::::steps
:::step{title="Navigate to the Dashboard page."}
:::

:::step{title="Select **Add contacts**."}
:::

:::step{title="Select **Add Manually** from the dropdown."}
:::

:::step{title="Add the email address of the Contact in the text field (separated by commas or new lines for multiple Contacts)."}
:::

::::step{title="Optionally add the new Contact to one or more existing Segments."}
:::callout{intent="info"}
An email address is the only required property for a new Contact. However,
in most cases, a Contact must belong to a Segment in order to receive a
Broadcast.
:::
::::

:::step{title="Optionally add the new Contact to one or more existing Topics."}
:::

:::step{title="Confirm and click **Add**."}
:::
:::::

## API Reference

For complete API documentation, see the [Contacts API reference](/guides/contacts-create-contact).

## Related pages

- [Contacts](./learn-dashboard-contacts-introduction.md)
- [Managing Contacts](./learn-dashboard-contacts-manage-contacts.md)
- [Contact properties](./learn-dashboard-contacts-properties.md)
- [Managing Segments](./learn-dashboard-contacts-manage-segments.md)
- [Topics](./learn-dashboard-contacts-manage-topics.md)
- [Managing unsubscribed Contacts](./learn-dashboard-contacts-managing-unsubscribe-list.md)
- [Migrating from Audiences to Segments](./learn-dashboard-contacts-migrating-from-audiences-to-segments.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
