> For the complete documentation index, see [llms.txt](https://docs.dapta.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dapta.ai/ai-text-agents/campaigns/importing-contacts.md).

# Importing contacts

Contacts are loaded into a campaign by uploading a CSV or XLSX file. Each row in the file becomes one campaign target — one contact who will receive the template message.

***

## Supported file types

| Format                 | Extension | Max size |
| ---------------------- | --------- | -------- |
| Comma-separated values | `.csv`    | 5 MB     |
| Excel workbook         | `.xlsx`   | 5 MB     |

***

## Required and optional columns

| Column           | Required    | Description                                                            |
| ---------------- | ----------- | ---------------------------------------------------------------------- |
| `phone_number`   | ✅ Yes       | The recipient's WhatsApp number.                                       |
| `name`           | Recommended | Used to personalize messages and shown in the Conversations tab.       |
| Any other column | Optional    | Additional data you want to map to template or conversation variables. |

> **💡 Tip:** Click **Download template** on the upload step to get a CSV file with the correct headers pre-filled.

***

## Phone number format

Phone numbers must be in **E.164 format**: a `+` sign followed by the country code and the full number, with no spaces, dashes, or parentheses.

| ✅ Valid         | ❌ Invalid        |
| --------------- | ---------------- |
| `+573001234567` | `3001234567`     |
| `+12025550199`  | `(202) 555-0199` |
| `+447911123456` | `07911 123456`   |

{% hint style="warning" %}
Rows with invalid or unrecognizable phone numbers are rejected at import time and counted as `rows_invalid` in the import summary. They will not receive messages.
{% endhint %}

***

## What happens during import

When you upload a file, Dapta processes it row by row:

1. **Validates** each phone number against E.164 rules using the campaign's time zone as a country hint.
2. **Deduplicates** — if a phone number already exists in this campaign, the row is silently skipped (counted as `rows_duplicate`).
3. **Inserts** valid, new contacts as pending targets (counted as `rows_inserted`).
4. **Rejects** invalid rows with a structured error code (counted as `rows_invalid`).

After processing, an **import summary** is shown:

| Field              | Description                                       |
| ------------------ | ------------------------------------------------- |
| **Rows received**  | Total rows in the file.                           |
| **Rows inserted**  | New contacts added to the campaign.               |
| **Rows duplicate** | Phone numbers already in this campaign — skipped. |
| **Rows invalid**   | Rows rejected due to phone validation errors.     |

***

## Adding contacts after campaign creation

You can upload additional contacts to a campaign that is already running or scheduled. Navigate to the campaign detail page, go to **Settings**, and use the upload area to add a new file. New contacts are appended; existing phone numbers are skipped automatically.

***

## Troubleshooting

| Problem                              | Solution                                                                                                    |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| All rows are `rows_invalid`          | Check that the `phone_number` column exists and values use E.164 format with a `+` prefix.                  |
| Some rows are `rows_duplicate`       | Those phone numbers were already imported in a previous upload. This is expected — no action needed.        |
| Template dropdown is empty           | The selected channel has no approved WhatsApp templates. Approve a template in Meta Business Manager first. |
| Import summary shows 0 rows inserted | The file may be empty, have only headers, or all rows may be duplicates or invalid.                         |
| File upload fails                    | Confirm the file is `.csv` or `.xlsx` and is under 5 MB.                                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dapta.ai/ai-text-agents/campaigns/importing-contacts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
