Request for Assistance to Update Form Data in HubSpot Using Email ID Match

We are encountering an issue regarding the functionality of a custom HTML form created in PHP. Our requirement is to submit the form data and insert it into a specific form in HubSpot.

Based on our research, we are using the following API endpoint to achieve this:

API
This API allows us to insert data into a specific form, which meets our initial requirement. However, we are now looking for a functionality that would allow us to update the inserted data by matching the email ID.

In essence, after a data entry has been inserted, we want to be able to update this data using the matching email ID as the reference point.

We have been unable to find a solution to this requirement. Could you please assist us in resolving this issue? We kindly request your prompt response to this matter.

Thank you for your assistance.

Hi @DTeam07,

Typically, if there is an existing email in HubSpot CRM, the contact record would automatically get updated by the form submission - it would not create a separate contact with the same email address, as it is the unique ID, so the form submission through API should have you covered.

However, if you are looking to do something in addition to that, you might want to take a look at HubSpot’s Contacts API, in particular the upsert endpoint. This endpoint allows updating existing contacts and creates new ones if the unique identifier has no match. There are PHP examples in the documentation as well.

Hope this helps!

Thank you for your response.

Please confirm if we should use the following API for inserting and updating data: https://api.hsforms.com/submissions/v3/integration/secure/submit/:portalId/:formGuid.

Yes, you can use that API endpoint to create form submissions. It will create new contact records if there is no match for the email entered and it will update records if email already exists.

@DTeam07 - I’d initially recommend the use of the secure API submit call:

https://api.hsforms.com/submissions/v3/integration/secure/submit/:portalId/:formGuid

Otherwise, as proposed by @evaldas, I’d use the Upsert call for all the other functionality.

Steve