HubSpot Contacts API

Hello guys,

I need some help. Whenever a form submission is made I create a new contact via the Contacts API together with some custom properties per the clients requirements.

As you guys know when a new Contact is created it needs to have an unique email. If the email is not unique it returns an error. In that case I want to create a lead for that Contact. So if a Contact is already created in HubSpot and that same Contact makes another form submission, I need to save that information.

This is where I am stuck, I do not know how to save this new information- what API should I use?

P.S. This is my whole logic:

  1. new submission
    1. create new contact
  2. email already used (they are submitting for a second, third or 4th time)
    1. create new lead(or whatever is the equivalent in Hubspot) pointing to existing contact

Thank you in advance for any reply! :blush:

Hi @ilir-test ,

I would like to advise you to look at the Form Submission API instead. If you use this API, you can also send the tracking data with it using the UTK cookie.
Combined with a workflow, you could achieve what you want.

Thank you for the reply Teun. Unfortunately this is not a solution, I am not facing any issue with the form. I need to create multiple leads(or whatever the equivalent is in HubSpot) for a single contact.

I want to know how to achieve this because I save the information for clients in Contacts.

Hi @ilir-test ,

HubSpot does not have a ‘lead’ object available. If it is an opportunity, you could try using the ‘Deals’ instead. There can only be one contact with the same e-mail address. Could you describe the case here? What is the business, what form is the contact submitting etc.?

Hi @Teun ,

I tried using the Deals API but there is not an option to create custom properties like the custom properties I have in Contacts.

The client has a website where he collects information about potential clients. This information includes: email, firstname, lastname, phone number and some other custom properties. I then use the HubSpot API to create a Contact for that potential client. This part is working fine.

Now when an existing Contact submits new information I do not want to update or delete the existing Contact. I want to have another record with this new information that is linked with the existing Contact.

I am not able to find this in HubSpot. Thank you for taking your time and helping me find a solution!

Could you explain why you need a second contact? If you combine the tracking script with the Form Submission API, you will have all activity, including form submissions, on the contacts timeline.

I do not need a second Contact, If a Contact exists and a client has submitted new information I want to store that information on a new record-however it is possible in HubSpot(I understand a second Contact cannot be created). The logic here is that the client can make multiple submissions.

I use a custom form on my website and send the Contact information through Contact API.

Could you explain your answer, will using your suggestion allow creating multiple records even if they have the same email?

Hi @ilir-test ,

Makes sense!

In a sense, yes, it will create a new record for a form submission on the contact object. So a contact can have multiple form submissions stored in HubSpot. Each submission can be used in reports, workflows etc.

Each submission can be viewed on the contacts timeline. So Contact → Submissions

Hi again @Teun ,

I tried your solution and when I make a form submission with a new email address(not part of Contact records), HubSpot correctly creates a new Contact record.

But when I make a form submission with an existing email address, HubSpot updates the existing Contact record with the new information. How do I view the initial Contact record information?

P.S. I am trying to see the Contact record history, with the submission information for each one!

Thank you @Teun for the help. What you suggested was correct and it helped me find a solution.

Another HubSpot community member @Josh helped me find Contacts record history and the submissions for that contact.

Ignore the previous comment :blush:

Happy to hear you found a solution! Sorry that I didn’t respond today, but luckily, there are a lot more awesome members in this community.