X (Twitter) · JSON Structure

X Api Dm Event Structure

DmEvent schema from X API v2

Type: object Properties: 13 Required: 2
Social-MediaMicrobloggingReal-Time DataStreamingAdvertisingContent

DmEvent is a JSON Structure definition published by X (Twitter), describing 13 properties, of which 2 are required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

attachments cashtags created_at dm_conversation_id event_type hashtags id mentions participant_ids referenced_tweets sender_id text urls

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/twitter/refs/heads/main/json-structure/x-api-dm-event-structure.json",
  "name": "DmEvent",
  "description": "DmEvent schema from X API v2",
  "type": "object",
  "properties": {
    "attachments": {
      "type": "object",
      "description": "Specifies the type of attachments (if any) present in this DM.",
      "properties": {
        "card_ids": {
          "type": "array",
          "description": "A list of card IDs (if cards are attached).",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        },
        "media_keys": {
          "type": "array",
          "description": "A list of Media Keys for each one of the media attachments (if media are attached).",
          "minItems": 1,
          "items": {
            "$ref": "#/components/schemas/MediaKey"
          }
        }
      }
    },
    "cashtags": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/components/schemas/CashtagEntity"
      }
    },
    "created_at": {
      "type": "datetime"
    },
    "dm_conversation_id": {
      "type": "string",
      "description": "Unique identifier of a DM conversation. This can either be a numeric string, or a pair of numeric strings separated by a '-' character in the case of one-on-one DM Conversations.",
      "pattern": "^([0-9]{1,19}-[0-9]{1,19}|[0-9]{15,19})$",
      "example": "123123123-456456456"
    },
    "event_type": {
      "type": "string",
      "example": "MessageCreate"
    },
    "hashtags": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/components/schemas/HashtagEntity"
      }
    },
    "id": {
      "type": "string",
      "description": "Unique identifier of a DM Event.",
      "pattern": "^[0-9]{1,19}$",
      "example": "1146654567674912769"
    },
    "mentions": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/components/schemas/MentionEntity"
      }
    },
    "participant_ids": {
      "type": "array",
      "description": "A list of participants for a ParticipantsJoin or ParticipantsLeave event_type.",
      "minItems": 1,
      "items": {
        "$ref": "#/components/schemas/UserId"
      }
    },
    "referenced_tweets": {
      "type": "array",
      "description": "A list of Posts this DM refers to.",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TweetId"
          }
        }
      }
    },
    "sender_id": {
      "type": "string",
      "description": "Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.",
      "pattern": "^[0-9]{1,19}$",
      "example": "2244994945"
    },
    "text": {
      "type": "string"
    },
    "urls": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/components/schemas/UrlEntityDm"
      }
    }
  },
  "required": [
    "id",
    "event_type"
  ]
}

Work with this as data

Every JSON Structure 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 json structure

4 MCP tools reach this
  • find_json_structuresBrowse and filter every JSON Structure in the catalog.
  • 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 JSON Structure
curl "https://apis.io/api/v1/json-structures/x-api-dm-event-structure"
All json structure
curl "https://apis.io/api/v1/json-structures?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.