Fixing the OAuth token is invalid or expired error
Written by
Updated at December 17, 2025
Issue description
The OAuth token has expired, causing the OAuth token is invalid or expired error.
Solution
An OAuth token lives 12 months. Once this time frame is over, the token will not work anymore.
The password or authentication method for the account that owns the token might have changed. For the full list of possible causes of token invalidation, see this Yandex ID article
To get a valid OAuth token, run a request
For working with the YC CLI, you may want to use a service account through an authorized key. For more details, check out this article on authenticating on behalf of a service account.