Connect your next chapter.
Clearpost is built. These settings connect your account and enable the first real cleanup.
1. Create your X developer app
Open the X Developer Console. Describe the initial use truthfully: a private proof of concept that deletes posts from your own account using X’s official API. Disclose a commercial use case separately before expanding to customers.
- Create an app and enable OAuth 2.0 user authentication.
- Choose a confidential Web App and request read and write access. X’s write scope also permits posting; Clearpost only implements deletion.
- Set the callback to
https://clearpost.to/api/auth/callback. The URL must match exactly. - Set the website, privacy, and terms URLs to this deployment’s homepage,
/privacy, and/terms. - Save the Client ID and Client Secret directly in your server environment. Do not paste secrets into chat or client-side code.
2. Set the server environment
In Vercel, open this project → Settings → Environment Variables. Configure APP_URL, APP_SECRET, X_CLIENT_ID, X_CLIENT_SECRET, X_ALLOWED_USERNAMES, and DATABASE_URL. The source includes a commented .env.example.
Generate a 32-byte random hexadecimal app secret. Restrict X_ALLOWED_USERNAMES to your X handle. Connect a dedicated Supabase PostgreSQL database using its transaction-pooler URL. Apply the private Clearpost schema migration first and use the restricted runtime role. Keep the Data API and automatic table exposure off. Local development uses embedded PostgreSQL.
3. Prepare a preview
Connect your account, then upload data/tweets.js from your X archive. Archive processing reads JSON; it never executes the JavaScript file. Reposts and likes are excluded from this version.
Review the selected account, post count, dates, pinned-post exclusion, and sample text. The selection is frozen when you create the preview; future posts are not added.
4. Enable the first live test
Check the current price of DELETE /2/tweets/:id in your X console. Set X_DELETE_COST_MICRO_USD to the confirmed rate, then set X_DELETE_PRICE_CONFIRMED=true. Keep a budget above the selected job’s expected cost and below your chosen maximum.
Set LIVE_DELETION_ENABLED=true and redeploy. Return to the existing preview, choose your API spending cap, and type the account-specific confirmation to start. X API usage is billed to your developer account; Clearpost does not collect payment in this PoC.
Deletion is permanent. Keep a copy of your archive. A stop request prevents further requests, but a deletion already in flight may finish. Only successful X responses are counted as confirmed deletions; unavailable posts are listed separately.