Skip to main content
POST
/
twitter
/
send-dm
Send DM
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": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
  "proxy": "http://username:password@ip:port"
}'
{
  "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"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Parameters for sending DM

username
string
required

Twitter username to send DM to

Example:

"myusername"

msg
string
required

Message to send

Example:

"Hello, how are you?"

Twitter authentication cookie or Twitter auth_token, how-to-get-twitter-cookie

Example:

"ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7"

reply_to
string | null

Reply to message ID

Example:

"1234567890123456789"

proxy
string | null

The proxy to use.Please use high-quality residential proxies and avoid free proxies.Required.Example: http://username:password@ip:port . You can get proxy from: https://app.proxy-cheap.com/r/qiMxub

Example:

"http://username:password@ip:port"

Response

A message objects.

Response for sending DM

code
integer
required

Response code

Example:

200

msg
string
required

Message sent

Example:

"success"

data
object
required

message object