Skip to content

X API OAuth 2.0 scopes

X OAuth 2.0 scopes for posting: tweet.read, tweet.write, and users.read for POST /2/tweets, media.write for uploads, offline.access for refresh tokens, dm.write.

Creating a post needs tweet.read, tweet.write, and users.read. Uploading media needs media.write. A refresh token needs offline.access. dm.write sends and manages Direct Messages. (Checked 2026-12-05.)

Facts

Fact Official value Source Checked
Scopes for creating a post tweet.read, tweet.write, users.read X API v2 authentication mapping 2026-12-05
tweet.write Post and repost for the user X API: OAuth 2.0 Authorization Code Flow with PKCE 2026-12-05
media.write Upload media for the user X API: Upload Media 2026-12-05
offline.access Stay connected until the user revokes access X API: OAuth 2.0 Authorization Code Flow with PKCE 2026-12-05
dm.write Send and manage Direct Messages X API: OAuth 2.0 Authorization Code Flow with PKCE 2026-12-05

Where official docs disagree

The official pages read for this page agree on every value above.

What PubNio enforces

  • PubNio asks for tweet.read, tweet.write, media.write, users.read, dm.read, dm.write, offline.access when an account connects.
  • Publishing to X needs tweet.write. Without it, readiness is permission_required with the missing scopes, and the publish stops before any provider call.

Read the live value

  • A provider 401 becomes an auth provider error and a 403 a permission error; neither is retried.
  • X error codes lists the errors PubNio returns for X and how to fix each.

Limits

  • PubNio uses OAuth 2.0 with PKCE only; it does not accept OAuth 1.0a keys.

Sources

Type to search…

↑↓ navigate↵ selectEsc close