It’s defined by the service you integrated with. It should be mentioned in the API docs they provide.
That too should be described in the API docs. For another service I implemented something like this for, you get a refresh token when you first get the auth token that you can use to renew/request a new auth token. See OAuth2 using just OH Rules and myopenhab.org
You should get a specific error coffee when you make a request after the sith token has expired.