# Importing consent (/guides/importing-consent)

When you migrate from another platform, you don't just move contacts — you move **what each of them agreed to**. The consent importer ingests topic consent from a CSV, mapping the other tool's groups to Bitelio [topics](/docs/guides/preference-center) and preserving the **original** opt-in date in each contact's consent history. Find it in **Settings › Data › Import consent**.

## Before you start

Import consent maps onto data that already exists — it never creates contacts or topics:

1. [Import your contacts](/docs/guides/importing-contacts) first.
2. Create the [topics](/docs/guides/preference-center#topics) you're mapping to, and note each topic's **key**.

A row whose email doesn't match a contact, or whose `topic_key` doesn't match a topic, is **skipped** and counted — never guessed.

## CSV format

Download the template from the card, or build a file with these columns:

```csv
email,topic_key,status,date
jane@acme.com,weekly_digest,subscribed,2023-05-01
john@acme.com,promotions,unsubscribed,2023-06-15
```

| Column      | Required | Notes                                                                                              |
| ----------- | -------- | -------------------------------------------------------------------------------------------------- |
| `email`     | Yes      | Must match an existing contact in the project (case-insensitive).                                  |
| `topic_key` | Yes      | Must match a topic's **key** (not its display name).                                               |
| `status`    | Yes      | `subscribed` or `unsubscribed`. `no` / `false` / `0` also count as unsubscribed.                   |
| `date`      | No       | The original opt-in date (ISO `YYYY-MM-DD`). Preserved in the consent history rather than "today". |

A header row is detected and skipped automatically.

## Running the import

1. **Upload CSV** (or paste the rows into the box).
2. Review the rows.
3. **Import.**

You get a summary — how many rows were **imported** and how many **skipped**. Each imported row sets the contact's per-topic consent and appends a [consent history](/docs/guides/preference-center#consent-history) entry marked `import`, dated to the original `date`.

<Callout title="Doing it programmatically">
  The same import is available on the API:

  ```bash
  POST /consent/import
  { "rows": [ { "email": "jane@acme.com", "topicKey": "weekly_digest", "status": "subscribed", "occurredAt": "2023-05-01", "source": "mailchimp" } ] }
  → { "imported": 1, "skipped": 0, "errors": [] }
  ```
</Callout>

## Related

* [Topics & the preference center](/docs/guides/preference-center)
* [Importing contacts](/docs/guides/importing-contacts)
