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).

Live · provider rules read 2026-12-05View as Markdown

What the inbox reads

ChannelReadWritesAttachmentsSync
Direct messagesYessendNoWebhook only
CommentsYesreply, hide, unhide, like, unlike, deleteYesWebhook only
MentionsYesreplyNoWebhook only
  • Everything arrives as X Activity API events: dm.received, dm.sent, dm.read, post.reply.create, and post.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 unavailable with reason plan_required and action upgrade_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.endsAt is 30 days after the last inbound message, but open stays true: 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 deliveryGap with action review_on_x for 30 days.

Scopes

ChannelScopes
Direct messagesdm.read, dm.write, users.read
Commentstweet.read, tweet.write, users.read
Mentionstweet.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, and users.read. Without all three, every channel reports unavailable with reason missing_scopes and action reconnect_account.
  • dm.write is 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.

response-fields.json
{
  "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: backfillDays is 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