Subscribe to account activity
Premium - Paid only
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, or no response at all, the Account Activity API will retry posting/sending that specific event to your webhook after 3 seconds. If there is still no 'success' 200 response received, it is posted again after 30 seconds, and again at 5 minutes. 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.
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.
Exponential retries timeline
|Activity created||Time = 0s, POST to the webhook URL from AAA|
|If non-200 response||Wait 5 seconds, Time = 3s, POST to the webhook URL from AAA
|If non-200 response||Wait 30 seconds, Time = 33s, POST to the webhook URL from AAA
|If non-200 response||Wait 5 minutes, Time = 5m33s,POST to the webhook URL from AAA
|If non-200 response||Stop, Client must use other Twitter endpoints|
- Learn more about:
- See Account Activity API references.
- See example code: