GetXAPI
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/conversation

This 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

FieldTypeRequiredDescription
auth_tokenstringYesUser's auth token
conversation_idstringYesConversation ID from /twitter/dm/list (e.g. 3012852462-1345154135381794816)
cursorstringNonext_cursor from a previous response — fetches older messages
countnumberNoPage size (default 50)
proxystringNoProxy 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_cursor until has_more is false to 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
  }'

On this page