Error Code 89 Twitter token expired


My twitter app has many users but only for particular users are getting the Token Expired error when they unfollow from my application. I am aware of Rate Limits/Twitter Rules and the app is designed accordingly. I read that if the user will follow/unfollow people in bulk on same day Twitter will stop accepting the request(Aggressive churn) but my user is unfollowing people through my app 3-4 times a week and he is getting token expiry error after unfollowing about 180 people.

Any Ides? What exactly causing token expiry error? Any guidelines so that user won’t get token expiry error immediately.

If my user is caught is aggresive churn behaviour then any guidelines to overcome it.

closed #2

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.


Can you share more about the error message detail you’re receiving and how often you are getting it? Is this a single user that you have to keep re-authorizing? When you say “unfollow my application” are you referring to a user revoking your applications authorization?

Also review the Twitter follow/unfollow limits:
and rules:

opened #4


The exact Error is:-
twitter4j.TwitterException: 401: Authentication credentials ( were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
message - Invalid or expired token.
code - 89

This is only for few users not everyone who is using the application.
The user does not revoke application authorization. Its automatically revoked(I think they might be violating some rules and twitter algorithm is revoking their access).


It’s worth making doubly sure that " the system clock is in sync. " because that does indeed matter, even if the clock is off by only a few minutes it’s still sometimes enough to throw this error.


Thanks . I will ask users about the clock time, if clock time is correct will raise issue again.