API authentication in AWS Lambda function in Custom Workflow Action (public app)

Hello,

The way that you would want to do it is by storing the Oauth creditials first through a different flow, and then have the Lambda function pull from the Oauth credentials. You would want to do it through the following flow:

  1. Verify the request came from HubSpot.
  2. Identify the portalId from the payload.
  3. Look up that portal’s stored refresh token.
  4. Exchange the refresh token for an access token (if needed).
  5. Call HubSpot APIs with that access token to assign an owner by updating hubspot_owner_id on the contact.

Here are some OAuth Docs from the old docs:

There is also the new development platform that now sets apps as marketplace, or allows private apps to authenticate through Oauth. The docs are found here:

Let me know if this helps, or if you have any other questions!


:check_mark: Was I able to help answer your question? Help the community by marking it as a solution.

Brandon Woodruff
Senior Software Developer @ PearagonStill have questions? Reach out at brandon@pearagon.com