Retweet cleanup with scheduling for X/Twitter
Who’s it for Social media managers, creators, and brand accounts that rely on retweets for reach but want an automated, hands-off cleanup after campaigns to keep profiles tidy and on-brand. What it does / How it works...
Template notes
Who’s it for
Social media managers, creators, and brand accounts that rely on retweets for reach but want an automated, hands-off cleanup after campaigns to keep profiles tidy and on-brand.
What it does / How it works
On a schedule, the workflow resolves your handle to a user ID, fetches recent tweets, filters retweets only, and safely unretweets them using batching and delays to respect rate limits. A dedicated CONFIG (Set Fields) node centralizes variables (e.g., targetusername, maxresults, batchdelayminutes) so you can adjust behavior without touching logic.
API endpoints used
GET /2/users/by/username/{username} – resolve handle → user ID GET /2/users/{id}/tweets?tweet.fields=createdat,referencedtweets – fetch recent tweets (identify retweets via referencedtweets.type === "retweeted") DELETE /2/users/{id}/retweets/{tweetid} – unretweet
Example response payloads
GET /2/users/by/username/{username}