
X (Twitter) API Media Upload: Chunked Upload, Processing, and Why Video/GIF Posts Fail (2026)
X API Media Upload: Why It Is a Separate System, Not a Post Parameter
You cannot attach a raw image or video file to a create-post call. Per X's own API reference, media has to be uploaded first through POST /2/media/upload, which returns a media_id — and only that ID gets passed into the post creation request afterward. For a single image under 5 MB this can be a one-shot call. For video or GIF, X's documentation requires the full chunked workflow: initialize a session, upload the file in pieces, finalize it, and then — for video and GIF specifically — wait for server-side processing to report success before the media can be used at all.
That processing step is the part most self-built integrations get wrong. Skip it, and the post creation call fails with a media error even though the upload itself returned a success response.
X API media upload reliability depends on INIT, APPEND, FINALIZE, and STATUS completing in order; skipping one stage leaves media processing incomplete. In the current v2 quickstart these stages are separate calls: POST /2/media/upload/initialize, POST /2/media/upload/{id}/append and POST /2/media/upload/{id}/finalize, not the older single command-style POST /2/media/upload flow.
The Four Stages a Video or GIF Upload Has to Pass Through
According to X's chunked media upload reference, every non-trivial media upload moves through four named stages before it is postable:
X's own documentation also flags that both the upload session and the finalized media carry expiry windows measured in seconds — a media_id that sits unused past that window can no longer be attached to a post, which is a common failure point in integrations that queue posts instead of publishing them close to upload time.
X API media upload is easier when the session is monitored from INIT through STATUS, with clear handling for processing errors.
Where the Format Rules Trip Up Real Integrations
X's media best-practices reference sets hard technical limits per media type — and the limits are not the same for every upload path. The plain, non-chunked upload endpoint only reliably accepts still images and subtitle files under X's own request schema; video and GIF are documented as requiring the chunked path specifically.
- Formats: JPG, PNG, GIF, WEBP
- Size limit: up to 5 MB per file
- Per post: up to 4 images, or 1 GIF, or 1 video — never mixed
- Size limit: up to 15 MB
- Resolution / frame ceilings: documented pixel and frame-count limits apply even under the size cap — a GIF can pass the size check and still fail at post creation
- Large GIFs: require the chunked path with the correct media_category to process asynchronously
- Post video: up to 20 minutes and 8 GB on default accounts; up to 125 minutes and 16 GB for X Premium / verified accounts (X changelog, September 1, 2026)
- Direct Message video: up to 140 seconds and 512 MB on default accounts; up to 10 minutes and 1 GB for Premium
- Encoding: specific codec, pixel-format, and audio-profile requirements documented by X — non-conforming encodes are a frequent silent processing failure
The official X media upload documentation details the endpoint parameters and processing behavior.
For X API media upload, keep the media type, byte size, and processing state visible in logs so failures are easy to diagnose.
Common Reasons Media Uploads Fail or Get Rejected
Use the X API media upload plan for implementation, the X API media upload logs for debugging, the X API media upload status check for processing, and the X API media upload response for the final media ID.
X API Media Upload: What a Correctly Built Flow Delivers
Frequently Asked Questions about X API access
Why do X API applications for posting tools get rejected?
Posting tools are declined when the use case is unclear, the app's OAuth permissions don't match the posting feature, or the description suggests spammy or automated posting.
What timeline should I expect?
New app: about 3 days for our complete preparation and submission. If the app was already applied or rejected before, submission can happen the same day. Then X's review takes 10–20 days (less or more).
What happens if the request is rejected again?
Yes, we work on a 100% approval or 100% refund basis. If any permission is not approved, you get a refund for that permission.