# Lead file format

Use a lead file for people who asked to be contacted somewhere HeyMySocial did not see: a trade fair list, an old spreadsheet, an export from a booking system. Each row becomes a lead with its contact and goes through the same intake as a lead from your website, so the rules for duplicates and statuses are the same.

## Columns

<div class="table-scroll"><table><thead><tr><th>Column</th><th>Headings recognised</th><th>Needed</th><th>What it is</th></tr></thead><tbody><tr><th scope="row"><code style="white-space:nowrap">name</code></th><td>name, navn, full name, fulde navn, kontakt, contact</td><td>One of name, email or phone</td><td>The person&#039;s name.</td></tr><tr><th scope="row"><code style="white-space:nowrap">email</code></th><td>email, e-mail, mail, email address, e-mailadresse</td><td>One of name, email or phone</td><td>Their email address. It is also how a sales file can find the lead later.</td></tr><tr><th scope="row"><code style="white-space:nowrap">phone</code></th><td>phone, telefon, tlf, mobile, mobil, phone number</td><td>One of name, email or phone</td><td>Their phone number.</td></tr><tr><th scope="row"><code style="white-space:nowrap">company</code></th><td>company, firma, virksomhed, organisation, organization</td><td>Optional</td><td>The company they belong to.</td></tr><tr><th scope="row"><code style="white-space:nowrap">captured_at</code></th><td>captured_at, date, dato, created, created at, oprettet, received</td><td>Optional</td><td>When the lead arrived, in the workspace&#039;s time zone. Left empty, the moment of the import is used. It cannot be more than a day in the future.</td></tr><tr><th scope="row"><code style="white-space:nowrap">status</code></th><td>status, stage, fase</td><td>Optional</td><td>Where the lead already is: new, contacted, qualified, disqualified, opportunity, won or lost. Left empty, the lead is new. A lead given as won becomes an opportunity until its sale is imported.</td></tr><tr><th scope="row"><code style="white-space:nowrap">external_id</code></th><td>external_id, id, lead id, sale id, invoice, faktura, fakturanummer, order id, ordrenummer</td><td>Optional</td><td>The lead&#039;s id in your own system. A sales file can point at it.</td></tr><tr><th scope="row"><code style="white-space:nowrap">campaign_ref</code></th><td>campaign_ref, campaign, kampagne, utm_campaign</td><td>Optional</td><td>The campaign the lead belongs to. A reference no campaign in the workspace has is listed for review; the lead is still imported.</td></tr><tr><th scope="row"><code style="white-space:nowrap">tracking_link</code></th><td>tracking_link, link, link code</td><td>Optional</td><td>The code of the tracked link the lead came through.</td></tr><tr><th scope="row"><code style="white-space:nowrap">note</code></th><td>note, notes, comment, kommentar, besked, message</td><td>Optional</td><td>A note kept on the lead.</td></tr></tbody></table></div>

Your file does not need these exact headings. The import screen reads the header row and proposes a column for each field from the headings in the table. Capital letters do not matter, and underscores and dashes count as spaces, so `Full Name`, `full_name` and `full-name` are the same heading. A heading the screen does not know stays unmapped until you choose it.

## Rules for a row

- **Who it is.** A row needs at least a name, an email address or a phone number, and you must map at least one of those three columns. An email address that is not a valid address leaves the row out.
- **Date.** `captured_at` is when the lead arrived. It is read in the workspace's time zone. A date more than a day in the future is refused. Without a date the lead gets the moment of the import.
- **Status.** One of `new`, `contacted`, `qualified`, `disqualified`, `opportunity`, `won` or `lost`, in any mix of capitals. An empty cell means `new`; any other word leaves the row out. The meaning of each is under [lead statuses](https://heymysocial.com/docs/reference/lead-statuses).
- **Your own id.** `external_id` is the lead's id in your system. It is how the lead is recognized next time and how a [sales file](https://heymysocial.com/docs/files/sales) finds its lead.
- **Campaign.** `campaign_ref` is the reference code of one of the workspace's campaigns. The lead is then attributed to that campaign because you stated it. A code no campaign has does not stop the row: the lead is imported and the unknown reference is recorded for review.
- **Tracked link.** `tracking_link` is the code of a [tracked link](https://heymysocial.com/docs/tracking/links) the lead came through.
- **Note.** Stored on the lead as a note that members from the client's side can read as well.

Dates can be written in these forms, with leading zeros:

```text
2026-03-31
2026-03-31 14:05
2026-03-31 14:05:00
2026-03-31T14:05:00
2026-03-31T14:05:00+02:00
31-03-2026
31-03-2026 14:05
31/03/2026
31/03/2026 14:05
31.03.2026
31.03.2026 14:05
```

<div class="callout callout-note"><p class="callout-title">A won lead needs its sale</p>

A row with the status `won` is imported as an opportunity and listed in the result with that explanation. It becomes won when its sale is imported or recorded, so revenue is never guessed from a status.

</div>


## The same person twice

A contact is recognized by the exact email address. When a row carries the address of a contact you already have, the contact is kept: details that were missing are filled in, and details that were already there are not overwritten. The row still becomes a new lead for that contact. If the contact has an earlier lead from the recent past, the new one is marked as its duplicate instead of being dropped, so nothing is lost and nothing is counted twice.

## Importing the same file again

A row is recognized by its `external_id`, or otherwise by its contact details together with its date. A recognized row changes nothing and is counted under **Already there**.

<div class="callout callout-warning"><p class="callout-title">A file with neither a date nor an id</p>

Without `captured_at` the date is the moment of the import, so the same row looks different the next time and becomes a new lead. Map a date column or an id column if you may import the file again.

</div>


## Sample

The rows are made up. The second row writes its date the Danish way and leaves the phone number empty.

```csv
name,email,phone,company,captured_at,status,external_id,campaign_ref,note
Anna Example,anna@example.com,+45 00 00 00 01,Example Roofing ApS,2026-03-31 09:15,new,L-1001,spring-roof,Asked for a quote on a new roof
Bo Sample,bo@example.org,,Sample Carpentry,31-03-2026,qualified,L-1002,spring-roof,Wants a call after 4 pm
```

A file with every column and two fictional rows is at https://heymysocial.com/docs/files/samples/leads.csv

## In the app

1. Open **Leads** and press **Import**. The screen is called **Import leads and sales**. You need a role that may manage leads, and you must be on the agency's own team.
2. Under **What is in the file?** keep **Leads**, choose the CSV file and press **Read the file**.
3. On **Map the columns**, check the proposed column for each field against the first rows of your file, which are shown below. Set a field to **Not in the file** when the file does not have it. Then press the import button, which says how many rows it will import.
4. **Result** shows three numbers: **Imported**, **Already there** and **Not imported**. Below them, each row that needs your attention is listed with its line number, what happened and whether it was imported anyway.

The size and row limits are on the [overview of files](https://heymysocial.com/docs/files).

## With an assistant

[import_leads](https://heymysocial.com/docs/assistant/tools/import-leads) takes a list of rows with the same field names and runs the same importer, so a list an assistant hands over follows every rule on this page and shows up in the same import history. For a single lead an assistant uses [create_lead](https://heymysocial.com/docs/assistant/tools/create-lead).
