Retries

Premium - Paid only

Enterprise

One of the benefits of the paid premium and enterprise tiers of the Account Activity API is a retry mechanism for webhook events. If a 'success' 200 HTTP response code is not received, the Twitter server will initiate a retry mechanism, resending the webhook event up to three times over a five-minute period. This webhook event retry service helps provide reliability and event recovery when network problems occur and during client-side service interruptions and deploys.
 

What are retries?

The Account Activity API provides a retry feature when the client's web app does not return a 'success' 200 response for an account activity webhook event. When the client-side does not confirm the successful receipt of an event, Twitter assumes the event was not received. If a non-200 response is received, a response isn't received within three seconds, or we don't receive a response at all, we retry the request and leave that open for ~1.75 seconds. This means that you have roughly five seconds over two attempts to respond to receive the activity that we are trying to send to your webhook URL. In the event that your server doesn't response or returns a transient error, we will retry for ~four hours, sending a new request every ~30 minutes. This means that you have eight attempts to confirm validation. This allows redundancy and insurance that you receive all webhook events. Note that subscriptions with retries will get retried events for any/all activities for all subscribed users on their webhook.

If you do not confirm validation within these eight attempts, the activity will no longer be available via the Account Activity API. 

Retry timeline

The Account Activity API will retry up to three times over a 5-minute period until a 200 response is received.  Refer to the table below for more details. After 5 minutes, the activity cannot be resent through the Account Activity API and you will need to use other Twitter endpoints to collect missed data. For example, the search APIs can be used to retrieve relevant Tweets, Retweets, Quote Tweets, Mentions, and Replies. Missed Direct Messages can be retrieved with this endpoint.

Retries timeline

Activity created, POST to the webhook URL from Account Activity API
Wait 5 seconds, POST to the webhook URL from Account Activity API
Wait 30 minutes after activity created, POST to the webhook URL from Account Activity API
Wait 1 hour after activity created, POST to the webhook URL from Account Activity API
Wait 1 hour and 30 minutes after activity created, POST to the webhook URL from Account Activity API
Wait 2 hours after activity created, POST to the webhook URL from Account Activity API
Wait 2 hours and 30 minutes after activity created, POST to the webhook URL from Account Activity API
Wait 3 hours after activity created, POST to the webhook URL from Account Activity API
Wait 3 hours and 30 minutes after activity created, POST to the webhook URL from Account Activity API
After four hours, Account Activity API will stop attempting to POST, Client must use other Twitter endpoints to recover data

 

Next steps