Send DMs & read replies
Send direct messages from a connected account and read the resulting conversations.
Send a DM
POST/v1/dm/send10 credits
Target a recipient by recipient_username or recipient_id. Every write requires an Idempotency-Key header so a retried request never sends twice.
curl -X POST https://api.xautodm.com/v1/dm/send \
-H "Authorization: Bearer $XAUTODM_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"account_id":"acc_1a2b3c","recipient_username":"jack","text":"Hey — loved your post on X automation."}'| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Required | The connected account to send from. |
recipient_username | string | Optional | Recipient handle. Provide this or recipient_id. |
recipient_id | string | Optional | Recipient numeric user id. |
text | string | Required | The message body. |
Response:
Response
{
"data": { "sent": true, "message_id": "1750..." },
"meta": { "credits_charged": 10, "credits_remaining": 4990, "request_id": "req_..." }
}Respect X's limits. Sending too many DMs too fast risks the account — pace your sends and personalize each message.
List conversations
GET/v1/dm/conversations10 credits
List DM threads for a connected account. Pass account_id as a query param, optionally tab=all|requests|hidden.
curl https://api.xautodm.com/v1/dm/conversations?account_id=acc_1a2b3c \ -H "Authorization: Bearer $XAUTODM_API_KEY"
Read a conversation
GET/v1/dm/conversations/{id}10 credits
Fetch one thread's messages. Use this to detect replies and build an inbox or auto-responder on top of the API.
curl https://api.xautodm.com/v1/dm/conversations/CONV_ID?account_id=acc_1a2b3c \ -H "Authorization: Bearer $XAUTODM_API_KEY"