x-twitter.edit_post
Edit a recent post from a connected X account.
Call x-twitter.connected_accounts first. Pass user_id or user_name to target a specific account, or omit both to use the default account.
Requires post_id and at least one of text, media, paid_partnership, or made_with_ai.
Edits must be within X's one-hour window after posting. The authenticated X account may need X Premium for API edits. Posts with polls and some other types cannot be edited. Each edit returns a new post_id.
To attach media, upload files with files.upload_file and pass file_name values from files.list_uploaded_files.
Token pricing matches x-twitter.create_post: 60 tokens base, 1000 with URL, plus media surcharges.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Updated post text. | |
| media | No | File names from files.list_uploaded_files to attach (up to 4). Upload with files.upload_file first. | |
| post_id | Yes | Numeric id of the post to edit. | |
| user_id | No | Numeric X user id from x-twitter.connected_accounts. Pass user_id or user_name to target a specific account, not both. Omit both to use the default account. | |
| user_name | No | X handle from x-twitter.connected_accounts, with or without a leading @. Pass user_id or user_name to target a specific account, not both. Omit both to use the default account. | |
| made_with_ai | No | Whether the post contains AI-generated media. | |
| paid_partnership | No | Whether the post is a paid partnership. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Post text returned by the X API. | |
| post_id | No | Numeric id of the edited post returned by the X API. | |
| user_id | No | Numeric X user id of the connected account. | |
| user_name | No | X handle of the connected account. |