Skip to main content
This guide covers the key concepts you need to integrate the Direct Messages lookup endpoints into your application.

Authentication

DM endpoints require user authentication to access private conversations:
App-Only authentication is not supported. All Direct Messages are private.

Required scopes (OAuth 2.0)


Conversation types

One-to-one

Always has exactly two participants. Conversation ID format: {smaller_user_id}-{larger_user_id}

Group

Two or more participants. Membership can change over time.

Event types

Example events


Fields and expansions

Default fields

Available fields

Available expansions

Example with expansions

cURL

Pagination

DM events are returned in reverse chronological order (newest first):
cURL
Events from up to 30 days ago are available.

ID compatibility with v1.1

Conversation and event IDs are shared between v1.1 and v2 endpoints. This means you can:
  • Use v2 to retrieve events, then use v1.1 to delete specific messages
  • Reference conversation IDs from x.com URLs in API requests

Next steps

Quickstart

Make your first DM lookup request

Send DMs

Send Direct Messages

API Reference

Full endpoint documentation

Sample code

Working code examples