A collection of methods related to the Forms API
Methods
-
Get Form, including fields, options and validation
Name Type Description formIdstring -
Get Form Fields for Specified Form
Name Type Description formIdstring Example
const hs = new HubSpotClient(props); const formFields = await hs.forms.getFormFields(formId) -
Get form submissions for specific form
Name Type Description formIdstring Example
const hs = new HubSpotClient(props); const submissions = await hs.forms.getSubmissions(formId) -
Submit a form with data See the developer docs for full spec.
Name Type Description portalIdint Portal ID the form resides on
formIdstring ID of form to submit.
formFieldsobject Key/value pairs of form fields.
Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.forms.submitForm(portalId, formId, formFields).then(response => console.log(response)); -
Submit a form with data See the developer docs for full spec.
Name Type Description portalIdint Portal ID the form resides on
formIdstring ID of form to submit.
submitBodyobject { fields, context, legalConsentOptions } see docs for full spec
Returns:
Type Description Promise Example
const hs = new HubspotClient(props); hs.forms.submitFormV3(portalId, formId, submitBody).then(response => console.log(response));