# How to add contacts from CSV automatically in a segment

**URL:** <https://forum.mautic.org/t/how-to-add-contacts-from-csv-automatically-in-a-segment/17216>\
**Category:** Product Support\
**Created:** [November 30, 2020, 4:01pm UTC](https://forum.mautic.org/t/how-to-add-contacts-from-csv-automatically-in-a-segment/17216 "2020-11-30T16:01:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chervenkov](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/chervenkov/32/719_2.png) [@chervenkov](https://forum.mautic.org/u/chervenkov)\
**Post date:** [November 30, 2020, 4:01pm UTC](https://forum.mautic.org/t/how-to-add-contacts-from-csv-automatically-in-a-segment/17216/1 "2020-11-30T16:01:31Z")

</div>

**Your software**  
My Mautic version is: 3.2.0  
My PHP version is:7.2.  
My Database type and version is:

**Your problem**  
My problem is: I want to add some contacts with fields: name, country, email. When im importing them and manually add the segment they goes in it with no problem. But when i added them and create a rule in the segment (geo based rule and/or tag based rule) they cant go in the right segment. My question is: how to automatically distribute the contacts to the segments? Via cron jobs or API or combination of both and is it possible at all? I need something like this: contacts from a.csv goes to “a” segment, contacts from b.csv goes to “b” segment even when the CSV files are updates with new contacts I want them go automatically into the right segments. Thank you !

These errors are showing in the log:

Steps I have tried to fix the problem:

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [November 30, 2020, 7:14pm UTC](https://forum.mautic.org/t/how-to-add-contacts-from-csv-automatically-in-a-segment/17216/2 "2020-11-30T19:14:22Z")

</div>

API is probably the best way to do it, otherwise you can setup cronjob and use the Custom Import plugin to do this for you.

You also need to make sure that your segment update cronjob are running consistently.

You can find the Custom Import plugin [here](https://github.com/mtcextendee/mautic-custom-import-bundle/blob/67ab28921f7e3db309616d8a3c167a1eb6ee1e00/README.md).

---

<div class="post-metadata">

**Author:** ![chervenkov](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/chervenkov/32/719_2.png) [@chervenkov](https://forum.mautic.org/u/chervenkov)\
**Post date:** [November 30, 2020, 7:26pm UTC](https://forum.mautic.org/t/how-to-add-contacts-from-csv-automatically-in-a-segment/17216/3 "2020-11-30T19:26:36Z")

</div>

but its totally possible and i dont need to use mautic forms - i can add contacts in my own database and send it to Mautic’s segments via API or this plugin + cron jobs?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [December 1, 2020, 8:39am UTC](https://forum.mautic.org/t/how-to-add-contacts-from-csv-automatically-in-a-segment/17216/4 "2020-12-01T08:39:06Z")

</div>

hi yes this is correct …
