Did you check the rest of the forum? The post below yours gives the correct answer…
I also run a number of reports from FreeAgent every night using the API. I just give the scripts the refresh token and get the scripts to refresh and get a new access token whenever they need it