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.

4 min readSume
All posts

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.

Post video limits as written by X, read 2026-10-01.
AccountMax durationMax size
Default20 minutes8 GB
Premium / verified125 minutes16 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

All Developers posts

Written by Sume