App Logo
x.com

Send X DM

Send a direct message to an X user, addressed by handle. Returns the recipient, a sent flag and conversation_id. Delivery is confirmed by X's own send mutation returning HTTP 200, not by reading the DOM. conversation_id is null for a brand-new DM and for a DM to your own account (the compose dialog renders no existing-conversation cell to read the recipient id from) — a null there does not mean the send failed. A fresh session with no stored encryption keys may need the 4-digit E2E pin.

Input

handle required

Recipient's X handle without @

message required

Message text to send

pin optional

4-digit E2E passcode — required only if X shows the Enter Passcode screen (fresh session without stored encryption keys). Omit otherwise.

Output

sent required
recipient required
conversation_id optional

Derived as "<recipientId>-<ownId>", matching get_inbox's format. Null when the compose dialog offered no existing-conversation cell to read the recipient id from — the case for a brand-new DM and for a DM to your own account — so null here does not mean the send failed. Confirm delivery with get_messages if you need it.

Start building not clicking