PubNio calls X’s POST /2/media/upload/initialize (initializeMediaUpload) to open a chunked upload for a video.
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. - PubNio sends
media_type,total_bytesfrom the stored file, andmedia_categorytweet_videoin a staging step of its own, and keeps the returned media ID in the delivery’s upload session. - A retried staging step finds the open session and reuses it instead of opening a second upload. A refusal from X fails the delivery as
provider_rejected. - PubNio refuses an X video over 512 MB before the upload opens.
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
initializeMediaUpload in the pinned spec, revision 2.175.
Checked weekly; no change to POST /2/media/upload/initialize recorded since this revision. Change tracker.
Limits
- An upload opened for a delivery that later fails is not cleaned up; X expires unused media on its own schedule.