> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.talkif.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.talkif.ai/_mcp/server.

# Import contacts

> Bring contacts in from CSV, JSON or vCard — the columns, phone-number normalisation, the dry-run preview, duplicate handling, and what the summary tells you.

Most lists start life somewhere else — a CRM export, a spreadsheet, a phone's address book. The importer takes the three shapes those produce, shows you exactly what it's about to create before it creates anything, and never silently duplicates a number you already have.

## Formats

#### CSV

A header row with these column names; only `name` and `primary_phone` are required.

**`contacts.csv`**

```csv title="contacts.csv"
name,primary_phone,email,company,tags,notes,timezone,language
Ada Lovelace,+442071234567,ada@example.com,Analytical Engines,vip|renewal-q4,Prefers mornings,Europe/London,en
Grace Hopper,+12025550143,grace@example.com,,lead,,America/New_York,en
```

| Column                           | Required | Notes                                                  |
| -------------------------------- | -------- | ------------------------------------------------------ |
| `name`                           | yes      |                                                        |
| `primary_phone`                  | yes      | E.164, or a local number with `defaultCountryCode` set |
| `secondary_phones`               |          | pipe-separated `\|`                                    |
| `email`, `company`, `occupation` |          |                                                        |
| `notes`                          |          | up to 5,000 characters                                 |
| `tags`, `interests`              |          | pipe-separated `\|`                                    |
| `timezone`                       |          | IANA; derived from the phone number if omitted         |
| `language`                       |          | default `en`                                           |

#### JSON

An array of objects with the same fields. Keys may be camelCase (`primaryPhone`) or snake_case (`primary_phone`); lists are real arrays.

**`contacts.json`**

```json title="contacts.json"
[
  { "name": "Ada Lovelace", "primaryPhone": "+442071234567", "tags": ["vip", "renewal-q4"], "timezone": "Europe/London" }
]
```

#### vCard

Standard `.vcf` (vCard 4.0), one or many cards per file. Mapped: `FN` → name, `TEL` → phone (first = primary, rest secondary), `EMAIL`, `ORG` → company, `TITLE` → occupation, `NOTE` → notes.

## Phone numbers

Numbers are validated as E.164 and stored that way. A file with local numbers (`020 7123 4567`) imports cleanly if you set a **default country code** (`44`); numbers that already start with `+` are left alone. A number that can't be parsed is reported as an error for that row; the rest of the file still imports.

## Duplicates

A contact whose **primary phone already exists** in your account is a duplicate and is **skipped** — the existing record is untouched. The same check runs *within* the file, so a list with the same number on two rows creates one contact. The summary tells you how many were skipped and which.

## Preview, then import

#### Upload the file

**Contacts → Import**, choose the file. The format is detected from the extension; set the default country code if the numbers are local.

#### Read the preview

The importer parses everything and shows what would happen — rows to create, rows skipped as duplicates, rows with errors and why — **without writing anything**. Fix the file and re-upload if the numbers look wrong.

#### Confirm

The import runs and the summary reports contacts created, skipped and errored.

From the API the same two-step shape: [`POST /contacts/import`](/api-reference/contacts/import-contacts) with the file base64-encoded, `confirmed: false` for the preview, then `confirmed: true` to run it.

### Request

POST [https://api.talkif.ai/api/v1/contacts/import](https://api.talkif.ai/api/v1/contacts/import)

```curl
curl -X POST https://api.talkif.ai/api/v1/contacts/import \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "fileContent": "Sm9obiBEb2UsKzE1NTUxMjM0NTY3",
  "format": "vcf"
}'
```

```typescript
import { TalkifClient } from "@talkif/sdk";

async function main() {
    const client = new TalkifClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.contacts.importContacts({
        fileContent: "Sm9obiBEb2UsKzE1NTUxMjM0NTY3",
        format: "vcf",
    });
}
main();

```

```python
import requests

url = "https://api.talkif.ai/api/v1/contacts/import"

payload = {
    "fileContent": "Sm9obiBEb2UsKzE1NTUxMjM0NTY3",
    "format": "vcf"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.talkif.ai/api/v1/contacts/import"

	payload := strings.NewReader("{\n  \"fileContent\": \"Sm9obiBEb2UsKzE1NTUxMjM0NTY3\",\n  \"format\": \"vcf\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.talkif.ai/api/v1/contacts/import")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"fileContent\": \"Sm9obiBEb2UsKzE1NTUxMjM0NTY3\",\n  \"format\": \"vcf\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.talkif.ai/api/v1/contacts/import")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"fileContent\": \"Sm9obiBEb2UsKzE1NTUxMjM0NTY3\",\n  \"format\": \"vcf\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.talkif.ai/api/v1/contacts/import', [
  'body' => '{
  "fileContent": "Sm9obiBEb2UsKzE1NTUxMjM0NTY3",
  "format": "vcf"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.talkif.ai/api/v1/contacts/import");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"fileContent\": \"Sm9obiBEb2UsKzE1NTUxMjM0NTY3\",\n  \"format\": \"vcf\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "fileContent": "Sm9obiBEb2UsKzE1NTUxMjM0NTY3",
  "format": "vcf"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.talkif.ai/api/v1/contacts/import")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

> **Tip**
>
> Tag on the way in. A `tags` column with the campaign name (`renewal-q4`) means the list is ready to add to a campaign by filter the moment the import finishes — no second pass.

## Next

#### [Campaigns](/calls/campaigns)

Add the imported list by tag.

#### [Contacts](/calls/contacts)

What each field is used for.