DM
DM Send
Send a direct message to a user
POST /twitter/dm/send
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
auth_token | string | Yes | User's auth token |
recipient_id | string | No | Recipient user id |
recipient_username | string | No | Recipient username (without @) |
text | string | Yes | Message text |
Notes
- Provide either
recipient_idorrecipient_username. - If
recipient_usernameis 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!"
}'