Summary
The X Activity API (XAA) replaces the Account Activity API (AAA) for real-time user activity. Every activity type AAA delivers has an equivalent XAA event, and XAA adds many event types that AAA never supported. You have two ways to migrate:- Managed migration. Submit a request and the X team migrates your existing AAA subscriptions to XAA for you. See Managed migration.
- Self-serve migration. Create the XAA subscriptions yourself using the API. See Self-serve migration.
Benefits of XAA
- Covers everything AAA delivers. Posts, mentions, replies, quotes, reposts, deletes, likes, follows, blocks, mutes, DMs, typing indicators, read receipts, and app revocations all have XAA equivalents. See the event mapping.
- Granular subscriptions. Instead of an all-or-nothing subscription per user, choose exactly which event types you want for each user, and narrow them further with filter qualifiers such as
direction,post_id, andconversation_type. You only receive, and process, the events you need. - New event types. XAA supports event families AAA never served, including encrypted XChat messages, profile updates, live broadcast start, end, and chat events, Spaces, paid subscriptions, and Grok-curated news headlines filtered by keyword. See Supported event types.
- Webhook or streaming delivery. Receive events on your existing webhook, over a persistent HTTP stream, or both. The stream supports up to 5 minutes of backfill on connect and recovery of missed events with
start_timeandend_time. - Keep your webhook and your users’ authorizations. XAA uses the same V2 Webhooks API, CRC checks, and signature headers as AAA, so you can point XAA subscriptions at the webhook you already use. XAA accepts the OAuth 1.0a user access tokens you already hold, so users don’t need to re-authorize your app to migrate.
- OAuth 2.0 with fine-grained scopes. XAA supports OAuth 2.0, so you can request only the scopes you need (for example
dm.read,like.read,block.read,mute.read,tweet.read). OAuth 1.0a support in XAA will be deprecated soon, so plan to move your users to OAuth 2.0. - Same replay window. Recover events from the past 24 hours with
POST /2/webhooks/replay, the same window as AAA replay. - X API v2 data format. Post and user objects match the rest of X API v2, with related objects in
includes, so the same parsing code works across endpoints. - Better subscription management. Tag subscriptions, set an automatic
expires_at, list subscriptions for a single user, and delete up to 100 subscriptions in one request.
Managed migration
Enterprise customers can ask the X team to perform the migration for you. We’ll move your existing AAA subscriptions to the equivalent XAA subscriptions internally, so you don’t need to re-create subscriptions or ask your users to re-authorize your app.Submit a migration request
Confirm the details with our team
Update your webhook consumer
Verify delivery
GET /2/activity/subscriptions.AAA to XAA event mapping
AAA delivers every activity type below for each subscribed user. In XAA, each event type is a separate subscription.oauth.revoke). Each one counts toward your subscription limit, so only subscribe to the event types you use. Contact your account manager if you need a higher limit.
What changes for your integration
Payload format
AAA sends v1.1 objects keyed by activity type, withfor_user_id identifying the subscribed user. XAA wraps every event in a common envelope and uses X API v2 objects.
Behavior differences
Self-serve migration
Inventory your AAA subscriptions
GET /2/webhooks, then list the subscribed users on each with GET /2/account_activity/webhooks/:webhook_id/subscriptions/all/list.Choose event types
Update your webhook consumer
Create XAA subscriptions
POST /2/activity/subscriptions once per user and event type, passing your existing webhook_id. Authenticate with the subscribed user’s access token: either an OAuth 2.0 token with the matching scope, or the OAuth 1.0a token you already use for AAA. Public events can also be created with your app’s bearer token. See Event privacy and authentication.Verify delivery
Remove AAA subscriptions
DELETE /2/account_activity/webhooks/:webhook_id/subscriptions/:user_id/all.Frequently asked questions
Can I keep using my current webhook?
Can I keep using my current webhook?
webhook_id when you create XAA subscriptions. CRC checks and signature verification work the same way.Will I receive duplicate events during the migration?
Will I receive duplicate events during the migration?
Can I receive events without a webhook?
Can I receive events without a webhook?
GET /2/activity/stream to receive events for all your subscriptions over a persistent HTTP connection. A subscription with a webhook_id is delivered to both the webhook and the stream when the stream is open.What happens to AAA after January 1, 2027?
What happens to AAA after January 1, 2027?
How does XAA affect my Enterprise contract?
How does XAA affect my Enterprise contract?