X

X Direct Messages API

Endpoints related to retrieving, managing Direct Messages — 9 operation(s) in the X-published contract.

Operations 9

POST /2/dm_conversations Create DM conversation #
GET /2/dm_conversations/media/{dm_id}/{media_id}/{resource_id} Download DM Media #
GET /2/dm_conversations/with/{participant_id}/dm_events Get Direct Messages Events by Participant ID #
POST /2/dm_conversations/with/{participant_id}/messages Create DM message by participant ID #
POST /2/dm_conversations/{dm_conversation_id}/messages Create Direct Messages by Conversation ID #
GET /2/dm_conversations/{id}/dm_events Get Direct Messages Events by Conversation ID #
GET /2/dm_events Get Direct Messages Events #
DELETE /2/dm_events/{event_id} Delete DM event #
GET /2/dm_events/{event_id} Get Direct Messages Events by ID #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/x-direct-messages-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

x-direct-messages-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: X API v2 core endpoints
  version: '2.168'
  title: X API v2 Direct Messages API
  termsOfService: https://developer.x.com/en/developer-terms/agreement-and-policy.html
  contact:
    name: X Developers
    url: https://developer.x.com/
  license:
    name: X Developer Agreement and Policy
    url: https://developer.x.com/en/developer-terms/agreement-and-policy.html
servers:
- description: X API
  url: https://api.x.com
tags:


# --- truncated at 32 KB (81 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/x/refs/heads/main/openapi/x-direct-messages-api-openapi.yml