Edit Tweet
Edit an existing Twitter/X post's text and media via API. Requires X Premium, within ~1 hour of posting. $0.002 per call. GetXAPI edit tweet endpoint.
/twitter/tweet/editThis endpoint costs $0.002 per API call.
Edit an existing post's text and/or media. Under the hood this is the same mutation as Create Tweet with an added edit marker, so it behaves the same way (direct HTTP fast path, browser fallback, optional proxy).
Editing is gated by X, not us. The auth_token account must be on X Premium, edits are allowed only within ~1 hour of the original post, there's a limited number of edits per post, and only original posts can be edited (not replies or thread tweets).
Each edit creates a new tweet id (X keeps the edit history and shows an "Edited" label). The response data.id is the new version; data.previous_tweet_id echoes the post you edited.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
auth_token | string | Yes | User's auth token |
tweet_id | string | Yes | Numeric id of the post to edit |
text | string | Yes | New full text for the post (replaces the existing text) |
ct0 | string | No | CSRF token; with twid, skips server-side credential resolution |
twid | string | No | User id cookie (e.g. u%3D123456); must be provided with ct0 |
media_ids | string[] | No | Pre-uploaded media ids to attach |
media_urls | string[] | No | Image/video URLs, fetched and uploaded automatically |
media | object[] | No | Base64-encoded media (data + type), uploaded automatically |
proxy | string | No | Your proxy URL; runs via a temporary headless browser on your IP |
Notes
- Long edits (over 280 characters) are routed through the Premium long-form path automatically.
- Editing a post you already edited: every edit creates a new tweet id, and X only lets you edit the current version. To edit again, pass the id from the previous edit's
data.id. Editing a superseded id fails. - Confirm the edit by checking
data.id(non-null = the new edited version).
Response (200)
{
"status": "success",
"msg": "Tweet edited successfully",
"data": {
"id": "2093260000000000000",
"text": "how are you doing today friend?",
"createdAt": "Thu Aug 28 09:15:00 +0000 2026",
"previous_tweet_id": "2093255791965016333"
}
}Error Responses
403 - Not editable
The account isn't Premium, the ~1h window passed, the edit limit was reached, or the post isn't an editable original (reply/thread).
{
"error": "This post can't be edited. Editing requires an X Premium account and only works within ~1 hour of the original post (limited edits, original posts only - not replies or thread tweets).",
"twitter_error_code": null
}400 - Missing required field
{
"error": "Missing required field: tweet_id"
}Example
curl -X POST "https://api.getxapi.com/twitter/tweet/edit" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"tweet_id": "2093255791965016333",
"text": "how are you doing today friend?"
}'