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

# X API v2에서 게시물 관리

> X API v2 standard 티어의 manage Posts 엔드포인트로 인증된 사용자를 대신해 게시물을 생성하고 삭제하세요. 요청 및 응답 세부 정보를 포함합니다.

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <span>{children}</span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

Manage Posts 엔드포인트를 사용하면 인증된 사용자를 대신해 게시물을 생성하고 삭제할 수 있습니다. 콘텐츠를 게시하거나 스레드를 만들거나 사용자 게시물을 관리하는 애플리케이션을 구축하세요.

## 개요

<CardGroup cols={2}>
  <Card title="게시물 생성" icon="pen">
    새로운 게시물 게시
  </Card>

  <Card title="게시물 삭제" icon="trash">
    기존 게시물 삭제
  </Card>

  <Card title="답글" icon="reply">
    다른 게시물에 답글
  </Card>

  <Card title="인용" icon="quote-right">
    다른 게시물 인용
  </Card>
</CardGroup>

***

## 엔드포인트

| Method | Endpoint                                    | Description |
| :----- | :------------------------------------------ | :---------- |
| POST   | [`/2/tweets`](/x-api/posts/create-post)     | 새 게시물 생성    |
| DELETE | [`/2/tweets/:id`](/x-api/posts/delete-post) | 게시물 삭제      |

***

## 게시물 생성

### 기본 게시물

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from the API!"}'
```

<Note>
  **Self-serve 고객:** API로 생성된 게시물은 게시물당 최대 1개의 cashtag로 제한됩니다.
</Note>

### 게시물에 답글

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "This is a reply!",
    "reply": {
      "in_reply_to_tweet_id": "1234567890"
    }
  }'
```

<Note>
  **Self-serve 고객:** 답글은 원본 게시물의 작성자가 답글을 다는 계정을 @멘션하거나 해당 계정의 게시물 중 하나를 인용해 명시적으로 소환한 경우에만 허용됩니다.
</Note>

### 게시물 인용

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Check this out!",
    "quote_tweet_id": "1234567890"
  }'
```

### 미디어가 있는 게시물

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Photo of the day",
    "media": {
      "media_ids": ["1234567890123456789"]
    }
  }'
```

<Note>
  먼저 [Media Upload 엔드포인트](/x-api/media/quickstart/media-upload-chunked)로 미디어를 업로드한 뒤, 게시물에서 `media_id`를 참조하세요.
</Note>

### Poll이 있는 게시물

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "What is your favorite color?",
    "poll": {
      "options": ["Red", "Blue", "Green", "Yellow"],
      "duration_minutes": 1440
    }
  }'
```

### 유료 파트너십 게시물

게시물을 생성할 때 `paid_partnership` 필드를 사용해 유료 파트너십임을 나타냅니다(즉, 작성자가 유료 프로모션이 포함되어 있음을 공개함). `true`로 설정하면 게시물이 유료 프로모션으로 라벨링됩니다.

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Excited to partner with Acme on their latest launch!",
    "paid_partnership": true
  }'
```

기존 게시물(자신의 게시물 포함)에서 값을 가져오려면 `tweet.fields` 파라미터로 요청하세요:

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

***

## 게시물 삭제

```bash theme={null}
curl -X DELETE "https://api.x.com/2/tweets/1234567890" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"
```

<Warning>
  인증된 사용자가 작성한 게시물만 삭제할 수 있습니다.
</Warning>

***

## 시작하기

<Note>
  **사전 요구사항**

  * 승인된 [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * Developer Console 내의 [Project와 App](/resources/fundamentals/developer-apps)
  * [OAuth 2.0 PKCE](/resources/fundamentals/authentication#oauth-2-0-authorization-code-flow-with-pkce-2) 또는 [3-legged OAuth](/resources/fundamentals/authentication#obtaining-access-tokens-using-3-legged-oauth-flow)를 통한 User Access Token
</Note>

<CardGroup cols={2}>
  <Card title="퀵스타트" icon="https://mintcdn.com/x-preview/oR-aRNyj1BKPJtxM/icons/xds/icon-rocket.svg?fit=max&auto=format&n=oR-aRNyj1BKPJtxM&q=85&s=b978d7a9225de31709efbbed5b84e92d" href="/x-api/posts/manage-tweets/quickstart" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    첫 게시물 생성하기
  </Card>

  <Card title="통합 가이드" icon="https://mintcdn.com/x-preview/Vn2KEkZaPF9LiPi3/icons/xds/icon-book.svg?fit=max&auto=format&n=Vn2KEkZaPF9LiPi3&q=85&s=22ac564792481d14ae36a941546039c8" href="/x-api/posts/manage-tweets/integrate" width="24" height="24" data-path="icons/xds/icon-book.svg">
    핵심 개념 및 모범 사례
  </Card>

  <Card title="미디어 업로드" icon="https://mintcdn.com/x-preview/oR-aRNyj1BKPJtxM/icons/xds/icon-photo.svg?fit=max&auto=format&n=oR-aRNyj1BKPJtxM&q=85&s=d0986097dcff55478c32801b20440ecc" href="/x-api/media/quickstart/media-upload-chunked" width="24" height="24" data-path="icons/xds/icon-photo.svg">
    게시물용 미디어 업로드
  </Card>

  <Card title="API 레퍼런스" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-code.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=488e23401b19225b89acc0136d242219" href="/x-api/posts/creation-of-a-post" width="24" height="24" data-path="icons/xds/icon-code.svg">
    전체 엔드포인트 문서
  </Card>
</CardGroup>
