PubNio calls X’s POST /2/media/upload (mediaUpload) to upload an image or GIF before it creates the post. Values checked 2026-12-05.
How PubNio calls it
- Publishing:
POST /api/v1/posts(unless it saves a draft),POST /api/v1/posts/{postId}/publish, orPOST /api/v1/posts/{postId}/targets/{targetId}/retrystarts the delivery. - Images and GIFs go up in one multipart request with
mediaandmedia_categoryset totweet_imageortweet_gif. PubNio reads the stored file whole and refuses it when the size differs from what was stored. - PubNio caps an X image at 5 MB and a GIF at 15 MB before it sends anything.
| Value | Official value | Source | Checked |
|---|---|---|---|
| Image limits | 5MB; JPG, PNG, GIF, WEBP | X API: Upload Media | 2026-12-05 |
| GIF size | 15MB | X API: Media best practices | 2026-12-05 |
Scopes
- The pinned spec lists one scope:
media.write. - PubNio’s X sign-in requests every one of them.
- Before a delivery makes this call, PubNio checks that the account granted
tweet.write.
Errors
PubNio has no X error code pages yet. Provider error codes covers the providers that have them.
Spec and changes
mediaUpload in the pinned spec, revision 2.175.
Checked weekly; no change to POST /2/media/upload recorded since this revision. Change tracker.
Limits
- Videos never use this single request; they go through the chunked
initialize,append, andfinalizesteps.
Sources
- X API v2 OpenAPI document
- X API: Upload Media, checked 2026-12-05
- X API: Media best practices, checked 2026-12-05