Skip to main content
POST
/
twitter
/
send_dm_to_user
cURL
curl --request POST \
  --url https://api.twitterapi.io/twitter/send_dm_to_user \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "login_cookies": "<string>",
  "user_id": "<string>",
  "text": "<string>",
  "media_ids": [
    "<any>"
  ],
  "proxy": "<string>",
  "reply_to_message_id": "<string>"
}'
{
  "message_id": "<string>",
  "status": "<string>",
  "msg": "<string>"
}

Authorizations

X-API-Key
string
header
required

Body

application/json
login_cookies
string
required

The login cookie of the user.You can get the login_cookies from /twitter/user_login_v2.Must be set

user_id
string
required

The id of the user to send the direct message to.Must be set

text
string
required

The text of the direct message.Must be set

proxy
string
required

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://www.webshare.io/?referral_code=4e0q1n00a504

media_ids
any[]

The ids of the media to post.Optional.You can get the media_ids from /twitter/upload_image_v2 (to be developed)

reply_to_message_id
string

The id of the message to reply to.Optional

Response

Login response

message_id
string

The id of the sent direct message.

status
string

Status of the request.success or error

msg
string

Message of the request.error message