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 API paid_partnership true: disclose a sponsored AI video Post
Set paid_partnership true in POST /2/tweets to label a Post as paid promotion on X. Sume returns the video file; your own call creates and flags the Post.
- X API media upload: initialize, append, finalize a Sume video
X's chunked upload now uses POST /2/media/upload/initialize, append and finalize. Download the finished Sume video, then run the three calls yourself.
- X DM video limit: 140 seconds and 512 MB, and how to trim to it
X lists DM video (dm_video) at 140 seconds and 512 MB by default. Cut a clip to length with Sume video-trim, which takes 0.2 to 900 seconds.
- X video audio must be AAC-LC, not HE-AAC: check an AI video
X requires AAC Low Complexity audio, mono or stereo, with H264 High Profile and YUV 4:2:0. What Sume's exact trim keeps and re-encodes, and what it leaves.
Written by Sume