# External API call in HubSpot form

**URL:** <https://community.hubspot.com/t/external-api-call-in-hubspot-form/40643>\
**Category:** APIs & Integrations\
**Tags:** starter\
**Created:** [July 13, 2021, 12:44pm UTC](https://community.hubspot.com/t/external-api-call-in-hubspot-form/40643 "2021-07-13T12:44:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RintoIgnatious](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rintoignatious/32/69256_2.png) [@RintoIgnatious](https://community.hubspot.com/u/RintoIgnatious)\
**Post date:** [July 13, 2021, 12:44pm UTC](https://community.hubspot.com/t/external-api-call-in-hubspot-form/40643/1 "2021-07-13T12:44:22Z")

</div>

Hi All,

I am new to HubSpot, and I wondered if I could make an external API call from Hubspot. With on click of submit button and I want to pass the data which the user will type in my form.

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [July 13, 2021, 2:53pm UTC](https://community.hubspot.com/t/external-api-call-in-hubspot-form/40643/2 "2021-07-13T14:53:55Z")

</div>

@RintoIgnatious

You can customize the form to include an onFormSubmit callback. Here is a [link to the documentation](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options)

Another option (possibly better) would be to create a workflow with a [custom coded action](https://knowledge.hubspot.com/workflows/use-custom-code-actions-in-workflows) that would triggered on submit. This does require Operations Hub professional tier, though.

@Bryantworks might have a better suggestion 😀

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [July 14, 2021, 9:54am UTC](https://community.hubspot.com/t/external-api-call-in-hubspot-form/40643/3 "2021-07-14T09:54:28Z")

</div>

Hi @RintoIgnatious ,

Try to use ajax or serverless functions to make external api-call .To get more info about serverless functions refer to this doc [https://developers.hubspot.com/docs/cms/data/serverless-functions.](https://developers.hubspot.com/docs/cms/data/serverless-functions)

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.
