Send external form data to hubspot

I have a wordpress registration form and how can I send data from that form to hubspot, I need more explanatory information, someone who can help me.

query link

https://developers.hubspot.com/docs/methods/forms/submit_form

Hi @btc2 ,

What difficulties are you currently facing? The documentation you linked is our forms API which is typically used to integrate an external form to HubSpot. It’s particularly useful if you want to have total control of the form look/feel and submission logic whilst ensuring the data captured is securely sent to HubSpot.

I’m happy to answer any specific questions you might have. Some other ideas might be to consider using an embedded hubspot form in place of the current form?

- Jack

I have a registration form for a community, but it is an external hubspot form, I integrate the API code in PHP language, with the portal and form data.

Hi @btc2 ,

The issue is with the URL you are posting to. You currently have:

/submissions/v2/post/upload/{portalId}/{formGuid}';

Whereas it should be:

/submissions/v2/post/upload/portalId/formGuid';

In otherwords you need to remove the “{” and “}” symbols. Can you try that and let me know.

Jack

connected successfully thanks, but send the form with empty fields to hubspot,

the fields in my web form are almost equal to the form I created in Hubspot, the difference is the password fields that are not included in the Hubspot form.

Thats good to hear @BT . One thing I would say is that you should not be storing password information in your HubSpot portal. For everything else you can include it in your POST request. Typically the process looks something like this:

I have a form with the following fields:

<form id="contact-form" method="post" action="submit.php">
  First Name:<input type="text" name="firstname">
  Last Name:<input type="text" name="lastname"> Email Address: <input type="text" name="email">
  Country:<input type="text" name="country">
  <input type="submit" value="Submit">
</form>

Then in my submit.php file I would have to get the data from the POST array:

$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$country = $_POST['country'];

Then I would formulate my string of data I want to post like this:

$str_post = "firstname=" . urlencode($firstname) 
 . "&lastname=" . urlencode($lastname) 
 . "&email=" . urlencode($email) 
 . "&country=" . urlencode($country) 
 . "&hs_context=" . urlencode($hs_context_json); 

And make the POST request. The data should be updated accordingly. It’s important to note that the fields I include in the code above are the internal property values of the HubSpot properties I wish to update.

Also worth noting the “hs_context” parameter is very important. That is used to pass meta data relating to the form submission into HubSpot. It can associate a contact record in HubSpot to the usertoken/cookie on the browser.

Let me know if this helps!

- Jack

Hi @RodrigoGomes, I hope that you are well!
Thanks for the additional information.
I will check internally for you and I will get back to you as soon as possible.
Thanks for your patience!
Have a nice day!
Best,
Bérangère

Hi, seems that captcha is not allowed, so how can we control for example bot submissions? or implement more security?

yes i am also looking for the similar answer and the site for which i need suggestions is hosted on wordpress plzguide if you guys know about the right way i need the guidance very urgent to move my data.

I have the same question please help me get out of this

No idea having the same issue please help me get out of this problem

I’m developing a new solution, but I have this same issue, there is a way in the older API, but I can’t be able to find on new API. I’m using private App.

where can I find “Submit data to a form” in the new API?

Hi @RodrigoGomes and all, I hope that you are well!
Thank you for reaching out to the Community!
For more visibility, I’d recommend creating a new post.
I understand that you’d like to submit data to a form via API. Or are you using an external form and you’d like to see the form submissions into HubSpot?
Have you already checked this documentation “Submit data to a form” about this.
Also, if the question is about API and development, I recommend posting on the Developers Forum here.
I’d like invite a couple of subject matter experts to this conversation: Hi @zach_threadint, @Teun and @Jnix284 do you have suggestions to help @RodrigoGomes, please?
If anybody else has anything to add and/or share, please feel free to join in the conversation :slightly_smiling_face:
Thank you very much and have a great day!
Best,
Bérangère

Hi @RodrigoGomes as @BérangèreL shared, you’ll need the documentation linked to submit data for a form from the latest stable version of the forms API, which isn’t part of the Marketing API Forms Beta that you’ve linked to.

Bérangère, thanks for response. I already solved my problem just using “Submit data to a form”, and works very well, but the biggest problem that i don’t know how much time this still works. Because the doc say that’s legacy doc.

Hi @RodrigoGomes,
Thanks for your patience!
So, to clarify, ‘legacy’ is just referring to the documentation, not the APIs themselves.

APIs provided on the legacy docs are still supported. On developer documentation overview found here 2026-03 API reference - HubSpot docs, you’ll see we have a banner which says: Looking for an older version of the API? They are still stable and supported. Go to legacy docs.

For the specific documentation you’re referring to, the Submit data to a form: https://legacydocs.hubspot.com/docs/methods/forms/submit_form_v3_authentication, is still the correct API to use. It can be only found in our legacy docs and is just referenced by our current developer docs (Accounts Dashboard | HubSpot).

I hope this helps to clarify, but please do let me know if you have any further questions on this!
Thanks and have a lovely day!
Best,
Bérangère