Twitter (X) Webhooks — A Real-Time API Guide

By Sarah Wong•15 min read
TL;DR
  • X Account Activity API: single-account events (mentions/DMs/follows), Pay Per Use (3 subscriptions, 1 webhook) or Enterprise, and being deprecated for the X Activity API
  • twitterapi.io tweet_filter webhook: rule-based content delivery to any callback URL
  • X Activity API (XAA): per-user push events over stream or webhook at $0.005 per post event; likes, follows and DMs are XAA-only, twitterapi.io has no push events for them
  • For most 'notify me when...' use cases the tweet_filter path fits; per tweet it is ~33× below X's per-post read price, plus a small per-check minimum
  • Delivery: HTTPS POST to your endpoint, standard ingress handling

'Twitter webhooks' as a term overloads two very different APIs. If you're building a bot that reacts to mentions and DMs on one specific X account you own, you want the Account Activity API. If you're building a monitoring product that reacts to any matching tweet content anywhere, you want a rule-based webhook. This guide walks both.

Pricing references URL-cited to each provider's published documentation.

Per-matched-tweet webhook delivery cost

$0.00015 per matched tweet (twitterapi.io) vs $0.005 per post event (X Activity API, per docs.x.com)

01 — Section

Two products, one word — which webhook do you actually want?

X Account Activity API (AAA): subscribe to events on a specific X account you own. Delivered events: mentions of the account, DMs sent to it, follows / unfollows, blocks, tweet deletes. You cannot use AAA to monitor tweets from other accounts — it's per-account for accounts you have OAuth on. Per docs.x.com it runs on Pay Per Use (3 subscriptions, 1 webhook) or Enterprise, and it is being deprecated in favor of the X Activity API (XAA, covered below).

twitterapi.io tweet_filter webhook: register a rule (matching any tweet content, from anyone). twitterapi.io POSTs matching tweets to your callback URL. Not tied to any one account; matches happen globally based on your rule. Standard use for brand monitoring, keyword alerts, real-time content aggregators.

Which you want: 'I own @mybrand and want events on it' → AAA. 'I want to know when anyone mentions my brand / a keyword / a topic' → tweet_filter.

02 — Section

Path 1 — twitterapi.io tweet_filter webhook

Register a rule programmatically. Provide a callback URL via the dashboard. Matching tweets get POSTed to your callback as they arrive. For the click-by-click version (saving the account webhook URL, switching the rule on with update_rule and is_effect: 1, testing with Webhook.site), follow the step-by-step Twitter webhook setup guide.

Pricing per twitterapi.io/pricing: $0.00015 per matched tweet, plus at least $0.00015 for every rule check (empty checks included), so a 60-second rule has a floor of about $0.22/day.

python
import os, requests

HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
BASE = "https://api.twitterapi.io"

def register_rule(tag: str, value: str):
    r = requests.post(
        f"{BASE}/oapi/tweet_filter/add_rule",
        headers=HEADERS,
        data={
            "tag": tag,
            "value": value,
            "interval_seconds": 5,
        },
        timeout=15,
    )
    r.raise_for_status()
    return r.json()

# Register
rule = register_rule("brand-mentions", '"YourBrand" -is:retweet lang:en')
print(f"rule id: {rule.get('rule_id')}")
03 — Section

Path 2 — X Account Activity API (AAA)

Register a webhook via the AAA API. Subscribe an OAuth'd account to that webhook. Events on that account get POSTed to your endpoint. For the full event map, the end-of-life timeline and a migration checklist, see our Twitter Account Activity API guide.

Access per docs.x.com/x-api/account-activity/introduction: Pay Per Use (3 unique subscriptions, 1 webhook) or Enterprise (5,000+ subscriptions, 5+ webhooks). Setup requires a Developer Console app and OAuth for each subscribed account. X now marks AAA as being deprecated and points new builds to the X Activity API, covered in the next section.

python
# pip install tweepy requests-oauthlib
# AAA setup is more involved: register webhook, verify challenge, subscribe accounts.
#
# Simplified illustration:
import requests
from requests_oauthlib import OAuth1

AUTH = OAuth1(
    "CONSUMER_KEY", "CONSUMER_SECRET",
    "USER_TOKEN", "USER_TOKEN_SECRET",
)

# 1. Register your webhook URL
r = requests.post(
    "https://api.x.com/2/webhooks",
    auth=AUTH,
    data={"url": "https://your-app.com/aaa-callback"},
)
print(r.json())  # includes webhook id

# 2. Subscribe an OAuth'd account (the user's tokens in AUTH)
WEBHOOK_ID = "your-webhook-id"
r = requests.post(
    f"https://api.x.com/2/account_activity/webhooks/{WEBHOOK_ID}/subscriptions/all",
    auth=AUTH,
)
# Now events on THAT specific account POST to your callback
04 — Section

X Activity API (XAA): event types, cost per event, and the twitterapi.io equivalent

The X Activity API (XAA) is X's per-user event feed and the replacement for the Account Activity API, which docs.x.com/x-api/account-activity/introduction now marks as being deprecated. You create one subscription per event_type and user_id with POST /2/activity/subscriptions, then receive matching events over a persistent HTTP stream (GET /2/activity/stream) or a webhook registered through the V2 Webhooks API. It is billed per delivered event: $0.005 per post.create, $0.010 per follow or dm.received, $0.001 per mute or block, and nothing for post.delete, dm.sent or dm.read, per the Webhook events table on docs.x.com/x-api/getting-started/pricing. If your job is 'tell me when account X posts', twitterapi.io covers it with Twitter Stream or a from: filter rule; if you need likes, follows, DMs, mutes or blocks, XAA is the tool, because twitterapi.io has no push events for those.

Timeline. @XDevelopers announced XAA in open beta for all paid developer tiers in October 2025, added Grok-curated trends (news.new) as an Enterprise closed beta in November 2025, and added @mention events in July 2026 with what the post calls 'sub-second webhook delivery for @ mentions'. All three posts were read through our own API for this section.

Event familyEvent typesAccessX price per event
Own postspost.create, post.deletepublic, app-only Bearer token$0.005; delete not billed
Reactions to a user's postspost.mention.create, post.reply.create, post.quote.create, post.repost.createprivate, user OAuth 2.0 (tweet.read)billed as a Post
Likeslike.create (inbound or outbound)private, user OAuth 2.0not in the webhook table
Follows and paid subscriptionsfollow.follow, follow.unfollow, subscriptions.subscribe, subscriptions.unsubscribesubscriptions need follows.readfollows $0.010
DMs and XChatdm.received, dm.sent, dm.read, dm.indicate_typing, chat.received, chat.sent, chat.conversation_joinprivate, user OAuth 2.0received $0.010; the rest not billed
Profile changesnine profile.update.* types (bio, picture, banner, handle, URL ...)public$0.005
Live video and Spacesbroadcast.start, broadcast.end, broadcast.chat, broadcast.chat.remove, spaces.start, spaces.endbroadcast chat needs broadcast.readSpaces $0.005; broadcast not in the table
Mutes and blocksmute.mute, mute.unmute, block.block, block.unblockprivate (mute.read, block.read)$0.001
Newsnews.new filtered by keywordEnterprise and Partner only$0.005

The rules that shape a build. A subscription can be narrowed with up to 8 filter.qualifiers (direction, post_id, conversation_type) and can carry an expires_at. Self-serve accounts get up to 1,500 subscriptions (Enterprise 75,000, Partner 150,000). Posts from protected accounts are never delivered. X bills each billable event once, deduplicated within a 24-hour UTC window. The stream accepts backfill_minutes up to 5 for reconnects; a webhook must pass X's CRC challenge, answer within 10 seconds, and can be verified with the X-Twitter-Webhooks-Signature-OAuth2 header, with replay jobs at POST /2/webhooks/replay. The 'x livestream api' searches land here too: live video is the broadcast.* family.

What XAA would bill for real accounts. We pulled the latest 800 timeline posts (replies included) of 8 organization accounts, collected in 2026, and priced two subscriptions per account at $0.005 per delivered Post event: post.create (every original, reply, quote and repost by the account) and the inbound reply, quote and repost events on its own posts, estimated from replyCount, quoteCount and retweetCount and scaled to 30 days.

AccountPosts per daypost.create events per 30 days (XAA cost)Inbound reply, quote, repost events per 30 days (XAA cost)
@OpenAI1.9960 ($0.30)105,927 ($529.63)
@Xbox30.59918 ($4.59)83,532 ($417.66)
@NASA4.28128 ($0.64)50,348 ($251.74)
@nvidia2.5476 ($0.38)14,185 ($70.92)
@GeminiApp2.5677 ($0.38)6,598 ($32.99)
@github2.781 ($0.41)5,032 ($25.16)
@vercel0.4112 ($0.06)2,116 ($10.58)
@XDevelopers0.7823 ($0.12)1,058 ($5.29)

Watching the eight accounts' own posts comes to 1,376 events and $6.88 per 30 days on XAA. Watching the reactions to those posts is 195 times more events: 268,797 and about $1,343.98, dominated by @OpenAI, @Xbox and @NASA. The inbound figure is an estimate: counters are a snapshot, replyCount can include replies deeper in a thread that XAA's direct-reply event skips, and one viral post moves an account's total a lot. Those reaction events are also private, so XAA delivers them only for users who authorized your app via OAuth.

JobX Activity APItwitterapi.io
New post from account X (originals, replies, quotes, reposts)post.create push, $0.005 per eventTwitter Stream (/oapi/x_user_stream/add_user_to_monitor_tweet with x_user_name) pushes them over WebSocket or webhook on a monthly per-account plan, or a from:handle filter rule at $0.00015 per matched tweet
Mentions, replies and quotes of account Xprivate events, needs that user's OAuth, $0.005 eacha filter rule on public tweets (@handle, to:handle) at $0.00015 per matched tweet, no OAuth from the account owner; or poll /twitter/user/mentions, /twitter/tweet/replies, /twitter/tweet/quotes
Reposts of a postpost.repost.create pushpull only: poll /twitter/tweet/retweeters
Likes, follows, DMs, mutes, blocks, profile changes, XChatpush eventsno push events; follower lists and profiles can be read on a schedule (/twitter/user/followers, /twitter/user/info) and compared; nothing for DMs received, likes, mutes or blocks

The cost side of 'new post from account X'. One twitterapi.io filter rule, from:XDevelopers OR from:OpenAI OR ..., covering all eight accounts would deliver the same 1,376 posts for $0.21 in matched tweets, plus the polling floor of $0.00015 per empty check: at most $6.69 per 30 days at a 60-second interval or $1.51 at 5 minutes, against $6.88 on XAA. For a handful of quiet accounts the two bills are close; the gap opens with volume, because the rate cards are $5.00 per 1,000 Post events on X's pricing page and $0.15 per 1,000 tweets on twitterapi.io/pricing (about 33x). The 112,168 inbound replies and quotes from the table would cost about $560.84 as XAA events versus about $16.83 as matched tweets on twitterapi.io, with no OAuth needed from the account owner.

When XAA is the right answer. You run the account (or your users authorize your app) and the product depends on private signals: DMs and XChat, likes received, new followers, mutes and blocks, or broadcast chat moderation. When the job is reading public posts by or about accounts you do not control, a rule or Twitter Stream on twitterapi.io does it without per-user OAuth and at the per-tweet rate above.

python
import json, os, requests

# 1) X Activity API: subscribe to one account's new posts (public event, app-only Bearer token)
X = {"Authorization": f"Bearer {os.environ['X_BEARER_TOKEN']}"}
sub = requests.post(
    "https://api.x.com/2/activity/subscriptions",
    headers=X,
    json={"event_type": "post.create", "filter": {"user_id": "2244994945"}, "tag": "xdevelopers posts"},
    timeout=15,
)
print(sub.json())  # {"data": {"subscription_id": ..., "event_type": "post.create", ...}}

# Read events from the persistent stream (or pass webhook_id above to get webhook POSTs)
with requests.get("https://api.x.com/2/activity/stream", headers=X, stream=True, timeout=90) as r:
    for line in r.iter_lines():
        if not line:
            continue  # keep-alive
        event = json.loads(line).get("data", {})
        print(event.get("event_type"), event.get("tag"))  # each post.create is billed $0.005
        break

# 2) twitterapi.io: the same 'new post from account X' job via Twitter Stream
T = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
r = requests.post(
    "https://api.twitterapi.io/oapi/x_user_stream/add_user_to_monitor_tweet",
    headers=T,
    json={"x_user_name": "XDevelopers"},
    timeout=15,
)
print(r.json())  # {"status": "success" | "error", "msg": ...}
# New tweets, replies, quotes and retweets by @XDevelopers now arrive over your WebSocket
# or webhook. For accounts you do not own and keyword-style jobs, use a tweet_filter rule instead.
Bar chart of the estimated 30-day X Activity API bill for eight organization accounts: own posts cost between $0.06 and $4.59, inbound reply, quote and repost events between $5.29 and $529.63
Estimated X Activity API bill per 30 days at $0.005 per delivered Post event, from 800 timeline posts of eight organization accounts, collected in 2026. Inbound counts are an upper bound for direct replies.
05 — Section

X API webhook pricing: what X charges for webhooks today, next to twitterapi.io

X does not sell webhooks as a product with its own price: what you pay depends on which X product is pushing the events. The V2 Webhooks API page (docs.x.com/x-api/webhooks/introduction) lists three products that deliver over a webhook: the X Activity API (XAA), the Account Activity API (AAA) and Filtered Stream Webhooks. Only XAA has published per-event prices, in the Webhook events table on docs.x.com/x-api/getting-started/pricing, and it is open to self-serve pay-per-use accounts. AAA is marked as being deprecated and its page lists access tiers but no price. Filtered Stream Webhooks, the one that pushes keyword-matched public posts, is Enterprise only, and X publishes no price for it. Registering a webhook, answering CRC checks and replay jobs have no line on the pricing page either.

Webhook productWhat it pushesWho can use itPrice X publishes
X Activity API (XAA)events on a user_id: posts, follows, DMs, mutes, blocks, profile changes, Spacesself-serve pay-per-use (1,500 subscriptions); Enterprise 75,000; Partner 150,000per delivered event: $0.005 per post.create, $0.010 per follow or dm.received, $0.001 per mute or block
Account Activity API (AAA)all activity of OAuth-subscribed accountsPay Per Use (3 subscriptions, 1 webhook) or Enterprise (5,000+ subscriptions, 5+ webhooks)none on the pricing page; marked as being deprecated
Filtered Stream Webhookspublic posts matching your rulesEnterprise only (25,000+ rules, 2,048-character rules)none; Enterprise is quoted through X's interest form

XAA, the only webhook with a public rate card. Billing is per delivered event, once per event, deduplicated within the same 24-hour UTC window. post.create, profile.update.*, spaces.start, spaces.end and news.new are $0.005 each; follow.follow, follow.unfollow, dm.received and chat.received are $0.010; mutes and blocks are $0.001; post.delete, dm.sent, dm.read, dm.indicate_typing, chat.sent and chat.conversation_join are not billed. docs.x.com/x-api/activity/introduction adds that every delivered Post event, including mentions, replies, quotes and reposts of the user, is billed as a Post. The table has no line for like.create, and the docs do not say how a like event is billed, so we do not print a number for it. news.new is limited to Enterprise and Partner accounts. The full event list and a cost estimate for eight real accounts are in the X Activity API section above.

Account Activity API: tiers, no price. docs.x.com/x-api/account-activity/introduction lists Pay Per Use access at 3 unique subscriptions and 1 webhook, and Enterprise at 5,000+ subscriptions and 5+ webhooks, and opens with a notice that AAA is being deprecated in favor of XAA. The pricing page has no AAA line, so the honest answer to 'what does AAA cost' is that X does not publish it; new builds are pointed at XAA, whose events are priced. The changelog also retired the AAA-specific replay endpoint (announced March 2026, effective March 25, 2026) in favor of the shared POST /2/webhooks/replay.

Filtered Stream Webhooks: Enterprise only, no public price. This is the webhook version of keyword or from: rules on public posts. X launched it on September 9, 2025, and docs.x.com/x-api/webhooks/stream/introduction still says it is available to Enterprise developers, with returned posts counting toward the monthly Post cap. Pay-per-use accounts get the regular filtered stream instead (docs.x.com/x-api/posts/filtered-stream/introduction): 1,000 rules per project, 1,024-character rules and one persistent HTTP connection, not a webhook. The pricing page lists Posts: Read at $0.005 per resource and caps pay-per-usage at 3 million Post reads a month, but it has no separate line for streamed posts. So on self-serve X, 'push me every public post that matches this keyword' has no webhook option at any published price.

What twitterapi.io charges for the same job. Neither twitterapi.io/pricing nor docs.twitterapi.io/pricing lists a webhook fee, a per-rule fee or a per-delivery surcharge. Tweets pushed by a filter rule (/oapi/tweet_filter/add_rule, with an interval_seconds check interval) are tweets returned, billed at the published 15 credits per tweet, $0.15 per 1,000 tweets, and each request carries the 15-credit minimum, so a check that finds nothing costs $0.00015. That is the polling floor of the rule: every 60 s for a month is 43,200 checks, $6.48; every 5 minutes is $1.30. Per-account monitoring through Twitter Stream (/oapi/x_user_stream/add_user_to_monitor_tweet) is sold as monthly plans on the /twitter-stream page, not on /pricing, so we do not quote a number for it here. No Developer Console app, no OAuth from the watched account and no Enterprise application are needed; reads need no X account.

Side by side, per 1,000 posts delivered. On X's pay-per-use rate card, 1,000 post.create events from XAA cost $5.00. On twitterapi.io's rate card, 1,000 tweets delivered by a filter rule cost $0.15, about 33x less, plus the polling floor above. The two are not identical products: XAA pushes private signals (DMs, follows, likes, mutes, blocks) for users who authorized your app, which twitterapi.io has no push events for, while a twitterapi.io rule matches any public post by keyword, handle or operator, which on X is the Enterprise-only Filtered Stream Webhooks product.

06 — Section

Side-by-side — 2 webhook paths

Dimensiontwitterapi.io tweet_filterX Account Activity API
Scopeany tweet matching your ruleevents on one X account you OAuth
AuthX-API-Key header + dashboard callbackPay Per Use or Enterprise access + per-account OAuth
Per-event cost$0.00015 per matched tweet + $0.00015 minimum per rule checkAAA: Pay Per Use (3 subscriptions); successor XAA: $0.005 per post event
Event typesmatching tweets onlymentions, DMs, follows, blocks, deletes
SetupminutesDeveloper Console app, CRC-validated webhook, OAuth per account
Best formonitoring, alerts, aggregatorsbots on a specific X account you own

Two practical observations: (a) product-level monitoring (brand / keyword / topic) is almost always the tweet_filter use case; (b) AAA covers a niche — bots on accounts you own — that tweet_filter can't (DMs, follows, blocks aren't visible to public content filtering).

07 — Section

Running the receiver in production

Getting a test URL to receive pushes is easy; keeping a production receiver from losing posts is where most setups stall. More than a third of TwitterAPI.io users who set a webhook still point it at a test address such as webhook.site or an ngrok tunnel (based on anonymized, aggregated API usage on TwitterAPI.io). Four facts about the push decide how you build the real one:

BehaviorWhat it means for your receiver
POST with a JSON body: event_type, rule_id, rule_tag, rule_value, timestamp (ms) and a tweets array of the same objects advanced_search returnsHandle event_type: "tweet"; answer 200 to the dashboard's test_webhook_url ping; skip an empty tweets array
x-api-key header carries your own API key; no HMAC signatureCompare it to your key (constant-time) and return 401 on mismatch
1-second timeoutReturn 200 first, then process on a queue or background worker
No retriesA timeout or non-200 drops that batch: backfill with advanced_search + since_id on a schedule

The Flask sketch below follows those rules: verify the header, enqueue, answer 200, and do the slow work on a worker thread with de-duplication by post ID. Host it on anything that answers quickly and stays warm (a small VM, Railway, Render, or a serverless function with minimum instances), and keep cold starts below the one-second budget.

python
import hmac, json, os, queue, threading
from flask import Flask, request

API_KEY = os.environ["TWITTERAPI_IO_KEY"]
jobs = queue.Queue()
seen = set()          # use Redis/DB in production
app = Flask(__name__)

@app.post("/twitter-callback")
def receive():
    # 1. Verify: twitterapi.io sends your own API key in x-api-key (no HMAC).
    if not hmac.compare_digest(request.headers.get("x-api-key", ""), API_KEY):
        return "", 401
    # 2. Acknowledge immediately: the push times out after 1 s and is not retried.
    jobs.put(request.get_data())
    return "", 200

def worker():
    while True:
        payload = json.loads(jobs.get())
        # {"event_type": "tweet", "rule_id", "rule_tag", "rule_value", "timestamp",
        #  "tweets": [...]}; the dashboard Test button sends "test_webhook_url".
        if payload.get("event_type") != "tweet":
            continue
        for tweet in payload.get("tweets") or []:
            if tweet["id"] in seen:      # 3. De-duplicate overlapping rules
                continue
            seen.add(tweet["id"])
            print(tweet["id"], tweet.get("text", "")[:80])   # slow work goes here

threading.Thread(target=worker, daemon=True).start()
08 — Section

Common webhook patterns

Brand-mention alerting: tweet_filter with "YourBrand" rule → webhook → Slack/PagerDuty. Latency seconds; cost single-digit dollars/month at typical volumes. To hand the same alerts to a coding agent instead, a small Claude Code channel can receive the webhook and push each matching post into a session you already have open.

Broad keyword stream: tweet_filter with broad rule → webhook → your queue → downstream processing. See /blog/twitter-firehose-api-developer-guide for the volume-tier discussion.

Custom X bot on your own account: AAA + reply / follow-back / DM automation. Only X's own APIs (AAA, or its successor XAA) expose these events.

Reply-to-mention bot: AAA for the mention notification + X official POST endpoint to send the reply. Requires the account's OAuth; on the X Activity API the mention event is post.mention.create, billed as a Post.

Content-triggered notification service: tweet_filter with product-related keywords → webhook → notification queue → user-specific push notifications.

09 — Section

Picking the path

'I want to know when anyone tweets X': twitterapi.io tweet_filter. Match on content; standard monitoring pattern.

'I want to build a bot on @myaccount that reacts to mentions/DMs': X Account Activity API. Path 2 is required for OAuth-based per-account events.

Both: some products use both — AAA for the bot's own account events, tweet_filter for the broader listening surface.

Most product / monitoring workflows land at tweet_filter because setup is simpler + coverage is broader (any content vs one account).

python
# Practical example: content-triggered notification service on twitterapi.io webhook.
import os, requests

HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
BASE = "https://api.twitterapi.io"

def register_content_watcher(topic: str, callback_url: str):
    r = requests.post(
        f"{BASE}/oapi/tweet_filter/add_rule",
        headers=HEADERS,
        json={
            "tag": f"watcher-{topic}",
            "value": f'"{topic}" -is:retweet lang:en min_faves:10',
            "interval_seconds": 60,
        },
        timeout=15,
    )
    r.raise_for_status()
    return r.json()

# Webhook handler (FastAPI illustration)
from fastapi import FastAPI, Request
app = FastAPI()

@app.post("/twitter-callback")
async def receive(request: Request):
    body = await request.json()
    # Push shape: {"event_type": "tweet", "rule_id", "rule_tag", "rule_value",
    #              "timestamp" (ms), "tweets": [same objects as advanced_search]}
    # The dashboard's Test button sends {"event_type": "test_webhook_url"}.
    if body.get("event_type") != "tweet":
        return {"ok": True}
    tag = body.get("rule_tag")
    subscribers = get_subscribers_for(tag)   # route by rule tag
    for tweet in body.get("tweets") or []:   # can occasionally be empty
        for sub in subscribers:
            send_push_notification(sub, tweet)
    return {"ok": True}  # answer within 1 s; do slow work on a queue

# One-time rule registration
# register_content_watcher("AI safety", "https://your-app.com/twitter-callback")

# Cost per twitterapi.io/pricing:
#   Rule checked every 60 s = 1,440 checks/day, each at least $0.00015 (15 credits)
#   ~2000 matched tweets/day × $0.00015 = $0.30 + empty checks (≤ $0.22) ≈ $0.30-0.50/day ≈ $9-15/month per topic
# X Activity API equivalent: $0.005 per delivered post event (docs.x.com pricing, Webhook events)

Researching this?Free starter credits cover end-to-end testing — Google sign-in, no card. Get a key.

10 — Questions

Questions readers ask

Can I use webhooks to monitor tweets from any account?

Yes with twitterapi.io tweet_filter — the rule matches on content, not on a specific account. To monitor a specific user's tweets: from:username in your rule value. X's AAA only surfaces events on accounts you have OAuth on.

What events can I get through the Account Activity API?

Mentions of the account, DMs sent to it, follows/unfollows, blocks/unblocks, tweet deletes on the account. All tied to a specific account you have OAuth on. Public read-only events on other accounts are NOT covered — for that you need content filtering (tweet_filter path). X now marks AAA as being deprecated; its successor, the X Activity API, delivers the same families as separate event types (for example post.mention.create, like.create, follow.follow, dm.received).

Are webhooks reliable / guaranteed delivery?

Not on twitterapi.io: a push must get a 200 within 1 second and is not retried, so a timeout or error drops that batch. Answer immediately, process asynchronously, and run a periodic advanced_search with since_id to backfill anything you missed. X publishes its own delivery rules for the Account Activity API. For guaranteed processing, run your webhook behind a queue (SQS / Kafka / Redis) — receive-and-ack fast + async workers do real processing. This prevents transient endpoint issues from losing messages.

Does the webhook include the full tweet object?

Yes — twitterapi.io delivers full tweet objects (text, the author object, counts such as likeCount and retweetCount, entities), the same tweet objects advanced_search returns. AAA delivers event-specific payloads (mention text, DM contents, follow record, etc.) shaped by event type.

Can I filter webhook events at delivery time?

twitterapi.io applies your rule filter server-side (only matching tweets are POSTed to you). You still filter further client-side if needed (e.g., keyword blacklist). AAA delivers all events for subscribed accounts — you filter your side.

How do I verify the webhook actually came from the provider?

twitterapi.io sends your own API key in an x-api-key request header on every push (there is no HMAC signature); compare it with your key in constant time and reject anything that doesn't match. X's Account Activity API uses a CRC challenge when you register the webhook and signs its callbacks.

What is the X Activity API and how much does it cost?

The X Activity API (XAA) is X's per-user event feed: you subscribe to an event type for a user_id and receive events over a persistent HTTP stream or a webhook. Per the Webhook events table on docs.x.com, post.create costs $0.005 per event, follows and received DMs $0.010, mutes and blocks $0.001, profile updates $0.005, and deletes, sent DMs and read receipts are not billed. Mention, reply, quote and repost events are billed as a Post.

Does twitterapi.io deliver likes, follows or DMs as webhook events?

No. twitterapi.io pushes tweets: posts by monitored accounts (Twitter Stream) and tweets matching a filter rule (tweet_filter webhook or WebSocket). For likes, new followers, DMs, mutes or blocks as push events you need X's own X Activity API with the account's OAuth. Follower lists and profiles can be read on a schedule and compared, but that is polling, not an event.

11 — Further reading

Continue

Sources & further reading
More from this series

Writing about something you built with TwitterAPI.io? Our community rewards program pays API credits for honest tutorials, build logs and videos.

Build it

Stop reading. Start building.

Starter credits cover real testing on real data. Google sign-in, no card, no application queue.

Get an API key

Already building with TwitterAPI.io? Publish an honest tutorial or build log about it and earn up to $200 a month in API credits.