# Associate Contact with Company - automatic?

**URL:** <https://forum.mautic.org/t/associate-contact-with-company-automatic/27548>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [March 29, 2023, 9:15pm UTC](https://forum.mautic.org/t/associate-contact-with-company-automatic/27548 "2023-03-29T21:15:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [March 29, 2023, 9:15pm UTC](https://forum.mautic.org/t/associate-contact-with-company-automatic/27548/1 "2023-03-29T21:15:10Z")

</div>

When a contact completes a webform in Mautic, that includes a “Company” form field for the contact to share their company details, to which Mautic field should this data appropriately be stored? The contact core field “company” (as in, {contactfield=company}, also called “Primary company”)?

If yes to the contact “company” field, which is what I’ve normally done, this data is stored as a string of text. Is this supposed to auto-populate a new company? Is that a cron job?

A couple thoughts… Editing this contact manually will erase any data stored in that field, if it’s not synced with a Company in Mautic.

The process of creating a company manually, is tedious. I don’t anticipate anyone is doing this manually, at-scale. So then, what is the appropriate process for new contacts to become associated with their respective companies within Mautic?

I have the option of creating the company remotely by API, but then how to associate that with the appropriate contact?

Thanks for all insight.

EP

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 30, 2023, 6:05am UTC](https://forum.mautic.org/t/associate-contact-with-company-automatic/27548/2 "2023-03-30T06:05:54Z")

</div>

Hi, you can link a company with a contact with the

`POST /companies/COMPANY_ID/contact/CONTACT_ID/add` call  
and remove:  
`POST /companies/COMPANY_ID/contact/CONTACT_ID/remove`

More info:  
[https://developer.mautic.org/#add-contact-to-a-company](https://developer.mautic.org/#add-contact-to-a-company)

When you import, you should use the Primary company name as merge field for company name.

---

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [March 30, 2023, 7:52pm UTC](https://forum.mautic.org/t/associate-contact-with-company-automatic/27548/3 "2023-03-30T19:52:38Z")

</div>

😍 😍 😍  
This is why you make the big bucks, Joey. I somehow missed this in the docs. Thank you so much for sharing.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 30, 2023, 10:20pm UTC](https://forum.mautic.org/t/associate-contact-with-company-automatic/27548/4 "2023-03-30T22:20:45Z")

</div>

Lol! What big bucks? 😉
