DM
DM Conversation
Fetch the full message history of a single Twitter DM conversation via API, newest first with cursor pagination. $0.001 per call. GetXAPI DM conversation endpoint docs.
POST
/twitter/dm/conversationThis endpoint costs $0.001 per API call and returns ~50 messages per page.
Fetches the full message history of one conversation, newest first, with cursor pagination. Get the conversation_id from DM List.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
auth_token | string | Yes | User's auth token |
conversation_id | string | Yes | Conversation ID from /twitter/dm/list (e.g. 3012852462-1345154135381794816) |
cursor | string | No | next_cursor from a previous response — fetches older messages |
count | number | No | Page size (default 50) |
proxy | string | No | Proxy URL (http://, https://, socks5://, or socks4://) |
Notes
- Messages carry the same rich fields as DM List:
media(photo/video/gif),shared_tweet,card,links,reactions,reply_to_message_id,edit_count. - Page through
next_cursoruntilhas_moreisfalseto read the whole thread.
Response (200)
{
"userId": "1345154135381794816",
"conversation_id": "3012852462-1345154135381794816",
"message_count": 14,
"has_more": false,
"next_cursor": null,
"messages": [
{
"id": "2059239475419779072",
"conversationId": "3012852462-1345154135381794816",
"createdAt": "2026-05-26T10:11:00.000Z",
"senderId": "3012852462",
"recipientId": "1345154135381794816",
"text": "see you then",
"media": null,
"shared_tweet": null,
"card": null,
"links": [],
"reactions": [],
"reply_to_message_id": null,
"edit_count": 0
}
],
"events": [],
"users": {
"3012852462": {
"id": "3012852462",
"screen_name": "someuser",
"name": "Some User",
"profile_image_url": "https://pbs.twimg.com/...",
"verified": false,
"is_blue_verified": true,
"protected": false
}
}
}Error Responses
400 - Missing conversation_id
{
"error": "Missing required field: conversation_id (get it from /dm/list)"
}401 - Invalid auth_token
{
"error": "Invalid auth_token - could not extract userId"
}Example
curl -X POST "https://api.getxapi.com/twitter/dm/conversation" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"conversation_id": "3012852462-1345154135381794816"
}'
# Older messages (pagination)
curl -X POST "https://api.getxapi.com/twitter/dm/conversation" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"conversation_id": "3012852462-1345154135381794816",
"cursor": "1956659797668864455",
"count": 50
}'DM List
List Twitter DM conversations and messages via API across the All, Requests, and Hidden inboxes. $0.002 per call, ~50 per page. GetXAPI DM list endpoint docs.
DM Send
Send Twitter direct messages programmatically via API. $0.002 per call. GetXAPI DM send endpoint documentation with code examples.