cURL
curl --request POST \ --url https://api.x.com/2/dm_conversations/{dm_conversation_id}/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "text": "<string>", "attachments": [ { "media_id": "1146654567674912769" } ] } '
{ "data": { "dm_conversation_id": "123123123-456456456", "dm_event_id": "1146654567674912769" }, "errors": [ { "title": "<string>", "type": "<string>", "detail": "<string>", "status": 123 } ] }
Sends a new direct message to a specific conversation by its ID.
The access token received from the authorization server in the OAuth 2.0 flow.
The DM Conversation ID.
Text of the message.
1
Attachments to a DM Event.
Show child attributes
The unique identifier of this Media.
"1146654567674912769"
The request has succeeded.
Unique identifier of a DM conversation. This can either be a numeric string, or a pair of numeric strings separated by a '-' character in the case of one-on-one DM Conversations.
"123123123-456456456"
Unique identifier of a DM Event.