X (Twitter)

OAuth 2.0 connect, encrypted tokens, and live text tweet publishing for scheduled posts.

X live publishing is available via OAuth 2.0 PKCE. Access and refresh tokens are encrypted at rest with INTEGRATIONS_ENCRYPTION_KEY. MVP supports text tweets only — no media upload yet.

Developer portal setup

  1. Create or open an app at developer.x.com.
  2. Under User authentication settings, enable OAuth 2.0 with a Confidential client type.
  3. Set the callback URL exactly to your X_CALLBACK_URL (local default: http://localhost:3000/api/oauth/x/callback).
  4. Request scopes: tweet.read, tweet.write, users.read, offline.access.
  5. Copy Client ID and Client Secret into your server environment (never commit secrets).

Environment variables

  • X_CLIENT_ID / X_CLIENT_SECRET — OAuth app credentials
  • X_CALLBACK_URL — must match the portal callback (defaults to {APP_ORIGIN}/api/oauth/x/callback if unset)
  • INTEGRATIONS_ENCRYPTION_KEY — same vault key used for Twilio credentials

Connect in the app

  1. Open Connected Accounts in your workspace.
  2. On the X card, choose Connect with X.
  3. Authorize RallyForge in the X consent screen.
  4. You return to the workspace with your X username shown — tokens never leave the server in plaintext.

Scheduling and Test Mode

When you schedule a post that targets X, pick the connected account (required, like a Twilio sender for SMS). The cron at /api/cron/dispatch-test-posts creates a live text tweet via API v2 when the post is due (Vercel Hobby runs once daily; Pro or an external cron is needed for minute-level timing).

Test Mode does not redirect X to email. Connected X accounts still post for real so you can verify Pay-Per-Use credits cheaply. Facebook and Instagram continue to use Test Mode preview emails.

Limitations (MVP)

  • Text tweets only — media / video upload not supported yet
  • Development apps are limited by X's sandbox / pay-per-use quotas
  • Production apps and elevated access may be required for high volume

Related

All connection guides · Facebook & Instagram · Campaigns & scheduling

Documentation v2026-07-12 · Plans and limits synced with product configuration · Policies: draft-2026-07-12

Synced with tier limits (2026-07-12) · credit packs (2026-07-12) · Terms draft-2026-07-12 · Privacy draft-2026-07-12 · AUP draft-2026-07-09.

TermsPrivacyAcceptable Use

X (Twitter) — RallyForge Docs