> ## Documentation Index
> Fetch the complete documentation index at: https://generaltranslation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 포스트 편집

> X API에서 편집된 게시물을 처리하는 방법

X의 포스트는 게시 후 30분 이내에 최대 5번까지 수정할 수 있습니다. X API는 편집 이력과 메타데이터 전체에 대한 액세스를 제공합니다.

***

<div id="edit-rules">
  ## 편집 규칙
</div>

| 규칙           | 세부사항                        |
| :----------- | :-------------------------- |
| **시간 제한**    | 원본 게시 후 30분 이내              |
| **편집 횟수 제한** | 최대 5회까지 편집 가능               |
| **ID 처리 방식** | 각 편집마다 새로운 게시물 ID가 생성됨      |
| **삭제**       | 어떤 버전을 삭제하더라도 전체 편집 기록이 삭제됨 |

***

<div id="what-cant-be-edited">
  ## 편집할 수 없는 항목
</div>

일부 포스트 type은 편집할 수 없습니다:

* 프로모션 포스트(광고)
* 투표가 포함된 포스트
* 다른 사람에게 단 답글(자신의 스레드가 아님)
* 리포스트(인용 포스트는 *편집할 수 있습니다*)
* 커뮤니티 포스트
* 협업 포스트
* 예약된 포스트

***

<div id="edit-data-in-responses">
  ## 응답에 포함된 편집 데이터
</div>

<div id="default-fields">
  ### 기본 필드
</div>

모든 게시물 응답에는 기본적으로 `edit_history_tweet_ids`가 포함됩니다.

```json theme={null}
{
  "data": {
    "id": "1234567891",
    "text": "Updated text (edited)",
    "edit_history_tweet_ids": ["1234567890", "1234567891"]
  }
}
```

* 단일 ID = 편집 이력 없음
* 여러 ID = 편집 이력(가장 오래된 것부터)

<div id="edit-controls">
  ### 편집 제어
</div>

편집 상태를 가져오려면 `edit_controls`를 요청하세요:

```bash theme={null}
curl "https://api.x.com/2/tweets/1234567891?tweet.fields=edit_controls" \
  -H "Authorization: Bearer $TOKEN"
```

```json theme={null}
{
  "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
    }
  }
}
```

| Field              | Description       |
| :----------------- | :---------------- |
| `is_edit_eligible` | 게시물을 수정할 수 있는지 여부 |
| `editable_until`   | 수정 가능 기간이 끝나는 시각  |
| `edits_remaining`  | 남은 수정 횟수 (0-5)    |

***

<div id="getting-edit-history">
  ## 수정 이력 가져오기
</div>

모든 버전에 대한 전체 게시물 객체를 가져오려면 `edit_history_tweet_ids` 확장 필드를 사용하세요:

```bash theme={null}
curl "https://api.x.com/2/tweets/1234567891?\
tweet.fields=edit_controls&\
expansions=edit_history_tweet_ids" \
  -H "Authorization: Bearer $TOKEN"
```

```json theme={null}
{
  "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
      }
    }]
  }
}
```

***

<div id="which-version-is-returned">
  ## 어떤 버전이 반환되나요?
</div>

기본적으로 API는 수정된 게시물의 **가장 최근 버전**을 반환합니다.

특정 버전을 가져오려면 해당 게시물 ID로 직접 요청하세요:

```bash theme={null}
# 원본 버전 가져오기
curl "https://api.x.com/2/tweets/1234567890" -H "Authorization: Bearer $TOKEN"

# 편집된 버전 가져오기  
curl "https://api.x.com/2/tweets/1234567891" -H "Authorization: Bearer $TOKEN"
```

***

<div id="metrics-for-edited-posts">
  ## 수정된 포스트의 메트릭
</div>

수정된 포스트의 각 버전마다 고유한 참여 메트릭이 있습니다. 참여가 발생한 시점에 표시되고 있던 버전에 해당 메트릭이 귀속됩니다.

***

<div id="availability">
  ## 제공 범위
</div>

편집 메타데이터는 다음과 같이 제공됩니다:

* 2022년 9월 29일 이후에 생성된 모든 포스트
* 포스트를 반환하는 모든 v2 엔드포인트
* 검색, 타임라인, 스트림, 조회 엔드포인트 포함

이 날짜 이전에 생성된 포스트에는 편집 메타데이터가 없습니다.

***

<div id="use-cases">
  ## 사용 사례
</div>

<Tabs>
  <Tab title="변경 사항 추적">
    포스트의 수정 내역을 모니터링하고 변경 내용을 기록합니다:

    ```python theme={null}
    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")
    ```
  </Tab>

  <Tab title="수정 배지 표시">
    UI에 "edited" 배지를 표시합니다:

    ```javascript theme={null}
    const isEdited = post.edit_history_tweet_ids?.length > 1;
    if (isEdited) {
      showEditedBadge();
    }
    ```
  </Tab>

  <Tab title="원본 콘텐츠 가져오기">
    수정된 게시물의 원본 버전을 가져옵니다:

    ```python theme={null}
    original_id = post["edit_history_tweet_ids"][0]
    original = api.get_tweet(original_id)
    ```
  </Tab>
</Tabs>

***

<div id="next-steps">
  ## 다음 단계
</div>

<CardGroup cols={2}>
  <Card title="포스트 조회" icon="magnifying-glass" href="/ko/x-api/posts/lookup/introduction">
    수정 이력이 포함된 포스트를 조회합니다.
  </Card>

  <Card title="데이터 사전" icon="book" href="/ko/x-api/fundamentals/data-dictionary">
    포스트 객체에 대한 전체 참조입니다.
  </Card>
</CardGroup>
