App Logo
x.com

Get X DM messages

Fetch all messages in a DM conversation, addressed by handle or by conversation_id. Returns conversation_id, the other party's handle, and messages with text, sender, direction, date and time. If X shows the Enter Passcode screen, pass the 4-digit E2E pin.

Input

pin optional

4-digit E2E passcode — required only if X shows the Enter Passcode screen. Omit otherwise.

handle optional

Recipient's X handle, with or without a leading @. Resolved to a user id via the profile page, so it works for any conversation, not just ones already loaded in the inbox.

conversationId optional

conversation_id from get_inbox, e.g. "1667221889486340115-1995746956204015616" (":" separator also accepted). Required for group conversations, whose id is not a user-id pair.

Output

messages required
conversation_id required
note optional
empty optional

True when the conversation opened but has no rendered messages.

participant optional

Handle of the other party, read from the thread header (without @). Null in group conversations.

Start building not clicking