cURL
curl --request POST \ --url https://api.twitterxapi.com/twitter/send-dm \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "username": "myusername", "msg": "Hello, how are you?", "reply_to": "1234567890123456789", "cookie": "auth_token=abc123..." }'
{ "code": 200, "msg": "success", "data": { "attachment": { "type": "image", "url": "https://example.com/image.jpg" }, "id": "1234567890123456789", "text": "Hello, how are you?", "time": "2024-01-01T12:00:00Z" } }
Send DM to a user
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Parameters for sending DM
A message objects.
Response for sending DM