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>",
  "proxy": "<string>",
  "media_id": "<string>",
  "reply_to_message_id": "<string>"
}
'
{
  "message_id": "<string>",
  "status": "<string>",
  "msg": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.twitterapi.io/llms.txt

Use this file to discover all available pages before exploring further.

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 [blocked] . You can get proxy from: https://www.webshare.io/?referral_code=4e0q1n00a504

media_id
string

ID of a single media asset to attach. Optional. Obtain from /twitter/upload_media_v2.

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