Trouble with endpoint



I'm trying to send an HTTP Post to a HubSpot form, but I'm not getting a post response back.
The endpoint url I was using was, which I found in the form's code under form action=...

On your Submit Data To A Form via Ajax page it looks like the endpoint should instead use this structure: Can you clarify which I should be using?

Please help!



Here's the form URL by the way -


Hi @Matt9,

To submit a form with AJAX, you should use the endpoint, as outlined here.

I'm curious, though, can you point me to the page where you found the formsnext/multipart URL?


@Isaac_Takushi Ahh ok!

Can you confirm that the Content Type should be application/json?

I found the /formsnext/multipart URL in the code for this form - It appeared that the form was posting to that URL, so that's what I tried using.

Also, just to be clear, would either the v2 or v3 endpoints work for the same form (assuming I'm not using Ajax)? Or is there a setting with the form that dictates which endpoint is able to be used? Sorry, I'm new to a lot of this!


Good to know, @Matt9! It seems the "public" form URL uses a different endpoint. For your purposes, you should use the URLs specified in our developer documentation.

Yes, I can confirm the v3 endpoint uses the Content-Type application/json. The v2 endpoint, on the other hand, uses application/x-www-form-urlencoded.

Finally, yes, either the v2 or v3 endpoints will work for the same form. Only the v3 endpoint accepts AJAX (CORS) requests, though.


Thanks @Isaac_Takushi.

I just tried putting a test post through to the v3 endpoint for a different form and received the following error: {"status":"error","message":"Invalid input JSON on line 1, column 11: Unrecognized token 'firstname': was expecting 'null', 'true', 'false' or NaN","correlationId":"a0335b16-37eb-4f2d-ba61-65aeece38634","requestId":"59484d5d6ece893b3c0cdb2d3450c44a"}. The first parameter I was trying to post was firstname=John.

Any idea what the problem is?


Hi @Matt9,

That error generally denotes a syntactical error. Would you share the full payload you attempted to send?



I'm trying to send the post through from a lead management platform called LeadsPedia. Here's the post info:

Post Request

Request URL:

Post Parameters:
firstname=John&lastname=Smith&jobtitle=Marketing&company=Better Buys& 6 Months&asset_name=Top 15 Report&country=&company_size=250&sic_code=1234&industry=Media

Post Response
{"status":"error","message":"Invalid input JSON on line 1, column 11: Unrecognized token 'firstname': was expecting 'null', 'true', 'false' or NaN","correlationId":"a0335b16-37eb-4f2d-ba61-65aeece38634","requestId":"59484d5d6ece893b3c0cdb2d3450c44a"}

Does that give you any insight?


Hi @Matt9,

Sincere apologies for the delayed response. Somehow your message fell through the cracks.

You are receiving that error because your post body is formatted as a query string instead of JSON. The v2 Forms API endpoint accepts that format, but you'll need to use a JSON-formatted body for the v3 endpoint.

Instead of:



  "fields": [
      "name": "email",
      "value": ""
      "name": "lastname",
      "value": "Smith"