Files
chatwoot/public/downloads/import-contacts-sample.csv
d43a87c9dc feat: Add labels to contact import/export (#13313)
Adds label support to contact import and export so teams can carry
approved contact labels through CSV workflows. Imports accept a `labels`
column with labels that already exist in the account; multiple labels
should be entered as a quoted comma-separated CSV value, for example
`"customer,vip"`.

Imports are additive: they add labels to contacts and do not remove
labels already on a contact. Removing a label from the CSV row or
leaving the `labels` cell blank will not clear existing contact labels.
To remove a label, edit the contact directly.

## Closes

- Closes #8535

## How to test

1. Create a few contact labels in the account, such as `customer`,
`vip`, and `lead`.
2. Go to Contacts -> Import contacts and download the sample CSV.
3. Import contacts with a `labels` column. Use a single label like
`lead`, or quote multiple labels like `"customer,vip"`.
4. Confirm imported contacts are created with the expected labels.
5. Re-import an existing contact with a new label and confirm the new
label is added without removing existing labels.
6. Try a row with an unknown label, such as `"vip,unknown_label"`, and
confirm only that row is rejected in the failed records CSV while the
other valid rows are imported.
7. Export contacts and confirm the CSV includes a `labels` column with
comma-separated approved labels.

## What changed

- Contact exports include approved `labels` in the default CSV columns.
This adds a new default export column for CSV consumers.
- Contact imports parse `labels` as comma-separated values inside the
CSV cell.
- Imported labels are validated against labels that already exist in the
account.
- Rows with unknown labels are rejected with an `Unknown labels: ...`
error; valid rows in the same import continue to process.
- Imported labels are additive and do not remove existing contact
labels.
- Label application during import does not dispatch an additional
per-contact update event.
- The sample CSV includes an import-safe `labels` column. The modal
keeps the existing generic CSV import copy.

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2026-05-06 18:46:36 +05:30

3.6 KiB

1idnameemailidentifierphone_numberlabelsip_addresscompany_namecustom_attribute_1custom_attribute_2
21Clarice Uzzellcuzzell0@mozilla.orgbb4e11cd-0f23-49da-a123-dcc1fec6852c+49896364801870.61.11.201Acme IncRandom-value-1Random-value-1
32Marieann Creeganmcreegan1@cornell.edue60bab4c-9fbb-47eb-8f75-42025b789c47+15417543010168.186.4.241Acme IncRandom-value0Random-value0
43Nancey Windibanknwindibank2@bluehost.comf793e813-4210-4bf3-a812-711418de25d2+1541754301173.44.41.59Acme IncRandom-value1Random-value1
54Sibel Stenninesstennine3@yellowbook.comd6e35a2d-d093-4437-a577-7df76316b937+15417543011115.249.27.155Acme IncRandom-value2Random-value2
65Tina O'Lunneytolunney4@si.edu3540d40a-5567-4f28-af98-5583a7ddbc56+15417543011219.181.212.8Acme IncRandom-value3Random-value3
76Quinn Neveqneve5@army.milba0e1bf0-c74b-41ce-8a2d-0b08fa0e5aa5+15417543011231.210.115.166Acme IncRandom-value4Random-value4
87Karylin Gaunsonkgaunson6@tripod.comd24cac79-c81b-4b84-a33e-0441b7c6a981+15417543011160.189.41.11Acme IncRandom-value5Random-value5
98Jamison Shentonjshenton7@upenn.edu29a7a8c0-c7f7-4af9-852f-761b1a784a7a+1541754301153.94.18.201Acme IncRandom-value6Random-value6
109Gavan Threlfallgthrelfall8@spotify.com847d4943-ddb5-47cc-8008-ed5092c675c5+1541754301118.87.247.249Acme IncRandom-value7Random-value7
1110Katina Hemmingwaykhemmingway9@ameblo.jp8f0b5efd-b6a8-4f1e-a1e3-b0ea8c9e3048+1541754301125.191.96.124Acme IncRandom-value8Random-value8
1211Jillian Deinhardjdeinharda@canalblog.combd952787-1b05-411f-9975-b916ec0950cc+1541754301111.211.174.93Acme IncRandom-value9Random-value9
1312Blake Findenbfindenb@wsj.com12c95613-e49d-4fa2-86fb-deabb6ebe600+1541754301147.26.205.153Acme IncRandom-value10Random-value10
1413Liane Maxworthylmaxworthyc@un.org36b68e4c-40d6-4e09-bf59-7db3b27b18f0+15417543011157.196.34.166Acme IncRandom-value11Random-value11
1514Martynne Ledleymledleyd@sourceforge.net1856bceb-cb36-415c-8ffc-0527f3f750d8+15417543011109.231.152.148Acme IncRandom-value12Random-value12
1615Katharina Rufflikrufflie@huffingtonpost.com604de5c9-b154-4279-8978-41fb71f0f773+1541754301120.43.146.179Acme IncRandom-value13Random-value13
1716Tucker Simmancetsimmancef@bbc.co.uk0a8fc3a7-4986-4a51-a503-6c7f974c90ad+15417543011179.76.226.171Acme IncRandom-value14Random-value14
1817Wenona Martinsonwmartinsong@census.gov0e5ea6e3-6824-4e78-a6f5-672847eafa17+1541754301192.243.194.160Acme IncRandom-value15Random-value15
1918Gretna Vedyasovgvedyasovh@lycos.com6becf55b-a7b5-48f6-8788-b89cae85b066+1541754301125.22.86.101Acme IncRandom-value16Random-value16
2019Lurline Abdonlabdoni@archive.orgafa9429f-9034-4b06-9efa-980e01906ebf+15417543011150.249.116.118Acme IncRandom-value17Random-value17
2120Fiann Norclifffnorcliffj@istockphoto.com59f72dec-14ba-4d6e-b17c-0d962e69ffac+15417543011237.167.197.197Acme IncRandom-value18Random-value18
2221Zed Linnzlinnk@phoca.cz95f7bc56-be92-4c9c-ad58-eff3e63c7bea+1541754301188.102.64.113Acme IncRandom-value19Random-value19
2322Averyl Simysonasimysonl@livejournal.combde1fe59-c9bd-440c-bb39-79fe61dac1d1+15417543011141.248.89.29Acme IncRandom-value20Random-value20
2423Camella Blackaddercblackadderm@nifty.com0c981752-5857-487c-b9b5-5d0253df740a+15417543011118.123.138.115Acme IncRandom-value21Random-value21
2524Aurie Spatigaspatign@printfriendly.com4cf22bfb-2c3f-41d1-9993-6e3758e457ba+15417543011157.45.102.235Acme IncRandom-value22Random-value22
2625Adrienne Bellardabellardo@cnn.comf10f9b8d-38ac-4e17-8a7d-d2e6a055f944+15417543011170.73.198.47Acme IncRandom-value23Random-value23