Skip to main content
GET
/
x
/
dm
/
{id}
/
history
Get DM history
curl --request GET \
  --url https://api.example.com/x/dm/{id}/history \
  --header 'x-api-key: <x-api-key>'
1 credit per result returned · All plans from $0.00012/credit
Requires a connected X account. Uses user-authenticated access.
curl -G https://xquik.com/api/v1/x/dm/44196397/history \
  -H "x-api-key: xq_YOUR_KEY_HERE" | jq

# Page 2
curl -G https://xquik.com/api/v1/x/dm/44196397/history \
  --data-urlencode "cursor=abc123" \
  -H "x-api-key: xq_YOUR_KEY_HERE" | jq

Path parameters

id
string
required
Target X user ID for the DM conversation (numeric string).

Query parameters

cursor
string
Pagination cursor. Pass the next_cursor value from the previous response to fetch older messages.

Headers

x-api-key
string
required
Your API key. Session cookie authentication is also supported.

Response

messages
object[]
Array of direct messages.
has_next_page
boolean
Whether older messages are available.
next_cursor
string
Opaque cursor for the next page. Empty string when no more messages.
{
  "messages": [
    {
      "id": "1893456789012345678",
      "text": "Hey, great tool!",
      "senderId": "44196397",
      "receiverId": "987654321",
      "createdAt": "2026-02-24T10:00:00.000Z"
    }
  ],
  "has_next_page": true,
  "next_cursor": "1893456789012345677"
}