Get DMs by conversation

GET https://api.twitter.com/2/dm_conversations/:dm_conversation_id/dm_events?dm_event.fields=id,text,event_type,dm_conversation_id,created_at,sender_id,attachments,participant_ids,referenced_tweets&tweet.fields=created_at&expansions=sender_id,referenced_tweets.id,attachments.media_keys,participant_ids

Request Params

KeyDatatypeRequiredDescription
dm_event.fieldsstringAllowed values: id,text,event_type,dm_conversation_id,created_at,sender_id,attachments,participant_ids,referenced_tweets
id, text, and event_type are returned by default.
Comma-separated list of fields (with no spaces).
event_typesstringAllowed values: MessageCreate,ParticipantsJoin,ParticipantsLeave
Comma-separated list of fields (with no spaces).
All event types are returned by default.
max_resultsnumberThe maximum number of search results to be returned by a request. A number between 1 and the system limit (currently 100). By default, a request response will return 100 results.
pagination_tokennullThis parameter is used to get the next or previous 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
media.fieldsnullAllowed values: duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width
Default values: media_key,type
Requires the attachments.media_keys expansion.
Comma-separated list of fields (with no spaces).
tweet.fieldsstringAllowed values: attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld
Default fields: id, text, and edit_history_tweet_ids.
Requires the referenced_tweets.id expansion.
Comma-separated list of fields (with no spaces).
user.fieldsstringAllowed values: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values: id,name,username
Requires the participants_ids and/or sender_id expansions.
Comma-separated list of fields (with no spaces).
expansionsstringAllowed values: sender_id,referenced_tweets.id,attachments.media_keys,participant_ids
Comma-separated list of fields (with no spaces).