# Create contact

> Adds a contact to an audience.

Source: https://mailvina.com/docs/api-reference/audiences/create-contact · Base URL: https://api.mailvina.com · Guide: https://mailvina.com/docs/audiences

`POST /audiences/:audience_id/contacts`

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `audience_id` | `string` | yes | The audience ID. |

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | `string` | yes | Contact email. |
| `first_name` | `string` | no | Used by `{{{FIRST_NAME}}}`. |
| `last_name` | `string` | no | Used by `{{{LAST_NAME}}}`. |
| `unsubscribed` | `boolean` | no | Default `false`. |

**Request**

```bash
curl -X POST 'https://api.mailvina.com/audiences/:audience_id/contacts' \
  -H 'Authorization: Bearer mv_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "ada@example.com",
  "first_name": "Ada",
  "last_name": "Lovelace"
}'
```

```js
const res = await fetch('https://api.mailvina.com/audiences/:audience_id/contacts', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.MAILVINA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "email": "ada@example.com",
    "first_name": "Ada",
    "last_name": "Lovelace"
  }),
});
const data = await res.json();
```

```python
import os, requests

res = requests.post(
    "https://api.mailvina.com/audiences/:audience_id/contacts",
    headers={"Authorization": f"Bearer {os.environ['MAILVINA_API_KEY']}"},
    json={
        "email": "ada@example.com",
        "first_name": "Ada",
        "last_name": "Lovelace"
    },
)
print(res.json())
```

**Response**

```json
{
  "object": "contact",
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3"
}
```
