> For the complete documentation index, see [llms.txt](https://documents.blocksurvey.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documents.blocksurvey.io/audience/create-contact.md).

# Create Contact

### **Overview**

Creates a new contact in a specified list.

### Authentication <a href="#authentication" id="authentication"></a>

This request requires a `Authorization` header with a valid token.&#x20;

**URL:** `POST https://api3.blocksurvey.io/contact/create-contact`

### Request Headers

| Key           | Value              | Description                 |
| ------------- | ------------------ | --------------------------- |
| Authorization | Bearer \<api\_key> | API key for authentication. |

### Request Body

| Field                                                              | Type   | Required | Description                        |
| ------------------------------------------------------------------ | ------ | -------- | ---------------------------------- |
| teamId                                                             | String | Yes      | ID of the team owning the list.    |
| listId                                                             | String | Yes      | ID of the list to add the contact. |
| listPublicKey                                                      | String | Yes      | Public key for encryption.         |
| Email                                                              | String | Yes      | Email address of the contact.      |
| <p>First Name</p><p>Last Name</p><p>Phone Number</p><p>Country</p> | String | No       | Additional column data.            |

### cURL Example

```bash
curl -X POST https://api3.blocksurvey.io/contact/create-contact
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
    "teamId": "team-123",
    "listId": "list-456",
    "listPublicKey": "base64-public-key",
    "Email": "example@example.com",
    "First Name": "John",
    "Last Name": "Doe"
}'

```

### Response

**Successful Response**

```json
{
    "success": true,
    "recordId": "contact-id"
}
```

### Errors

| Error Message | Status Code             | Description                        |
| ------------- | ----------------------- | ---------------------------------- |
| 400           | Missing required fields | Required fields are missing.       |
| 401           | Unauthorized            | Invalid or missing API key.        |
| 404           | List not found          | The specified list does not exist. |
| 409           | Contact already exists  | The contact already exists.        |
| 500           | Internal server error   | An unexpected error occurred.      |
