X API 403 "not allowed to post a video longer than N minutes"
The 403 means the clip exceeds the posting account's cap: 20 minutes by default, 125 for Premium or verified. Cut the video to that cap before you post.

The error means the video is longer than the cap for the account that is posting. X documents N as 20 minutes by default and 125 minutes for Premium or verified Post video, and says to handle the error even after a successful finalize. Cut the clip to the cap before upload.
X facts are from its changelog and media best-practices pages; Sume facts from Video trim and Timeline 1.0, read 2026-10-01.
Which N applies to my account?
The best-practices page says N is the posting user's cap for that media. For Post video (tweet_video or amplify_video) it lists 0.5 seconds to 20 minutes and 8 GB for default accounts, and up to 125 minutes and 16 GB for Premium or verified. Direct Message video has separate limits.
| Account | Max duration | Max size |
|---|---|---|
| Default | 20 minutes | 8 GB |
| Premium / verified | 125 minutes | 16 GB |
Why does the error appear after the upload worked?
X says the check is enforced when you create the Post, so a media id that finalized successfully can still be rejected with a 403 from POST /2/tweets. Check the duration yourself before you start the upload.
How do I cut a clip to the cap with Sume?
POST /v1/video-trim cuts one range from a Sume-hosted clip into a new MP4. Give start and exactly one of end or duration; the output is capped at 900 seconds, which is 15 minutes and under the 20-minute default. If end runs past the source it clamps and the result warns trim_clamped_to_source. The source must already be on media.sume.com, so import it first, and send an Idempotency-Key.
For a related size limit, see cutting a short trailer with video trim.
curl -X POST https://api.sume.com/v1/video-trim \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: trim-for-x-001" \
-d '{
"video_url": "https://media.sume.com/YOUR_CLIP.mp4",
"start": 0,
"duration": 900
}'What if my video is longer than 15 minutes?
One trim stops at 900 seconds, so split a longer video into ranges. Note that Timeline 1.0 can produce output up to 1,800 seconds, which is above X's 20-minute default; if you assemble a long video, check its length against the account cap before posting.
Sources
Related posts
More in Developers
- X Articles API: draft, publish and a generated cover image
The X Articles API has POST /2/articles/draft and a publish call, with optional cover media. Make the cover with a Sume image call, then upload it to X.
- X API image 5 MB limit: pick a Sume output format
X allows JPG, PNG, GIF and WEBP images up to 5 MB on every account. Sume outputs png, jpeg or webp, with no target file size field in the docs.
- 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.
- X API media upload succeeded but the Post fails: two-stage checks
X enforces media limits at upload and again at POST /2/tweets, by the posting user. Here is a pre-flight list and what Sume's inspect and trim cover.
Written by Sume