What is direct-messages.js in your X archive?
direct-messages.js holds your one-to-one direct message conversations. Each message has its text, sender and recipient account IDs, when it was sent, any reactions, and links to attached media. Group chats are in a separate file.
How to open it
It is a text file in the archive’s data folder. Open it in any text editor; delete the first line’s window.YTD... = prefix and the rest is plain JSON any JSON tool can read. Our free viewer does not read this file yet; it covers likes, bookmarks and your own posts.
Fields in direct-messages.js
| Field | What it means |
|---|---|
| id | ID of the message. |
| senderId | Account ID of the sender. |
| recipientId | Account ID of the recipient. |
| text | Text of the message. |
| createdAt | When the message was sent. |
| mediaUrls | Links to attached photos, videos or GIFs. |
| urls | Details of links shared in the message. |
| reactionKey | Type of reaction, such as a heart or laugh. |
| reactionSenderID | Account that reacted. |
| reactionCreatedAt | When the reaction was added. |
What it is useful for
- Finding an old conversation, address or link someone sent you.
- Keeping a copy of messages before leaving the platform.
What to watch out for
- Senders and recipients are account IDs, not handles. Match them against follower.js and following.js, or look them up on X.
- This is private correspondence that includes other people's messages. Do not upload it to tools you do not trust.
Related files
- direct-messages-group.js : Your group chats
- follower.js : Your followers
- following.js : Accounts you follow
Field names come from the README.txt X includes in every archive. X changes the archive from time to time, so check the README in your own download if something differs. See every file in the archive.