# Bad Request for url: https://api.hubapi.com/oauth/v1/token

**URL:** <https://community.hubspot.com/t/bad-request-for-url-https-api-hubapi-com-oauth-v1-token/130631>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [April 26, 2025, 2:29pm UTC](https://community.hubspot.com/t/bad-request-for-url-https-api-hubapi-com-oauth-v1-token/130631 "2025-04-26T14:29:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GKaur23](https://avatars.discourse-cdn.com/v4/letter/g/f05b48/32.png) [@GKaur23](https://community.hubspot.com/u/GKaur23)\
**Post date:** [April 26, 2025, 2:29pm UTC](https://community.hubspot.com/t/bad-request-for-url-https-api-hubapi-com-oauth-v1-token/130631/1 "2025-04-26T14:29:23Z")

</div>

I created the hubspot integration in my platform, when the code to refresh access token is hit via dev environment it works fine but when the same code to refresh token is hit via prod environment, I get this issue of bad request, I checked everything seems to be same bw both the environments, can somebody help me fix this issue?

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [April 28, 2025, 8:51am UTC](https://community.hubspot.com/t/bad-request-for-url-https-api-hubapi-com-oauth-v1-token/130631/2 "2025-04-28T08:51:59Z")

</div>

Hi @GKaur23 and welcome, we are so glad to have you here! 🤗  
Thanks for asking the HubSpot Community!  
I have found a similar thread where the solution from @mateuszg on this post “[BAD\_REFRESH\_TOKEN while trying to refresh token](https://community.hubspot.com/t5/APIs-Integrations/BAD-REFRESH-TOKEN-while-trying-to-refresh-token/m-p/371278)” might help you!  
Also, I’d love to put you in touch with some of our Top Experts: Hi @coldrickjack, [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811), @RMelliti, @tjsimpson and @himanshurauthan do you have suggestions to help @GKaur23, please?  
Have a lovely day and thanks so much in advance for your valuable contributions! ❤  
Bérangère
