Skip to main content
Posts on X can be edited within 30 minutes of posting, up to 5 times. The X API provides full access to edit history and metadata.

Edit rules

RuleDetails
Time window30 minutes from original post
Edit limit5 edits maximum
ID behaviorEach edit creates a new post ID
DeletionDeleting any version deletes the entire chain

What can’t be edited

Some post types are not editable:
  • Promoted posts (ads)
  • Posts with polls
  • Replies to others (non-self-thread)
  • Reposts (Quote posts can be edited)
  • Community posts
  • Collaborative posts
  • Scheduled posts

Edit data in responses

Default fields

All post responses include edit_history_tweet_ids by default:
{
  "data": {
    "id": "1234567891",
    "text": "Updated text (edited)",
    "edit_history_tweet_ids": ["1234567890", "1234567891"]
  }
}
  • Single ID = never edited
  • Multiple IDs = edit history (oldest first)

Edit controls

Request edit_controls for edit status:
curl "https://api.x.com/2/tweets/1234567891?tweet.fields=edit_controls" \
  -H "Authorization: Bearer $TOKEN"
{
  "data": {
    "id": "1234567891",
    "text": "Updated text (edited)",
    "edit_history_tweet_ids": ["1234567890", "1234567891"],
    "edit_controls": {
      "is_edit_eligible": true,
      "editable_until": "2024-01-15T12:30:00.000Z",
      "edits_remaining": 3
    }
  }
}
FieldDescription
is_edit_eligibleWhether the post can be edited
editable_untilTimestamp when edit window closes
edits_remainingNumber of edits left (0-5)

Getting edit history

Use the edit_history_tweet_ids expansion to get full post objects for all versions:
curl "https://api.x.com/2/tweets/1234567891?\
tweet.fields=edit_controls&\
expansions=edit_history_tweet_ids" \
  -H "Authorization: Bearer $TOKEN"
{
  "data": {
    "id": "1234567891",
    "text": "Updated text (edited)",
    "edit_history_tweet_ids": ["1234567890", "1234567891"],
    "edit_controls": {
      "is_edit_eligible": true,
      "editable_until": "2024-01-15T12:30:00.000Z",
      "edits_remaining": 3
    }
  },
  "includes": {
    "tweets": [{
      "id": "1234567890",
      "text": "Original text (with typo)",
      "edit_history_tweet_ids": ["1234567890", "1234567891"],
      "edit_controls": {
        "is_edit_eligible": true,
        "editable_until": "2024-01-15T12:30:00.000Z",
        "edits_remaining": 3
      }
    }]
  }
}

Which version is returned?

By default, the API returns the most recent version of an edited post. To get a specific version, request it by its post ID directly:
# Get original version
curl "https://api.x.com/2/tweets/1234567890" -H "Authorization: Bearer $TOKEN"

# Get edited version  
curl "https://api.x.com/2/tweets/1234567891" -H "Authorization: Bearer $TOKEN"

Metrics for edited posts

Each version of an edited post has its own engagement metrics. The metrics are attributed to the version that was visible when the engagement occurred.

Availability

Edit metadata is available:
  • For all posts created since September 29, 2022
  • On all v2 endpoints that return posts
  • Including search, timelines, stream, and lookup
Posts created before this date do not have edit metadata.

Use cases

Monitor posts for edits and log the differences:
def check_for_edits(post):
    history = post.get("edit_history_tweet_ids", [])
    if len(history) > 1:
        print(f"Post {post['id']} has been edited {len(history) - 1} times")

Next steps