# Create Contact

## Body Parameters

- `email` (string, required) — The email address of the contact.

The first name of the contact.

The last name of the contact.

- `unsubscribed` (boolean) — The Contact's global subscription status. If set to `true`, the contact will be unsubscribed from all Broadcasts.

- `properties` (object) — A map of custom property keys and values to create.

  :::accordion{title="custom properties"}
  - `key` (string, required) — The property key.

  - `value` (string, required) — The property value.
  :::

- `segments` (array) — Array of objects. Each object must contain the ID of the segment that you'd like to add the contact to.

  :::accordion{title="segments"}
  - `id` (string, required) — The segment ID.
  :::

- `topics` (array) — Array of topic subscriptions for the contact.

  :::accordion{title="topics"}
  - `id` (string, required) — The topic ID.

  - `subscription` ('opt\_in' | 'opt\_out', required) — The subscription status for this topic.
  :::

:::code-group
```ts Node.js
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.contacts.create({
  email: 'steve.wozniak@gmail.com',
  firstName: 'Steve',
  lastName: 'Wozniak',
  unsubscribed: false,
});
```

```php PHP
$resend = Resend::client('re_xxxxxxxxx');

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

```python Python
import resend

resend.api_key = "re_xxxxxxxxx"

params: resend.Contacts.CreateParams = {
  "email": "steve.wozniak@gmail.com",
  "first_name": "Steve",
  "last_name": "Wozniak",
  "unsubscribed": False,
}

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",
  "unsubscribed": false,
}

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")
    .with_unsubscribed(false);

  let _contact = resend.contacts.create(contact).await?;

  Ok(())
}
```

```java Java
import com.resend.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")
                .unsubscribed(false)
                .build();

        CreateContactResponseSuccess data = resend.contacts().create(params);
    }
}
```

```csharp .NET
using Resend;

IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI

var resp = await resend.ContactAddAsync(
    new ContactData()
    {
        Email = "steve.wozniak@gmail.com",
        FirstName = "Steve",
        LastName = "Wozniak",
        IsUnsubscribed = false,
    }
);
Console.WriteLine( "Contact Id={0}", resp.Content );
```

```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",
  "unsubscribed": false
}'
```

```bash CLI
resend contacts create \
  --email steve.wozniak@gmail.com \
  --first-name Steve \
  --last-name Wozniak
```
:::

:::code-group
```json Response
{
  "object": "contact",
  "id": "479e3145-dd38-476b-932c-529ceb705947"
}
```
:::

## Related pages

- [Account Management](./account-management-index.md)
- [API Keys](./api-keys-2-index.md)
- [API Keys](./api-keys-index.md)
- [API Reference](./api-reference-index.md)
- [AudiencesDEPRECATED](./audiencesdeprecated-index.md)
- [Authorized Apps](./authorized-apps-index.md)
- [Automations](./automations-index.md)
- [Broadcasts](./broadcasts-index.md)
- [Build with AI](./build-with-ai-index.md)
- [Changelog](../changelog.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.
