This guide walks you through sending Direct Messages and creating group conversations.Documentation Index
Fetch the complete documentation index at: https://x-preview-mintlify-translate-step-by-step-1778654896.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
PrerequisitesBefore you begin, you’ll need:
- A developer account with an approved App
- User Access Token (OAuth 2.0 PKCE with
dm.writeanddm.readscopes)
Send a one-to-one message
Get the recipient's user ID
You need the user ID of the person you want to message. You can get this from the User lookup endpoint.
Create a group conversation
Add a message to an existing conversation
Send a message to a conversation you’re already part of:cURL
Send a message with media
Upload the media
First, upload your media using the Media Upload endpoint.
Delete a message
Delete a message you sent:cURL
Required scopes
When using OAuth 2.0 PKCE, your access token must have these scopes:| Scope | Description |
|---|---|
dm.write | Send and delete messages |
dm.read | Read conversations (required with dm.write) |
tweet.read | Required for some expansions |
users.read | Required for user expansions |
Next steps
DM lookup
Retrieve DM conversations
Integration guide
Key concepts and best practices
API Reference
Full endpoint documentation
Sample code
Working code examples