X API media_category: tweet_video vs amplify_video vs dm_video

Pick media_category by destination: tweet_video for Posts, amplify_video for Ads, dm_video for DMs. Wrong category uploads fine and fails at Post create.

4 min readSume
All posts

Use tweet_video for a regular Post, amplify_video for Ads creatives, and dm_video for a Direct Message. X warns that a wrong category, for example a DM category on a Post, is a common reason an upload succeeds and Post create then fails.

Category rules are from X's Media best practices page, read 2026-10-01. Sume returns one MP4 per trim whatever the destination, per Video trim; the category is chosen on the X upload call.

Which category belongs to which destination?

If media_category is omitted, X assumes a Post category (tweet_image, tweet_video or tweet_gif) from the content type.

X media categories, from the X Media best practices page, read 2026-10-01.
CategoryUse for
tweet_image, tweet_video, tweet_gifRegular Posts
amplify_videoAds creatives
dm_image, dm_video, dm_gifDirect Messages
subtitlesSubtitle files

Do the limits differ between tweet_video and amplify_video?

For Posts, X says the Premium and default duration and size caps are the same for tweet_video and amplify_video. DM video is different: 0.5 to 140 seconds and 512 MB by default, and 0.5 seconds to 10 minutes and 1 GB for Premium or verified accounts.

Why does a wrong category fail late?

Upload limits and Post-create limits are separately enforced, so a media_id that finalized can still be rejected by POST /2/tweets. Set the category in the initialize call and test an attach before you batch uploads.

How do I cut one source for several categories?

Sume's POST /v1/video-trim returns a new MP4 for [start, end), with duration from 0.2 to 900 seconds and an optional { width, height, fps } conform. Run it once per destination: a short cut for a DM, the full cut for a Post. Each output is a separate file that you upload with its own category. The DM limit side is in trim a clip for direct messages.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume