429 (Too Many Requests) vs. 403 (Forbidden) HTTP Error Codes. By which criteria does either appear?


According to the documentation (https://dev.twitter.com/docs/api/1.1/post/favorites/create) there’s no official rate limit on creating favorites.

However, I’ve noticed that my app usually hits a limit on 1000 favorites created (daily), when it receives an error response with a Too Many Requests header error (429). Fine, it’s a completely fair limit which I assume has been set to avoid spammy purposes.

But the problem is, yesterday I was running another test with my app to check how it handles the situation when it receives a 429 code (assuming it’s received when the limit has been hit). Surprisingly, the API didn’t return any error when I reached 1000 favorites so my test continued sending them, waiting for the 429 Response Code that makes it stop. Instead, on my 1122th favorite created, I received a 403 (Forbidden) Response Code, with a Twitter error code 64 and an accompanying message: “Your account is suspended and is not permitted to access this feature”.

I’ve already reactivated my account. But I’m still wondering why the 429 Response Code didn’t appear in advance of the suspension. Is there any best practice that I might not be aware of in that regard?