Using atlassianHostRestClients.authenticatedAsAddon() is throwing 401 errors some times

Using atlassianHostRestClients.authenticatedAsAddon() is throwing 401 errors in some cases
My webhook registration is failing some time as below.Can you please let me know why does this happen so?
The sample snippet as below
atlassianHostRestClients.authenticatedAsAddon()
.put(String.format(WEBHOOK_REGISTER_URL,cloudURL), request);
It is happening the same for other rest apis like migration s3 data url download.

	return atlassianHostRestClients.authenticatedAsAddon().getForEntity(String.format(apiURL, cloudUrl, uriVariable), String.class);
}

Can you please throw some light on what is causing these 401 errors and how to avoid it?

@AparnaMokkapati please raise the log level of RestTemplate using logging.level.org.springframework.web.client=DEBUG , as described in this StackOverflow post.