Direct Messages

DM Conversation

Fetch the messages inside a single DM conversation. Pass a conversation_id from GET /dm/list. Each message carries its ID, sender ID, timestamp, and text. Authenticate with a registered session (POST /customer/session) or per-call x-auth-token and x-ct0 headers. Read-only: this does not send DMs. Cost: $0.0016 per call.

get/dm/conversation

Request

  • Base URL: https://api.twitterapis.com/twitter
  • URL: https://api.twitterapis.com/twitter/dm/conversation
  • Auth: HTTP bearer

Query parameters

conversation_idstring required

Conversation ID from a GET /dm/list entry.

Example:1749154312754794496-1972455697997824000
max_idstring

Page backwards: return entries older than this entry id. Pass the previous page's min_entry_id to walk a thread back in time; omit for the newest page. Must be a numeric entry id; any other value returns 400.

Example:1972455697997824000
fieldsstring

Comma-separated list of dotted field paths to keep in the response (one parameter, never repeated), applied to every object in the returned lists and to nested objects (for example fields=id,text,author.username; the list's own name may prefix a path, fields=tweets.id). A path prefix that lands on an array applies to each element (media.media_url_https). Pagination and envelope keys (next_cursor, cursor, has_more, count, partial, error, message, reason) are always kept. Unknown paths are ignored; up to 50 paths of up to 6 segments. Projection never changes status codes or billing, and applies to data reads only: account, feedback, session status, monitor (other than deliveries), webhook and stream-compat reads return their bodies unchanged.

compact'1'

Set to 1 (or true) to apply the built-in compact preset: ids, url, text, created_at, lang, the engagement counts, the is_retweet/is_reply/is_quote flags, conversation ids, the author's id/username/name/followers_count/verification, and the quoted or retweeted tweet's id/url/author username. The preset trims what it recognises and leaves alone what it would empty, so it never turns a body into {}. Combine with fields to add paths on top of the preset. Typically cuts a tweet page by 70 to 90 percent for LLM tool callers.

Response

Read the message history of one DM conversation by conversation_id.

conversation_idstring

Echo of the conversation_id you requested.

min_entry_idstring nullable

Oldest entry id on this page. Pass it as max_id to fetch the next older page; null when X sent no entries.

max_entry_idstring nullable

Newest entry id on this page; null when X sent no entries.

countinteger

Number of messages returned.

Changes

No recorded changes to this operation across all 1 revision of this API.