Update secrets value using custom code

Hi everybody!!! Happy Summer!!!
So.. Once again its me looking for answers :sweat_smile:
The thing is, I have a custome code in a workflow, this custom code inputs secrets, the access token and the refresh token for whatever API. I need to update the access token using the refresh token when access token get declined, as always, one last and thing, Im using python.
Hope that someone can helps me with this situation, been looking on forum and documentation but nothing that can fullfil my situation.

Hey, @rechavar :waving_hand: Thanks for the question. Let’s see if we can get the conversation started — @taran42 do you have any thought on if this is possible? Or what additional details @rechavar can provide to give more context here?

Thank you! — Jaycee

@rechavar This isn’t a task that I am familiar with performing myself, so I can only make a recommendations.

I’d start by checking out the Hubspot documentation here: Refresh OAuth 2.0 access token

There’s also a good article detailing the process here: How to get HubSpot API key and Access Token

Mmmm not what i need, look, i have the access token an the refresh token of other API. The thing is, this values are input in my custom code as secret, but the custome code needs to change the access token using the refresh token when the AT fails in the authentication process. so… how can i change these secrets using python as my programming lenguage in the custome code??

I have the same requirement here: https://community.hubspot.com/t5/HubSpot-Ideas/Refreshing-custom-code-secrets/idi-p/561010

Thanks for sharing! I added an upvote :white_check_mark:

Hello everyone, do we have any updates on this one? It’s a requirement I also need . TY!