X takes JPG, PNG, GIF, or WEBP images up to 5MB and animated GIFs up to 15MB. Post video runs 0.5 seconds to 20 minutes on a default account. A post carries up to 4 photos, 1 GIF, or 1 video, and 280 characters unless the account has X Premium. (Checked 2026-12-05.)
Facts
| Fact | Official value | Source | Checked |
|---|---|---|---|
| Images | 5MB; JPG, PNG, GIF, WEBP | X API: Upload Media | 2026-12-05 |
| Animated GIF max size | 15MB | X API: Media best practices | 2026-12-05 |
| Post video length (default account) | 0.5 seconds to 20 minutes | X API: Media best practices | 2026-12-05 |
| Direct Message video length | 0.5 to 140 seconds | X API: Media best practices | 2026-12-05 |
| Media per post | 4 | X API: Media best practices | 2026-12-05 |
| Post text | 280 characters (more with X Premium) | X API: Create or Edit Post | 2026-12-05 |
Where official docs disagree
- Media per post: 4 in X API: Media best practices; 20 in X API: Create or Edit Post.
- PubNio caps X video at 512MB and 140 seconds, which matches X’s Direct Message video limit, not its longer post video limit.
What PubNio enforces
- Video uploaded to a PubNio workspace is capped at 5GiB, and other media at 256MiB. Only media given to a post by URL can be larger, so a provider limit above those sizes applies to URL media only.
- PubNio accepts JPEG, PNG, GIF, WebP, MP4, MOV: up to 4 images of 5MB, GIFs up to 15MB, and video up to 512MB.
- Post text is capped at 280 weighted characters.
Read the live value
GET /api/v1/capabilitiesreturns PubNio’s media rules for every X placement, andPOST /api/v1/posts/{postId}/validatechecks a draft against them without publishing.
Related errors
- PubNio reports a file it will not send as
media_mime_type,media_too_large, ormedia_counton the target, before any provider call. - X error codes lists the errors PubNio returns for X and how to fix each.
Limits
- PubNio does not use X Premium’s longer post and video limits.
Sources
-
X API: Upload Media, checked 2026-12-05
JPG, PNG, GIF or WEBP, up to 5 MB -
X API: Media best practices, checked 2026-12-05
15 MB 0.5 seconds–20 minutes 0.5–140 seconds You may attach up to 4 photos, 1 animated GIF or 1 video in a Post. -
X API: Create or Edit Post, checked 2026-12-05
maxItems: 20 At most 280 characters unless the account has X Premium.