Edit published draft on X
edit_published_draftEdit the root post of a published X draft via the API, re-attaching media and quote tweets. Works within the 30-minute edit window for Premium, excluding polls and community posts.
Instructions
Edit the root post of a published draft via POST /2/tweets with edit_options.previous_post_id. Requires X Premium; edits are limited (~30 minutes / 5 edits) and each edit creates a new post id (stored locally). Re-attaches media (re-uploaded from mediaPaths) and quoteTweetId when present. Polls and community posts cannot be edited. Only the thread root is edited. Same link rule: no http(s) URL in the root unless allowLinksInMainPost is true (or was already set on the draft) because the user explicitly insisted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Draft id. | |
| text | Yes | New text for the root post. Do not put http(s) links here unless allowLinksInMainPost is true. | |
| paidPartnership | No | Optional paid partnership flag for the edited post. | |
| allowLinksInMainPost | No | Allow a URL in the root post for this edit. Only when the user explicitly insists. Defaults to the draft's stored flag. |