GetXAPI
DM

DM Send

Send a direct message to a user

POST /twitter/dm/send

Request Body

FieldTypeRequiredDescription
auth_tokenstringYesUser's auth token
recipient_idstringNoRecipient user id
recipient_usernamestringNoRecipient username (without @)
textstringYesMessage text

Notes

  • Provide either recipient_id or recipient_username.
  • If recipient_username is used, it is resolved to a user id via the pool.

Response (200)

{
  "status": "success",
  "msg": "DM sent successfully",
  "data": {
    "id": "2019384131067818211",
    "createdAt": "2026-02-05T12:14:29.846Z",
    "senderId": "1858475867762270208",
    "recipientId": "1345154135381794816",
    "text": "Hello!",
    "recipient_username": "druv_kotwani"
  }
}

Error Responses

400 - Missing fields

{
  "error": "Missing required field: recipient_id or recipient_username"
}

Example

curl -X POST "https://api.getxapi.com/twitter/dm/send" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "auth_token": "your_auth_token",
    "recipient_username": "druv_kotwani",
    "text": "Hello!"
  }'

# With recipient_id
curl -X POST "https://api.getxapi.com/twitter/dm/send" \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "auth_token": "your_auth_token",
    "recipient_id": "1345154135381794816",
    "text": "Hello!"
  }'

On this page