X (Twitter) inbox API
PubNio's X (Twitter) inbox reads direct messages, replies to the account's posts, and posts that mention it. It syncs them from webhooks only and reports, but does not enforce, a 30-day DM window (provider rules checked 2026-12-05).
What the inbox reads
| Channel | Read | Writes | Attachments | Sync |
|---|---|---|---|---|
| Direct messages | Yes | send | No | Webhook only |
| Comments | Yes | reply, hide, unhide, like, unlike, delete | Yes | Webhook only |
| Mentions | Yes | reply | No | Webhook only |
- Everything arrives as X Activity API events:
dm.received,dm.sent,dm.read,post.reply.create, andpost.mention.create. Replies are filed as comments in a thread for the conversation's first post. - Encrypted XChat messages are separate X events PubNio does not subscribe to, so they never reach the inbox.
- The inbox needs a plan with X reads: Pro, Platform, or Enterprise. On any other plan every channel reports
unavailablewith reasonplan_requiredand actionupgrade_plan, and keeps only list and read.
Reply window
Policy x_dm_30_days. The capabilities response names it; a conversation reports when it ends.
- A conversation's
replyWindow.endsAtis 30 days after the last inbound message, butopenstaystrue: PubNio does not refuse a send because a DM is old. - The 30 days match how far back X's own DM lookup reaches: events from up to 30 days ago.
Sync
Webhook events are the only source; there is no pull to fall back on.
- X is never polled. A sync started for an X account stops at once with
webhook_only, so starting an inbox sync brings in nothing new. - Missed deliveries are replayed from X's 24-hour replay window. A gap PubNio cannot replay shows on the account as
deliveryGapwith actionreview_on_xfor 30 days.
Scopes
| Channel | Scopes |
|---|---|
| Direct messages | dm.read, dm.write, users.read |
| Comments | tweet.read, tweet.write, users.read |
| Mentions | tweet.read, tweet.write, users.read |
Without a scope, reads keep working: the capabilities response lists it in missingScopes and drops send, reply, hide, like, and delete until the account reconnects with it. A write the channel lacks fails with HTTP 422 capability-unsupported.
- The activity subscription itself needs
tweet.read,dm.read, andusers.read. Without all three, every channel reportsunavailablewith reasonmissing_scopesand actionreconnect_account. dm.writeis X's scope to send and manage Direct Messages for the user.
Capabilities response
What the inbox capabilities endpoint returns in `accounts[]` for an X account connected with every scope above on a plan without X reads. The other fields (`accountId`, `publishingReadiness`, `accountCapabilities`, `lastSyncError`, `deliveryGap`, `checkedAt`) are left out.
{
"provider": "x",
"accountKind": "social_account",
"messaging": {
"resource": "conversation",
"supported": true,
"operations": ["list", "read"],
"attachments": false,
"quickReplies": false,
"buttons": false,
"readReceipts": false,
"moderation": false,
"syncMode": "webhook",
"backfillDays": 0,
"missingScopes": [],
"missingTasks": [],
"unavailable": {
"reason": "plan_required",
"action": "upgrade_plan"
}
},
"comments": {
"resource": "comment_thread",
"supported": true,
"operations": ["list", "read"],
"attachments": true,
"quickReplies": false,
"buttons": false,
"readReceipts": false,
"moderation": true,
"syncMode": "webhook",
"backfillDays": 0,
"missingScopes": [],
"missingTasks": [],
"unavailable": {
"reason": "plan_required",
"action": "upgrade_plan"
}
},
"mentions": {
"resource": "mention",
"supported": true,
"operations": ["list", "read"],
"attachments": false,
"quickReplies": false,
"buttons": false,
"readReceipts": false,
"moderation": false,
"syncMode": "webhook",
"backfillDays": 0,
"missingScopes": [],
"missingTasks": [],
"unavailable": {
"reason": "plan_required",
"action": "upgrade_plan"
}
},
"replyWindow": {
"open": true,
"policy": "x_dm_30_days",
"endsAt": null
}
}
Limits
- Hiding works on replies to the account's own posts only; X does not let an account hide replies elsewhere.
- No history:
backfillDaysis 0, so the inbox starts with the first event after the subscription goes live. - PubNio clears message, comment, and mention text 90 days after the network created it, and deletes stored attachments after 30 days.
Sources
- X Activity API, read 2026-12-05
- X API: Direct Messages Lookup, read 2026-12-05
- X API: Create Replay Job for Webhook, read 2026-12-05
- X API: OAuth 2.0 Authorization Code Flow with PKCE, read 2026-12-05
- X API: Hide Replies, read 2026-12-05

