---
title: "X API OAuth 2.0 scopes"
description: "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."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# X API OAuth 2.0 scopes

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](https://docs.x.com/resources/fundamentals/authentication/guides/v2-authentication-mapping)                | 2026-12-05 |
| tweet.write                | Post and repost for the user                 | [X API: OAuth 2.0 Authorization Code Flow with PKCE](https://docs.x.com/resources/fundamentals/authentication/oauth-2-0/authorization-code) | 2026-12-05 |
| media.write                | Upload media for the user                    | [X API: Upload Media](https://docs.x.com/x-api/media/upload-media)                                                                          | 2026-12-05 |
| offline.access             | Stay connected until the user revokes access | [X API: OAuth 2.0 Authorization Code Flow with PKCE](https://docs.x.com/resources/fundamentals/authentication/oauth-2-0/authorization-code) | 2026-12-05 |
| dm.write                   | Send and manage Direct Messages              | [X API: OAuth 2.0 Authorization Code Flow with PKCE](https://docs.x.com/resources/fundamentals/authentication/oauth-2-0/authorization-code) | 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

- [`GET /api/v1/integrations/capabilities`](https://pubnio.com/api/v1/docs#tag/capabilities/GET/api/v1/integrations/capabilities) reports, per connected X account, each
  capability's state and any `missingScopes`; [`GET /api/v1/capabilities`](https://pubnio.com/api/v1/docs#tag/capabilities/GET/api/v1/capabilities) lists
  the scopes a publish needs.

## Related errors

- A provider 401 becomes an `auth` provider error and a 403 a `permission` error; neither is retried.
- [X error codes](https://pubnio.com/docs/errors/x/) 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

- [X API v2 authentication mapping](https://docs.x.com/resources/fundamentals/authentication/guides/v2-authentication-mapping), checked 2026-12-05

  ```text
  Scopes: tweet.read tweet.write users.read
  ```

- [X API: OAuth 2.0 Authorization Code Flow with PKCE](https://docs.x.com/resources/fundamentals/authentication/oauth-2-0/authorization-code), checked 2026-12-05

  ```text
  Tweet and Retweet for you.
  Stay connected to your account until you revoke access.
  Send and manage Direct Messages for you.
  ```

- [X API: Upload Media](https://docs.x.com/x-api/media/upload-media), checked 2026-12-05

  ```text
  Upload media, such as photos and videos, on your behalf.
  ```

## Related

- [Posting limits](https://pubnio.com/docs/providers/x/limits/)
- [Rate limits and quota](https://pubnio.com/docs/providers/x/quota/)
- [App review and access](https://pubnio.com/docs/providers/x/app-review/)
- [Token lifetimes](https://pubnio.com/docs/providers/x/tokens/)
- [Media requirements](https://pubnio.com/docs/providers/x/media/)
- [API versions](https://pubnio.com/docs/providers/x/versioning/)
- [X error codes](https://pubnio.com/docs/errors/x/)
- [Publishing to X](https://pubnio.com/docs/networks/x/)
- [Provider API explainers](https://pubnio.com/docs/providers/)

Source: https://pubnio.com/docs/providers/x/scopes/index.mdx
