Account Activity API Ends in 2027: X Activity API Example
X ends the Account Activity API on 28 February 2027. What its successor, the X Activity API, costs per event, who can use it, and a tested webhook example.
Weir Team
Published · Updated · 7 min read
The X Activity API (XAA) replaces the Account Activity API and pushes real-time events for chosen user ids to a webhook.
This is for developers who want mentions, replies, DMs, follows or deleted posts pushed to a URL on X (Twitter). X's own docs say the Account Activity API reaches end of life on 28 February 2027. You get the facts, a tested handler for the check X runs on your URL, and a public-data option. We run Weir, that option.
Here is the webhook check X runs first, as a function you can copy:
import base64, hashlib, hmac, json
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse, parse_qs
SECRET = "your-client-secret" # the app's OAuth 2.0 client secret
def sign(data: bytes) -> str:
mac = hmac.new(SECRET.encode(), data, hashlib.sha256).digest()
return "sha256=" + base64.b64encode(mac).decode()
- Register a webhookPOST /2/webhooks with your HTTPS URL.
- Pass the CRC checkAnswer the GET with a signed response_token.
- Subscribe to eventsPOST /2/activity/subscriptions with an event type and user id.
- Verify each deliveryCheck the signature header on the raw body.
Is the Account Activity API deprecated?
Yes. The top of X's Account Activity API introduction and quickstart pages carries the same warning, checked on 16 November 2026: "The Account Activity API (AAA) is being deprecated. Check out the X Activity API (XAA) for real-time user activity delivery going forward."
X's AAA-to-XAA migration guide gives the date, checked on 17 November 2026: AAA "reaches end of life on February 28, 2027". The old replay endpoint went first: X's changelog deprecated it on 25 March 2026 for POST /2/webhooks/replay.
So build new work on XAA, and move existing AAA webhooks before that date.
What is the X Activity API?
XAA lets you create a subscription for an event type and a user id, then receive matching events. Delivery is a webhook or a persistent HTTP stream at GET /2/activity/stream.
X launched the open beta on 18 October 2025. It added post.create and post.delete on 4 June 2026, mute and block events on 21 July 2026, and broadcast.chat.remove on 29 September 2026, per X's changelog.
The event list as of 16 November 2026:
- Posts:
post.create,post.delete,post.mention.create,post.reply.create,post.quote.create,post.repost.create. - Social:
like.create,follow.follow,follow.unfollow,mute.mute,block.blockand their reverses. - Messages:
dm.received,dm.sent,dm.read,chat.received,chat.sent. - Account:
profile.update.*,oauth.revoke, plus Spaces and broadcast events.
Likes, DMs, mentions, replies, mutes and blocks are private events. The user must grant your app OAuth 2.0 access first. Posts from protected accounts are never delivered.
Account Activity API vs X Activity API
The table uses only what X's docs state on 16 November 2026.
| Row | Account Activity API (AAA) | X Activity API (XAA) |
|---|---|---|
| Delivery | Webhook | Webhook or HTTP stream |
| Events | Posts, DMs, likes, follows, blocks, mutes | Same ideas as dotted names; adds profile |
| Tiers | Pay Per Use and Enterprise | Self-serve, Enterprise, Partner |
| Limits | 3 subscriptions and 1 webhook (pay-per-use) | 1,500 subscriptions (self-serve) |
| Billing | Not stated on the pricing page | Per delivered event |
| Status | Ends 28 Feb 2027 | Current; beta since 18 Oct 2025 |
AAA's Enterprise row is 5,000+ subscriptions and 5+ webhooks. XAA's Enterprise cap is 75,000 and Partner is 150,000. X's docs do not state an XAA webhook count.
How much does the X Activity API cost?
XAA is billed per event delivered. X's pay-per-usage pricing page, checked 16 November 2026, lists these rates:
post.delete, dm.sent and dm.read are listed as not billed. The XAA page says every Post event, deletes included, is "billed as a Post", so the two pages disagree on post.delete. Check your Developer Console invoice.
Events are deduplicated within one 24-hour UTC window. The pricing page names no event count for post.reply.create, so we cannot give its rate.
One worked case: 1,000 post.create events in a day cost $5.00.
Does the X Activity API work on pay-per-use?
Probably yes, but X never says it in one sentence. The XAA page lists a "Self-serve" tier with 1,500 subscriptions. The pricing page, which is the pay-per-usage page, prices XAA events. The AAA quickstart says AAA is "available on the Enterprise and Pay Per Use tiers".
The news.new event is Enterprise and Partner only. Everything you need for your own account's mentions, replies and DMs is not.
Account Activity API example: register and receive
X's Webhooks API needs an HTTPS URL, no port, an answer within 10 seconds, and a CRC reply. X sends GET <url>?crc_token=.... You return {"response_token": "sha256=" + base64(hmac_sha256(secret, crc_token))}.
Each POST carries X-Twitter-Webhooks-Signature-OAuth2, the same HMAC over the raw body. Here is the handler. We did not run it against X, because we have no XAA access. We ran it against fake requests on 16 November 2026:
class Hook(BaseHTTPRequestHandler):
def reply(self, code, obj=b""):
self.send_response(code)
self.end_headers()
self.wfile.write(obj)
def do_GET(self): # the CRC check
token = parse_qs(urlparse(self.path).query).get("crc_token", [""])[0]
self.reply(200, json.dumps({"response_token": sign(token.encode())}).encode())
def do_POST(self): # an event
body = self.rfile.read(int(self.headers["Content-Length"]))
got = self.headers.get("X-Twitter-Webhooks-Signature-OAuth2", "")
ok = hmac.compare_digest(sign(body), got)
self.reply(200 if ok else 401)
print("event" if ok else "bad signature", body[:80])
Serve it with HTTPServer(("", 8080), Hook).serve_forever(). For crc_token=abc123 and the secret your-client-secret, it returned the same token openssl gave us: sha256=yNAq1jaL58yA11uUs+4FWqWJrclWS6idud5A/TalgXA=. A correct signature got 200 and a wrong one got 401.
Apps with only an OAuth 1.0 consumer secret get the older X-Twitter-Webhooks-Signature header, signed with that secret.
Then subscribe, using X's own request shape:
{
"event_type": "post.reply.create",
"filter": { "user_id": "2244994945" },
"webhook_id": "YOUR_WEBHOOK_ID"
}
Send it to POST https://api.x.com/2/activity/subscriptions with your bearer token. Private events need the user's OAuth 2.0 token instead.
X API webhooks 2026: what about public data?
XAA follows user ids. It does not search keywords. X's own XAA page sends keyword needs to the Filtered Stream, and its webhook delivery is Enterprise only per X's changelog.
For public posts you do not own, a Weir monitor fits. It runs a saved X search on a schedule, then POSTs only new matches to your URL, signed. Our guides cover it: the Twitter webhook API, watching one account by webhook and the Weir webhooks page.
Create a webhook, then a monitor that points to its webhookId (docs.weirapp.io/monitors):
curl -X POST https://api.weirapp.io/v1/monitors \
-H "Authorization: Bearer $WEIR_API_KEY" -H 'Content-Type: application/json' \
-d '{"name":"XDevelopers mentions","schedule":"hourly","webhookId":"<id>",
"target":{"kind":"search","query":"@XDevelopers -filter:replies","sources":["x"]}}'
Each run reads about 20 of the newest matches. A delivery is monitor.result.created, up to 25 items, with weir-signature, weir-timestamp and weir-event-id headers. The signature is a hex HMAC-SHA256 of timestamp.eventId.rawBody, which is not X's scheme. Weir's docs have a Python verifier.
We ran a three-post search on 16 November 2026 for original posts that mention @XDevelopers. It cost 4 credits and returned id, text, url, createdAt, author, likeCount and replyCount, all dated that day. We do not show the posts, because their authors are private people.
A free account gets one monitor and one webhook, run daily or weekly. Any purchase from $5 allows hourly runs. A monitor checked hourly costs about 720 credits a month at the minimum, so 300 new posts cost about 1,020 credits, roughly $0.20.
Weir does not deliver account events. It never sends DMs, follows or likes on your own account. For those, use XAA.
When not to use Weir
- You need your own DMs, follows, likes or blocks. Those are private events only X delivers, with the user's consent.
- You need seconds, not minutes. Weir polls on a schedule. XAA pushes events as they happen.
- You need every event. A search monitor reads one page of about 20 newest matches per run, so busy queries lose the oldest.
- You need X's terms behind it. Weir is not licensed by X, so access can change.
FAQ
Is the Account Activity API deprecated?
Yes. X's Account Activity API pages say it "is being deprecated", and X's migration guide gives its end of life as 28 February 2027. Build new webhooks on XAA.
How much does the X Activity API cost?
XAA bills per delivered event. As of 16 November 2026, post.create is $0.005, follow.follow and dm.received are $0.010, and mute and block events are $0.001. Several events are not billed.
Does the X Activity API work on pay-per-use?
It appears so. X's pay-per-usage page prices XAA events, and the XAA page lists a self-serve tier with 1,500 subscriptions. news.new is Enterprise and Partner only.
Account Activity API example: how do I answer the CRC check?
Return {"response_token": "sha256=..."} where the value is the base64 HMAC-SHA256 of crc_token, keyed with your app's OAuth 2.0 client secret. The handler above does it. We tested the math locally, not against X.
Sources
- Account Activity API introduction, X docs, checked 16 November 2026.
- Account Activity API quickstart, X docs, checked 16 November 2026.
- AAA to XAA migration guide, X docs, checked 17 November 2026.
- X Activity API overview, X docs, checked 16 November 2026.
- X Activity API quickstart, X docs, checked 16 November 2026.
- V2 Webhooks API and webhooks quickstart, X docs, checked 16 November 2026.
- X API pay-per-usage pricing, X docs, checked 16 November 2026.
- X API changelog, X docs, checked 16 November 2026.
- Monitors and webhooks, Weir docs, checked 16 November 2026.