Timeline & DMs
Get DM history
Read participant-scoped X direct message history with a connected account, store private rows, and resume older pages with next_cursor
GET
Get DM history
Documentation Index
Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
Use this file to discover all available pages before exploring further.
1 credit per result returned · All plans from $0.00012/credit
account, store message IDs plus next_cursor, and keep full message text only
in private systems.
Requires a connected X account passed via the
account query parameter. DM history is participant-scoped, so pass the connected account that belongs to the conversation.DM history responses can contain private message text. Store them in a
private support, CRM, warehouse, or agent memory system.
Do not write full DM bodies to shared logs or public artifacts.
Which DM workflow?
Read conversation history
Use
GET /x/dm/{userId}/history with account, then store
messages[].id and next_cursor in a private system.Send text reply
Use
POST /x/dm/{userId}, pass the same
connected account, and store the returned messageId.Send one media item
Use
POST /x/media first, then pass
the returned media ID as the only media_ids item on the DM send.Resolve participant ID
Use
GET /x/users/{id} when a workflow starts
from a handle and needs the numeric userId for history or send calls.dm_history rows. Store
message_id, sender_id, receiver_id, message_text, created_at,
optional media_url, conversation_user_id, sender_account, and
page_next_cursor. Keep message_text only in private systems; use the IDs,
timestamp, media URL, and job status in shared logs.
Path parameters
Target X user ID for the DM conversation (numeric string).
Query parameters
X handle (without the
@ prefix) of the connected X account used to read the conversation. DM history is participant-scoped, so the account must belong to the conversation. Connect an account on the dashboard before calling this endpoint.Pagination cursor. Pass the
next_cursor value from the previous response to fetch older messages.Legacy pagination cursor. Use
cursor for new integrations. When both are present, cursor takes precedence.Headers
Your API key. Session cookie authentication is also supported.
Response
- 200 OK
- 400 Invalid user ID
- 400 Account required
- 401 Unauthenticated
- 402 Subscription required
- 403 DM not permitted
- 403 Account restricted
- 403 Account needs reauth
- 404 Account not found
- 429 Rate Limit Exceeded
- 424 Dependency Failed
History sync handoff
Use this endpoint when a CRM, support desk, warehouse job, or agent needs participant-scoped DM context before sending a reply.Dedupe imported messages
Store
messages[].id as the external DM ID for CRM notes, support tickets,
warehouse rows, or agent memory.Preserve participants
Store
messages[].senderId and messages[].receiverId with the connected
account so each private conversation stays tied to the correct sender.Resume older pages
Store
next_cursor when has_next_page is true, then pass it as cursor
on the next sync job.Keep media context
Store optional
messages[].mediaUrl with messages[].createdAt when a DM
includes an image, GIF, or video attachment.Related: Direct Message Workflow for
lookup, participant-scoped history sync,
messageId storage, and media
handoff; Get User to resolve the recipient
userId; Send DM to reply from the
connected account; Upload Media when
a reply needs one uploaded mediaId.Last modified on May 25, 2026
Get DM history