# Oauth

**URL:** <https://community.hubspot.com/t/oauth/35916>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [April 21, 2021, 6:26pm UTC](https://community.hubspot.com/t/oauth/35916 "2021-04-21T18:26:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SJasmer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sjasmer/32/64675_2.png) [@SJasmer](https://community.hubspot.com/u/SJasmer)\
**Post date:** [April 21, 2021, 6:26pm UTC](https://community.hubspot.com/t/oauth/35916/1 "2021-04-21T18:26:37Z")

</div>

_We’re adding the Tickets API to our platform so our users can see the status of their support cases. I need details of “server-to-server oAuth workflow” for HubSpot APIs integration._

---

<div class="post-metadata">

**Author:** ![tominal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tominal/32/73018_2.png) [@tominal](https://community.hubspot.com/u/tominal)\
**Post date:** [April 21, 2021, 10:18pm UTC](https://community.hubspot.com/t/oauth/35916/2 "2021-04-21T22:18:21Z")

</div>

Hi @SJasmer,  
There are many options to achieve what I imagine you’re trying to do. If you mean the OAuth process, it is explained in detail here: [Working with OAuth - HubSpot docs](https://developers.hubspot.com/docs/api/working-with-oauth)  
You can also use workflow webhooks to talk to an external server: [How to Trigger Webhooks in HubSpot Contact-Based Workflows](https://knowledge.hubspot.com/workflows/how-do-i-use-webhooks-with-hubspot-workflows)  
Hope that helps!

---

<div class="post-metadata">

**Author:** ![mobyvb](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mobyvb](https://community.hubspot.com/u/mobyvb)\
**Post date:** [September 7, 2022, 7:49pm UTC](https://community.hubspot.com/t/oauth/35916/3 "2022-09-07T19:49:44Z")

</div>

Edit: I received a solution on this post [https://community.hubspot.com/t5/APIs-Integrations/How-can-I-replace-my-API-key-with-Oauth-and-remain-automated/td-p/692369](https://community.hubspot.com/t5/APIs-Integrations/How-can-I-replace-my-API-key-with-Oauth-and-remain-automated/td-p/692369)  
Original message:  
Hey @tominal , I am struggling with the same issue as @SJasmer , but the documentation you’ve shared has not gotten me closer to understanding a solution. The part I am not sure about for server-to-server workflows is this, from the “working-with-oauth” link:

_Send users installing your app to the authorization URL, where they’ll be presented with a screen that allows them to select their account and grant access to your integration. After granting access, they’ll be redirected back to your application via a redirect\_url, which will have a code query parameter appended to it. You’ll use that code and the client secret to get an [access\_token and refresh\_token](https://developers.hubspot.com/docs-beta/oauth/tokens) from HubSpot._

Our app is currently interacting with Hubspot on the backend (no client-side interaction with Hubspot), using a Hubspot API Key. Hubspot API Keys are being sunsetted, so we need to replace it with an alternative (see [https://developers.hubspot.com/changelog/upcoming-api-key-sunset](https://developers.hubspot.com/changelog/upcoming-api-key-sunset))

We cannot migrate to a private app as the documentation I link suggests, so rather, we need to replace API-key authentication with Oauth. Is there a way to do this, completely automated on the server-side without requiring someone to authenticate via a browser?
