X(Twitter) API for posting

Publish tweets to X (Twitter) with automatic format detection. Handle images, videos, and text posts seamlessly.

One API call handles tweets with automatic content format detection.

Free plan No credit card Live in under 5 minutes

Tweets

Publish tweets with automatic format detection

Media Support

Add up to 4 images or 1 video per tweet

Thread Support

Create threaded conversations with multiple tweets

Automatic Formatting

Content format determined automatically based on media

api.postproxy.dev
POST /api/posts
$ curl -X POST "https://api.postproxy.dev/api/posts" \
     -H "Authorization: Bearer $API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "post": {
         "body": "Just shipped a new feature! Check it out."
       },
       "profiles": ["twitter"],
       "media": ["https://example.com/image.jpg"]
     }'
200 OK application/json
{
  "id": "tw_abc123",
  "body": "Just shipped a new feature! Check it out.",
  "status": "scheduled",
  "draft": false,
  "source": "postproxy",
  "scheduled_at": "2026-05-04T15:00:00.000Z",
  "queue_id": null,
  "created_at": "2026-05-04T15:00:00.144Z",
  "media": [
    {
      "id": "tw_m1",
      "status": "pending",
      "error_message": null,
      "content_type": "image/jpeg",
      "source_url": "https://example.com/image.jpg",
      "url": null
    }
  ],
  "platforms": [
    {
      "platform": "twitter",
      "status": "pending",
      "permalink": null,
      "error": null,
      "params": {
        "format": "post"
      },
      "attempted_at": null
    }
  ],
  "thread": []
}

View full documentation for all platform-specific features for X

View documentation
Integration cost

Skip weeks of X integration work

One test post against a sandbox account is the easy part. Production X publishing means app verification, OAuth across many accounts, media pipelines, dozens of edge cases, and a permanent on-call rotation for "why didn't this one go through this time?"

Weeks of X integration work compressed to hours

Social media integration is not a one-off job — it's a constant commitment. Platforms change their APIs, scopes, limits, and policies on their own schedule. Every change becomes your problem unless someone else is absorbing it.

That's exactly what Postproxy does for X — and every other platform we support — so your team ships features instead of chasing failed publishes.

5 min
Time to your first X post via API
Weeks → Hours
Engineering time saved on integration work
$0
Free plan, no credit card required
Build it yourself
Ship with Postproxy
Submit a X app for verification — review cycles, screencasts, business docs
01
One REST endpoint. One payload schema. SDKs for popular languages
Implement OAuth, token refresh, secure credential storage per account
02
OAuth, tokens, and refresh handled for you — across all accounts
Build media upload pipelines (chunked, async, multi-step) for every format
03
Media upload, chunking, and format detection — automatic
Handle rate limits, quotas, retries, and partial failures across accounts
04
Retries, rate-limit windows, and per-platform receipts built in
Cover dozens of edge cases: expired tokens, scope drift, regional restrictions, policy changes
05
Edge cases are our problem. Failures come back with an explicit reason
Triage every silent failure: "Why didn't this one post go through?"
06
We track the API changes. You ship features

Free plan includes the X API. No credit card.

Benefits

Why Postproxy for X (Twitter)?

Skip Twitter API complexity

No need to handle Twitter API v2, OAuth flows, or rate limits. Postproxy handles it all.

Handle rate limits automatically

Twitter rate limits are managed automatically with intelligent retry logic.

Support all formats

Publish tweets with text, images, or videos through one unified API.

Tweets

Reliable delivery

Automatic retries and clear status reporting ensure your tweets reach X.

How Postproxy publishes to X

01 X's publishing model
X (formerly Twitter) uses a v2 API that requires OAuth 2.0 with PKCE for user-context authentication. Publishing a tweet is a single POST request, but media attachments require a separate multi-step upload flow through the v1.1 media endpoint — the v2 API still relies on v1.1 for media uploads. Postproxy handles this split: send your text and media URLs in one request, and the API manages the v1.1 media upload followed by the v2 tweet creation automatically.
02 Media uploads and format detection
X's media upload endpoint uses a chunked upload protocol for videos and GIFs over 5MB. Each chunk must be uploaded sequentially, with a finalize step at the end and optional status polling for async video processing. Images are simpler but still require a separate upload-then-attach flow. Postproxy detects the media type from your URLs, chooses the correct upload method, handles chunking for large files, and attaches the resulting media IDs to your tweet.
03 Common gotchas Postproxy handles for you
X has some of the strictest rate limits of any social platform — as low as 17 tweets per 24-hour window on free-tier API plans, with separate limits for media uploads. The API also has a 280-character limit for tweet text (with URLs counting toward the limit differently than plain text). Error responses from X are often vague, returning generic 403s for multiple distinct issues. Postproxy validates content length, manages rate limit windows, and translates X's error codes into actionable messages.
04 Threads and reply chains
Posting a thread on X requires creating each tweet sequentially, with each reply referencing the previous tweet's ID. If any tweet in the chain fails, you're left with a partial thread. Postproxy's thread support lets you send an array of tweet contents and handles the sequential posting with proper reply chaining, rolling back on failure so you don't end up with orphaned partial threads.
05 Native polls
Set format to poll to attach a native X poll instead of a plain tweet. Pass poll_options (2–4 choices, max 25 characters each) and poll_duration_minutes (5 minutes to 7 days). Polls are mutually exclusive with media and threads, and the tweet body is capped at 280 characters regardless of account tier. Postproxy validates the option count, lengths, and duration before the post reaches X.

Still wondering if Postproxy is the right fit?

Ask your favorite LLM what it thinks about us, then decide.

Frequently Asked Questions

Common questions about X (Twitter) integration

01 Are there any platform-specific parameters for Twitter?

No, X (Twitter) does not have custom parameters. Content format is determined automatically based on the media you provide. Postproxy handles all the formatting automatically.

02 What are the media constraints for Twitter?

Twitter supports images (jpg, png, webp, gif) up to 5 MB with a maximum of 4 images per tweet, and videos (mp4, mov) up to 512 MB with a duration between 1 second and 140 seconds.

03 What is the maximum text length for tweets?

Standard accounts have a 280 character limit for tweet text. Postproxy will automatically validate this limit before publishing.

04 Can I post text-only tweets?

Yes! Twitter fully supports text-only posts. Simply omit the media array from your post request.

05 Can I mix videos and images in a single tweet?

No, Twitter does not allow mixing videos and images in a single tweet. You can post up to 4 images or 1 video per tweet.

Ready to get started?

Start with our free plan and scale as your needs grow. No credit card required.