Overview
- Introduction
- Getting started
- Tools and libraries
- Migration guide
- What to build
- Fundamentals
Posts
- Search
- Post Counts
- Filtered Stream
- Timelines
- Post Lookup
- Bookmarks
- Manage Posts
- Reposts
- Quotes
- Hide replies
Users
- User Lookup
- Search
- Follows
- Mutes
- Blocks
Direct Messages
Likes
Lists
- Lookup Lists
- Lookup List Posts
- Manage Lists
- List Members
- Pinned Lists
Spaces
- Introduction
- Spaces Lookup
- Search Spaces
Communities
- Communities Lookup
- Search Communities
Trends
- Trends
- Personalized Trends
Media
- Introduction
- Upload
- Metadata
Compliance
- Batch Compliance
- Compliance streams
Enterprise v2
- Engagement Metrics
- Account Activity
- Webhooks
- Volume Streams
Likes Streams
Manage
Create a new DM Conversation
Creates a new DM Conversation.
POST
/
2
/
dm_conversations
Copy
Ask AI
curl --request POST \
--url https://api.twitter.com/2/dm_conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"conversation_type": "Group",
"message": {
"attachments": [
{
"media_id": "1146654567674912769"
}
],
"text": "<string>"
},
"participant_ids": [
"2244994945"
]
}'
Copy
Ask AI
{
"data": {
"dm_conversation_id": "123123123-456456456",
"dm_event_id": "1146654567674912769"
},
"errors": [
{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}
]
}
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Response
201
application/json
The request has succeeded.
The response is of type object
.
Copy
Ask AI
curl --request POST \
--url https://api.twitter.com/2/dm_conversations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"conversation_type": "Group",
"message": {
"attachments": [
{
"media_id": "1146654567674912769"
}
],
"text": "<string>"
},
"participant_ids": [
"2244994945"
]
}'
Copy
Ask AI
{
"data": {
"dm_conversation_id": "123123123-456456456",
"dm_event_id": "1146654567674912769"
},
"errors": [
{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.