# Creating a workflow based on an API trigger

**URL:** <https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888>\
**Category:** APIs & Integrations\
**Tags:** workflows\
**Created:** [March 9, 2021, 1:46pm UTC](https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888 "2021-03-09T13:46:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElliePaige](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/elliepaige/32/68963_2.png) [@ElliePaige](https://community.hubspot.com/u/ElliePaige)\
**Post date:** [March 9, 2021, 1:46pm UTC](https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888/1 "2021-03-09T13:46:49Z")

</div>

Hi, We are wanting to start a workflow based on an API. This would be to send a password reset email out to the client. Is this possible to do and if not, what would the workaround be for this please?

Thanks!

---

<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:** [March 9, 2021, 3:40pm UTC](https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888/2 "2021-03-09T15:40:04Z")

</div>

Hey @ElliePaige

What API would be triggering this workflow? @tjoyce , with the limited information, do you have any advice?

---

<div class="post-metadata">

**Author:** ![ElliePaige](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/elliepaige/32/68963_2.png) [@ElliePaige](https://community.hubspot.com/u/ElliePaige)\
**Post date:** [March 9, 2021, 3:42pm UTC](https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888/3 "2021-03-09T15:42:42Z")

</div>

Hi Dennis, thanks for replying back. If a user clicks the ‘forgot password’ button on our site, we ideally wanted to indlue the API of this to trigger the workflow which includes their details and the link in the email for them to reset their password. However, I’ve now looked further into this and seen that a webhook or behaviour events can be used, however we don’t have enterprise.

I think the only workaround at the moment is to use the page view trigger, so once a user has clicked ‘forgot password’ it leads them to a page that says they’ll be getting an email and we use that URL to start the workflow.

Unless there is another way?

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [March 9, 2021, 7:22pm UTC](https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888/4 "2021-03-09T19:22:37Z")

</div>

@ElliePaige - What I do is create 2 properties on the contact PASSWORD\_RESET\_URL and PASSWORD\_RESET\_REQUESTED (both single line text fields). When a user hits the reset password button, the API puts the unique pw reset link into the PASSWORD\_RESET\_URL and the UTC timestamp into the PASSWORD\_RESET\_REQUESTED.

Then I create a workflow with the trigger of:

PASSWORD\_RESET\_REQUESTED → changes && PASSWORD\_RESET\_REQUESTED not empty (so you don’t send this email when the contact is created)

Then let the workflow send your pw reset email with the PASSWORD\_RESET\_URL variable.

I’m sorry, I don’t have a solution for you that doesn’t require workflows… would love to see you answer your own question if you find a good way to do it without workflows capability

---

<div class="post-metadata">

**Author:** ![ElliePaige](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/elliepaige/32/68963_2.png) [@ElliePaige](https://community.hubspot.com/u/ElliePaige)\
**Post date:** [March 10, 2021, 10:27am UTC](https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888/5 "2021-03-10T10:27:47Z")

</div>

Hi, Thanks for this!

I’ve created the properites and set up the workflow trigger so that the PASSWORD\_RESET\_REQUESTED is known. Then within the email itself, how would I include the PASSWORD\_RESET\_URL variable so that the user can click on the link to reset their password?

Thanks

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [March 10, 2021, 10:53am UTC](https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888/6 "2021-03-10T10:53:22Z")

</div>

@ElliePaige - My server is usually laravel, so I generate the password reset in my laravel application and then add the value of that generated password reset link to the contact property PASSWORD\_RESET\_URL by using the HS API.

So basically, when you use the HS API to update the contact properties, you will pass

PASSWORD\_RESET\_URL =\> url generated from your own server

PASSWORD\_RESET\_REQUESTED =\> timestamp()

---

<div class="post-metadata">

**Author:** ![ElliePaige](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/elliepaige/32/68963_2.png) [@ElliePaige](https://community.hubspot.com/u/ElliePaige)\
**Post date:** [March 11, 2021, 8:58am UTC](https://community.hubspot.com/t/creating-a-workflow-based-on-an-api-trigger/32888/7 "2021-03-11T08:58:03Z")

</div>

Thanks for your help. We’ve set all this up now and are ready to test it.
