Refresh token

Hi. I need an access token for account that can be connected using oauth: https://developer.m-files.com/APIs/REST-API/Authentication/#connecting-via-oauth

When I follow the documentation and I receive access token via https://login.m-files.com/connect/token (TokenEndpoint property retrieved using "/server/authenticationprotocols"). I get following response:

{
"id_token": "<id_token>",
"access_token": "<access_token>",
"expires_in": 3600,
"token_type": "Bearer",
"refresh_token": "<refresh_token>",
"scope": "openid mfiles://***.cloudvault.m-files.com offline_access"
}

I can use <access_token> without issues, but when it probably expires and I start getting 403, I don't know how to get new access token without having to manually retrieve the code for https://login.m-files.com/connect/token again.

I couldn't find it in the documentation and when I've tried to use <refresh_token> instead of code in https://login.m-files.com/connect/token , I've received {"error":"invalid_grant"}.

How can I retrieve another <access_token> without having to manually retrieve token first?