Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ keywords: ["changelog", "API updates", "release notes", "what's new", "API chang

To subscribe to updates, please [**“Turn on notifications”**](https://help.x.com/en/managing-your-account/notifications-on-mobile-devices#:~:text=In%20the%20top%20menu,%20you,you%20would%20like%20to%20receive) for [**@API**](https://x.com/api). You can also follow this changelog in your feed reader via the [**RSS feed**](https://docs.x.com/changelog/rss.xml).

<Update label="Dec 1, 2026" description="Developer Console">
### Zero-downtime OAuth 2.0 credential rotation

The [Developer Console](https://console.x.com) now supports grace-period credential rotation for long-lived OAuth 2.0 credentials so you can roll out replacement credentials across your services without downtime:

- **Supported credentials:** OAuth 2.0 App-only Bearer Tokens, OAuth 2.0 Client Secrets (including webhook CRC validation during the grace window), and OAuth 2.0 Bot Tokens.
- **Grace windows:** Choose **In 1 hour**, **In 24 hours**, **In 3 days**, or **In 7 days** to keep the previous credential active alongside the new one while you update your deployments, or choose **Now** to revoke immediately.
- **Early expiration:** Use **Expire now** to revoke a retiring credential as soon as your rollout is complete. At most one grace-period rotation can be active per credential at a time.

See [Rotating OAuth 2.0 credentials with a grace period](/fundamentals/security#rotating-oauth-20-credentials-with-a-grace-period).
</Update>

<Update label="Nov 30, 2026" description="X API v2">
### X Activity API: real-time trend events (`trends.new`)

Expand Down
4 changes: 2 additions & 2 deletions fundamentals/developer-apps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ These protocols cannot be used: `javascript`, `data`, `file`, `ftp`, `mailto`, `
<Card title="Use separate apps" icon="layer-group">
Create different apps for development, staging, and production.
</Card>
<Card title="Rotate credentials" icon="arrows-rotate">
Regenerate keys periodically and if you suspect a compromise.
<Card title="Rotate credentials" icon="arrows-rotate" href="/fundamentals/security#rotating-oauth-20-credentials-with-a-grace-period">
Rotate OAuth 2.0 credentials with zero downtime using a grace period, or revoke immediately if compromised.
</Card>
<Card title="Minimal permissions" icon="/icons/xds/icon-shield-check.svg">
Request only the permissions your app actually needs.
Expand Down
31 changes: 28 additions & 3 deletions fundamentals/security.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,42 @@ Your API keys and tokens are the keys to your app. Keep them secure:
Add credential files to `.gitignore`. Use tools like `git-secrets` to prevent accidental commits.
</Step>
<Step title="Rotate regularly">
Regenerate keys periodically and immediately if you suspect a compromise.
Rotate credentials periodically and immediately if you suspect a compromise. OAuth 2.0 credentials support [zero-downtime rotation with a grace period](#rotating-oauth-20-credentials-with-a-grace-period) in the Developer Console.
</Step>
<Step title="Use minimal permissions">
Only request the OAuth scopes your app actually needs.
</Step>
</Steps>

### Rotating OAuth 2.0 credentials with a grace period

You can rotate long-lived OAuth 2.0 credentials in the [Developer Console](https://console.x.com) without downtime by keeping the previous credential valid during a bounded grace window while you deploy the replacement across your services:

| Credential | Supported in Developer Console |
|:-----------|:-------------------------------|
| **App-only Bearer Token** | Rotate with a grace period and expire early |
| **OAuth 2.0 Client Secret** | Rotate with a grace period (also accepted for webhook CRC validation during the grace window) and expire early |
| **OAuth 2.0 Bot Token** | Rotate with a grace period and expire early |

When you click **Rotate** for one of these credentials, choose when the previous credential should expire:

- **Now** — immediately revokes the previous credential (recommended if a credential is compromised)
- **In 1 hour**, **In 24 hours**, **In 3 days**, or **In 7 days** — issues a new credential immediately while keeping the previous credential active until the selected time

While a grace window is active:

- Both the new credential and the retiring credential authenticate requests until the grace window ends.
- Click **Expire now** in the Developer Console at any time to revoke the retiring credential early once your rollout completes.
- At most one grace-period rotation can be active per credential at a time. To start another grace-period rotation, expire the retiring credential first. Choosing **Now** always revokes both the active and retiring credentials immediately for emergencies.

<Note>
Grace-period rotation applies to OAuth 2.0 App-only Bearer Tokens, OAuth 2.0 Client Secrets, and OAuth 2.0 Bot Tokens. OAuth 1.0a keys and tokens and short-lived OAuth 2.0 user access tokens are unchanged.
</Note>

### If credentials are compromised

1. **Regenerate immediately** in the [Developer Console](https://console.x.com)
2. **Revoke old tokens** — regenerating automatically invalidates old credentials
1. **Rotate immediately** in the [Developer Console](https://console.x.com) using the **Now** expiration option
2. **Revoke old tokens** — rotating with **Now** immediately invalidates both the current and any retiring credentials
3. **Audit usage** — check for unauthorized API activity
4. **Update your app** — deploy new credentials to all environments

Expand Down
Loading