# The best way to create contacts using API

**URL:** <https://forum.mautic.org/t/the-best-way-to-create-contacts-using-api/6863>\
**Category:** Development\
**Created:** [December 15, 2016, 5:17pm UTC](https://forum.mautic.org/t/the-best-way-to-create-contacts-using-api/6863 "2016-12-15T17:17:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sujaypawar](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sujaypawar](https://forum.mautic.org/u/sujaypawar)\
**Post date:** [December 15, 2016, 5:17pm UTC](https://forum.mautic.org/t/the-best-way-to-create-contacts-using-api/6863/1 "2016-12-15T17:17:14Z")

</div>

I’m building a custom form that will create a contact in Mautic using APIs and I’m wondering what is the best way to do this?  
  
  
  
Few considerations -

1. User might still be anonymous; but cookied  
2. Known user might be on another device, so anonymous, cookied for now. But when he submits the form, he should be merged.  
  
  
  
My Question -  
  
  

# Which API calls should be ideally used? Could I get some examples?
  
- Should new user be created? Or an existing anonymous user be updated, by tracking his ID from cookie?  
- What if the user is already known, but is on another device? In this case, he will have a different ID in cookie.  
- If user submits the form with same email address, will a duplicate contact be created in Mautic? (even if he submits the form using same email address)  
  
I would appreciate some help from fellow developers.

---

<div class="post-metadata">

**Author:** ![sujaypawar](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sujaypawar](https://forum.mautic.org/u/sujaypawar)\
**Post date:** [December 15, 2016, 5:17pm UTC](https://forum.mautic.org/t/the-best-way-to-create-contacts-using-api/6863/2 "2016-12-15T17:17:14Z")

</div>

I’m building a custom form that will create a contact in Mautic using APIs and I’m wondering what is the best way to do this?

Few considerations -

1. User might still be anonymous; but cookied
2. Known user might be on another device, so anonymous, cookied for now. But when he submits the form, he should be merged.

My Question -

# Which API calls should be ideally used? Could I get some examples?

- Should new user be created? Or an existing anonymous user be updated, by tracking his ID from cookie?
- What if the user is already known, but is on another device? In this case, he will have a different ID in cookie.
- If user submits the form with same email address, will a duplicate contact be created in Mautic? (even if he submits the form using same email address)

I would appreciate some help from fellow developers.
