Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Refreshing the API token

This site may earn commission on affiliate links.
I have been checking out different codes, which refresh the API tokens, but for whatever reason it does not work for me. I used a third party app to generate the first (bearer and refresh) tokens and then used the refresh token from there to refresh it. Like this:
Bash:
curl -i -X POST https://auth.tesla.com/oauth2/v3/token -H "Content-Type: application/json" -d '{"grant_type":"refresh_token","client_id":"ownerapi","refresh_token":"eyJhbGciO...","scope":"openid email offline_access"}'
But am getting this in response:
HTTP/2 403


HTML:
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>

You don't have permission to access "http&#58;&#47;&#47;auth&#46;tesla&#46;com&#47;oauth2&#47;v3&#47;token" on this server.<P>
Reference&#32;&#35;18&#46;12321060&#46;1651729979&#46;29c4eb13
</BODY>
</HTML>


Anyone got any idea, what am I doing wrong?