Skip to main content

How do I post to X (Twitter) with an API?

Send a request to Upload-Post with platform[]=x: POST https://api.upload-post.com/api/upload_text for tweets and threads, POST /api/upload for video and POST /api/upload_photos for images. Upload-Post posts through its own X API access, so you don't need to buy an X API tier or manage X OAuth yourself. Just connect the X account once in the dashboard. Text longer than 280 characters is automatically split into a well-formatted thread (override with x_long_text_as_post=true).

Steps

  1. Create an account at upload-post.com and generate an API key under API Keys (Authentication).
  2. Connect the X account at Manage Users (or via a white-label JWT link for your users).
  3. Post a tweet:
curl \
-H 'Authorization: Apikey your-api-key-here' \
-F 'user="test"' \
-F 'platform[]=x' \
-F 'title="This is my tweet content!"' \
-X POST https://api.upload-post.com/api/upload_text

Threads, video and images

  • Threads: just send long text. Paragraphs are grouped up to 280 chars per tweet and posted as a thread, with media attached to the first tweet. Details in Upload Text.
  • Video: POST /api/upload with platform[]=x (Upload Video).
  • Images: POST /api/upload_photos takes up to 4 images per tweet; more images are split across a thread controlled by x_thread_image_layout (Upload Photo).

Useful X parameters

Full list in the Upload Video and Upload Text references:

ParameterWhat it doesDefault
x_titleX-specific text (falls back to title)title
x_long_text_as_postPublish long text as a single post instead of a threadfalse
reply_to_idReply to an existing tweetnone
community_idPost into an X communitynone
reply_settingsWho can reply: following, mentionedUsers, subscribers, verifiednone
tagged_user_idsTag up to 10 users in media[]
first_comment / x_first_commentAuto-reply under the postnone
scheduled_dateISO-8601 date to schedule the postnone
URLs are stripped from X posts by default

X bills ~$0.200 per post containing a URL vs $0.015 without (13×), so Upload-Post removes clickable URLs from captions, titles and first comments on every X post. To publish posts with links, enable the X Links add-on. Details: Character Limits.

Limits and gotchas

  • Daily cap (per connected X profile, rolling 24 h) is per plan: Free/Basic 10, Professional 20, Advanced/Business 30 (upload limits).
  • Quote tweets with media are rejected. Post the quote as text-only via Upload Text (details).
  • Replies can 403 on X's Pay-Per-Use tier when the account never engaged with the author (details).