> ## 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.

# 다이렉트 메시지 관리

> 다이렉트 메시지 보내기 및 삭제

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <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 Direct Messages 엔드포인트를 사용하면 인증된 사용자 계정으로 다이렉트 메시지를 보내거나 삭제할 수 있습니다.

<div id="overview">
  ## 개요
</div>

<CardGroup cols={2}>
  <Card title="메시지 보내기" icon="paper-plane">
    다른 사용자에게 다이렉트 메시지(DM)를 보냅니다
  </Card>

  <Card title="메시지 삭제" icon="trash">
    내 계정에서 DM을 삭제합니다
  </Card>

  <Card title="대화 생성" icon="comments">
    새로운 대화를 시작합니다
  </Card>

  <Card title="그룹 메시지" icon="users">
    그룹 대화로 보냅니다
  </Card>
</CardGroup>

***

<div id="endpoints">
  ## 엔드포인트
</div>

| Method | Endpoint                                            | 설명             |
| :----- | :-------------------------------------------------- | :------------- |
| POST   | `/2/dm_conversations`                               | 새 대화 생성        |
| POST   | `/2/dm_conversations/with/:participant_id/messages` | 일대일 대화로 메시지 전송 |
| POST   | `/2/dm_conversations/:dm_conversation_id/messages`  | 기존 대화로 메시지 전송  |
| DELETE | `/2/dm_events/:id`                                  | DM 이벤트 삭제      |

***

<div id="example-send-a-message">
  ## 예시: 메시지 전송
</div>

```bash theme={null}
curl -X POST "https://api.x.com/2/dm_conversations/with/1234567890/messages" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello! How are you?"}'
```

<div id="example-response">
  ## 응답 예시
</div>

```json theme={null}
{
  "data": {
    "dm_conversation_id": "1234567890-0987654321",
    "dm_event_id": "1122334455667788990"
  }
}
```

***

<div id="message-types">
  ## 메시지 유형
</div>

텍스트 메시지를 보내고 미디어를 첨부할 수 있습니다:

```json theme={null}
{
  "text": "Check out this photo!",
  "attachments": [{
    "media_id": "1234567890123456789"
  }]
}
```

***

<div id="getting-started">
  ## 시작하기
</div>

<Note>
  **사전 준비 사항**

  * 승인된 [개발자 계정](https://developer.x.com/en/portal/petition/essential/basic-info)
  * 개발자 콘솔의 [Project 및 App](/ko/resources/fundamentals/developer-apps)
  * [OAuth 2.0 PKCE](/ko/resources/fundamentals/authentication#oauth-2-0-authorization-code-flow-with-pkce-2)를 통한 사용자 액세스 토큰
</Note>

<CardGroup cols={2}>
  <Card title="빠른 시작" icon="rocket" href="/ko/x-api/direct-messages/manage/quickstart">
    첫 번째 DM을 보내 보세요
  </Card>

  <Card title="통합 가이드" icon="book" href="/ko/x-api/direct-messages/manage/integrate">
    핵심 개념과 모범 사례
  </Card>

  <Card title="DM 조회" icon="messages" href="/ko/x-api/direct-messages/lookup/introduction">
    DM 이벤트 가져오기
  </Card>

  <Card title="API 참조 문서" icon="code" href="/ko/x-api/direct-messages/send-new-message">
    전체 엔드포인트 문서
  </Card>
</CardGroup>
