Twitter (X) Mute API: Mute and Unmute Accounts from Code

- Endpoints:
POST /twitter/mute_user_v2andPOST /twitter/unmute_user_v2, bodylogin_cookies+user_id+proxy, all required. - Session first: one
/twitter/user_login_v2call ($0.10, with your own proxy) returnslogin_cookies; every mute then acts as that account. - Price: 60 credits ($0.0006) per successful mute or unmute; calls that return
status: errorare not charged. Reading replies to decide who to mute costs $0.15 per 1,000 tweets. - What a mute does: you stop seeing their posts; they are not notified and can still follow you, see your posts and DM you (X developer docs).
- Our data: 9.9% of reply authors wrote 23.2% of 1,009 replies; muting the top 10 hid 16.1% on average.
- Muted words are a different feature: this page mutes accounts; keyword muting lives in the X app settings.
This guide is about muting accounts on X (Twitter) through an API: send a user ID, and that account's posts stop reaching your timeline and notifications. It is not about muted words, the in-app setting that hides posts containing a phrase, hashtag or emoji; our guide on how to block words on Twitter covers that feature, its options and starter lists. Muting a word and muting an account solve different problems, and only the account mute has a write endpoint you can call from code.
Below you will find the exact request and response shapes for mute_user_v2 and unmute_user_v2 (taken from the TwitterAPI.io docs), the official X API equivalent, a table of what a mute changes compared with a block, the cost of both routes, and a working Python script that reads the replies under your posts, ranks the accounts that reply often, and mutes the ones you approve. We also ran a read-only study on 20 busy posts by five organization accounts to measure how much reply volume a short mute list actually removes.
One rule up front: a mute call acts as a real, logged-in X account. Use only your own account, keep a normal human pace, and expect that X's automation rules apply; X can rate-limit, lock or suspend an account it sees misbehaving, and this is not a way around any limit.
23.2%
What happens when you mute someone on Twitter (X)
A mute changes what you see and nothing about what the other account can do. X's developer documentation for the Mutes endpoints includes a mute vs block comparison, and it is the clearest primary statement of the behavior. The table below reproduces it; the right column adds what a block does for contrast.
The privacy point. X's integration guide states that muting is private: the muted user is not notified and cannot tell they have been muted. That is why brand and community accounts reach for a mute first. A block removes the account as a follower and cuts off its view of your posts and its DMs, changes the other person can run into; a mute leaves all of that in place.
What a mute does not do. It does not stop the account from replying to you, quoting you or mentioning you, and those replies remain visible to everyone else reading the conversation. It only removes them from your own view. If the goal is to keep other readers from seeing a reply, a mute will not do it; if the goal is to stop an account from reading or following you, only a block does that.
Where the in-app details live. X's help center page on muting (help.x.com/en/using-x/x-mute) describes the in-app steps and edge cases. Our fetcher was refused by help.x.com when we prepared this guide, so we could not re-read it; every row in the table above comes from X's developer docs (docs.x.com/x-api/users/mutes/integrate), which we did read. Check the help page in a browser for app-specific details such as notification filters.
The mute and unmute endpoints: request and response shapes
Both endpoints are POST calls with a JSON body and your API key in the X-API-Key header. The three body fields are identical for mute and unmute, and every one of them is required.
The response. HTTP 200 carries status (success or error) and message. When the call fails and X returned details, two more fields appear: x_status (the HTTP status X answered with) and code (X's own error code). A malformed request (a missing field, for example) comes back as HTTP 400 with error and message. Always branch on status, not on the HTTP code: a call X refuses still arrives as HTTP 200 with status: error.
IDs, not handles. user_id must be the numeric ID. If you start from a handle, resolve it first with /twitter/user/info (a profile read, 18 credits) or with the free Twitter ID finder tool. Reply objects from /twitter/tweet/advanced_search already carry author.id, so a reply-cleanup script never needs the extra lookup.
Where the session comes from. /twitter/user_login_v2 takes user_name, email, password, an optional but strongly recommended totp_secret (the base32 2FA seed, not a 6-digit code) and proxy, and returns login_cookies. The docs note those cookies only work with endpoints that end in _v2, and that without 2FA the returned cookies may be faulty. One login costs 10,000 credits ($0.10). Store the cookies like a password, never in logs, and log in again when a write starts returning session errors.
# Mute (POST, JSON body). Every field is required.
curl -s -X POST https://api.twitterapi.io/twitter/mute_user_v2 \
-H "X-API-Key: $TWITTERAPI_IO_KEY" \
-H "Content-Type: application/json" \
-d '{"login_cookies": "<from user_login_v2>", "user_id": "<numeric user id>", "proxy": "http://user:pass@ip:port"}'
# Response fields per the docs (placeholders, not a captured response):
# success: {"status": "success", "message": "<text>"}
# failure: {"status": "error", "message": "<reason returned by X>", "x_status": <X HTTP status>, "code": <X error code>}
# x_status and code appear only when X returned them
# Unmute: same body, different path
curl -s -X POST https://api.twitterapi.io/twitter/unmute_user_v2 \
-H "X-API-Key: $TWITTERAPI_IO_KEY" \
-H "Content-Type: application/json" \
-d '{"login_cookies": "<from user_login_v2>", "user_id": "<numeric user id>", "proxy": "http://user:pass@ip:port"}'
The official X API route, and what each costs
X's own API exposes three Mutes endpoints: GET /2/users/:id/muting lists the accounts you mute, POST /2/users/:id/muting mutes one (body {"target_user_id": "..."}), and DELETE /2/users/:source_user_id/muting/:target_user_id unmutes. They need an OAuth 2.0 user-context token with the mute.write scope (plus tweet.read and users.read), which means a registered developer app, a consent flow and token refresh. A successful mute returns {"data": {"muting": true}}.
Pricing, side by side. X's pay-per-usage rate card (docs.x.com/x-api/getting-started/pricing) lists Mute: Delete at $0.005 per request and Mute: Read at $0.001 per resource. It has no row named Mute: Create; its user-action write row, User Interaction: Create, is $0.015 per request, so confirm in your developer console which row a mute is billed under. On TwitterAPI.io a successful mute or unmute is 60 credits ($0.0006), and a call that returns status: error is not charged.
On the unmute row the ratio is $0.005 / $0.0006, about 8x. The bigger gap is the reading step that comes before any mute: deciding who to mute means reading replies, and 1,000 replies cost $5.00 on X's rate card against $0.15 here, about 33x. Reads on TwitterAPI.io need no X account at all; only the mute itself acts as your account.
When the official route is the better fit. If you are building an app that many users authorize to manage their own mutes, X's OAuth flow is built for exactly that: each user grants your app the mute.write scope and you never touch a password. The TwitterAPI.io write endpoints are a fit for managing your own account (or one your organization owns) from a script.
How much reply noise does a mute list remove? Our study
A mute list is only worth building if a small number of accounts produce a large share of the noise. To check that, we read the replies under the four busiest recent posts of five organization accounts (@OpenAI, @SpaceX, @nvidia, @Xbox and @NASA): 1,009 replies from 860 distinct authors, collected in 2026. Nothing was muted; the study is read-only and simulates the effect.
The headline. Only 9.9% of reply authors replied more than once, yet they wrote 23.2% of all replies. Of the 860 authors, 775 replied once, 56 twice, 23 three to five times and 6 six times or more within the sample.
What muting the top N would hide. Averaged across the five accounts, muting the single account with the highest reply count hid 2.9% of the replies, the top 5 hid 10.1%, the top 10 hid 16.1% and the top 25 hid 27.3%. Per account the top-10 figure ranged from 12.9% to 21.2%.
Read the table as a ceiling for a short, hand-reviewed list. @SpaceX's replies showed the highest concentration in our sample: a quarter or more came from accounts that kept coming back. @OpenAI's showed the lowest: many people replying once each, which a mute list barely touches. If your own reply section looks like the second case, muted words or a quality filter will do more than muting accounts.

Repeat repliers are not the same as spam accounts
It is tempting to equate "replies a lot" with "spam". The data does not support that on its own. We compared the accounts that replied twice or more with those that replied once, on five common tells.
Links are the one clear difference. Repeat repliers put a link in at least one reply 24.7% of the time against 13.8% for one-time repliers, which fits promoters who drop the same pitch under several posts. On account age and follower count the repeat group looked, if anything, more established, and nearly half carried a blue check.
What that means for your mute list. A rule like "mute anyone with 3+ replies" will catch engaged fans and regular critics alongside promoters. Use reply count to build a review queue, not a mute list: sort by count, look at what each account actually posts, and keep an allowlist for partners, staff and regulars. The script below prints the queue first and only mutes when you rerun it with APPLY=1.

Build a reviewed mute list from your replies (Python)
The full script is in the code block further down this page; here is how it works and why each step is there.
Step 1, read. For each of your posts, /twitter/tweet/advanced_search with conversation_id:<post id> and queryType=Latest returns the conversation 20 tweets per page, newest first. The script follows has_next_page and next_cursor, skips your own replies and the allowlist, and counts replies per author.id. This step needs no X account and costs 15 credits per tweet returned.
Step 2, review. It prints each flagged account with its reply count and the share of replies the whole list would hide, the same measure as our study. Nothing is written yet.
Step 3, apply. With APPLY=1 it logs in once, calls mute_user_v2 for each approved ID with a fixed 10-second pause, checks status on every response, and saves the IDs that succeeded to muted.json so you can undo the batch later.
Cost of a typical pass. Reading 300 replies costs 300 x 15 = 4,500 credits ($0.045); one login is $0.10; muting 10 accounts is 10 x $0.0006 = $0.006. Calls that come back status: error (an ID that no longer exists, for example) are not charged.
Resolving a single handle. When you already know who to mute, turn the handle into an ID with one profile read:
import os
import requests
BASE = "https://api.twitterapi.io"
HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
r = requests.get(f"{BASE}/twitter/user/info", headers=HEADERS, params={"userName": "NASA"}, timeout=30)
body = r.json()
if body.get("status") != "success" or body.get("data") is None:
print("not found:", body.get("msg")) # unknown handles return status "error", data null
else:
print(body["data"]["id"], body["data"]["userName"]) # user_id for mute_user_v2
Unmuting, errors and safe operation
Mutes are cheap to make and easy to forget. The official API can list it with GET /2/users/:id/muting (Mute: Read, $0.001 per resource), but a local record is simpler: the script writes every successful mute to muted.json, and the unmute loop below replays that file.
Unmuting is safe to repeat. X's docs say a request to unmute an account you are not muting succeeds with no action, so rerunning the loop after a partial failure does no harm. On TwitterAPI.io each successful unmute is 60 credits ($0.0006).
When to unmute. Time-box mutes that were a reaction to one event (a launch-day pile-on, a contest that drew promoters). Review the file monthly and unmute accounts that only replied during that window; keep the ones that keep posting links.
status: error with x_status. X refused the action. The message holds X's reason and code its error code; common causes are an invalid or deleted user ID, an expired session, or the account being rate-limited. Calls that return status: error are not charged, so a retry after fixing the cause costs nothing extra for the failed attempt.
HTTP 400. A field is missing or malformed: all of login_cookies, user_id and proxy are required on every call.
Session errors. login_cookies can expire or be invalidated (for example after a password change). Log in again; the docs recommend a totp_secret so the session is set up correctly.
Pace and scope. Every write acts as that account. Use only accounts you own or manage, keep a normal human pace (the script uses a fixed pause between calls), and remember that X's automation rules apply and it can rate-limit, lock or suspend the account. A mute script is a housekeeping tool, not a way around any limit.
Never mute on a customer's behalf with their password. If other people's accounts are involved, the official OAuth flow, where each user grants mute.write to your app, is the right design.
import json
import os
import time
import requests
BASE = "https://api.twitterapi.io"
HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
PROXY = os.environ["PROXY"]
COOKIES = os.environ["LOGIN_COOKIES"] # from /twitter/user_login_v2, kept out of logs
for user_id in json.load(open("muted.json")):
r = requests.post(
f"{BASE}/twitter/unmute_user_v2",
headers=HEADERS,
json={"login_cookies": COOKIES, "user_id": user_id, "proxy": PROXY},
timeout=60,
)
body = r.json()
print(user_id, body.get("status"), body.get("message", ""), body.get("x_status", ""))
time.sleep(10)
Mute, block, soft block or muted words: picking the tool
Mute an account when one account keeps showing up and you only want it out of your own view, without a visible reaction. It is the quiet option and it is reversible at any time.
Mute words when the noise is a topic, a phrase or a scam pattern spread across many accounts. Our guide on how to block words on Twitter covers the in-app muted-words options and starter lists; there is no account-level API call for it.
Block when you need the account to stop seeing and following you. Our mass block guide covers block lists at scale and the /twitter/block_user_v2 endpoint, which takes the same three fields as the mute call.
Soft block (block, then unblock) when you only want someone to stop following you; our soft block guide explains what the other person sees.
Leave it when the reply is a one-off. In our study the majority of reply authors (775 of 860) replied exactly once; muting them one by one costs more attention than the replies do.
How we collected this
Question. Under the busiest recent posts of large organization accounts, how concentrated are the replies, and what share would disappear from the owner's view if they muted the N accounts that reply often?
Accounts and method. @OpenAI, @SpaceX, @nvidia, @Xbox and @NASA. For each, one page of the latest timeline posts via /twitter/user/last_tweets, then the four original posts with the highest replyCount, then up to three pages of the conversation via /twitter/tweet/advanced_search with conversation_id:<id> and queryType=Latest. The owner's own replies were excluded.
Sample and window. 1,009 replies from 860 authors under 20 posts; the window is the latest replies at collection time, collected in 2026. The study made 62 read requests returning 1,130 tweets, about $0.17 at 15 credits per tweet. No write endpoint was called and no account was muted.
What the sample cannot show. It holds the latest 40 to 60 replies per post, not the full conversation, so repeat counts are a floor. Conversation search includes replies to other replies, so some repeat authors were in a back-and-forth, not spamming. Where an account had fewer than 25 repeat repliers, the top-25 figure also counts one-time repliers. Five accounts in tech, space and gaming are not every niche.
Privacy. Aggregates only. The five accounts are organizations; reply authors are private individuals and are never named, quoted or profiled. Raw search pages were not kept with the study; the published sample holds de-identified rows (no ID, URL, text or handle).
import json
import os
import time
from collections import Counter
import requests
BASE = "https://api.twitterapi.io"
HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_KEY"]}
MY_HANDLE = "your_brand" # the account whose replies you are cleaning
POST_IDS = ["1234567890123456789"] # your own posts to review
MIN_REPLIES = 3 # flag accounts with this many replies or more
ALLOWLIST = {"783214"} # user ids you never mute (partners, staff)
APPLY = os.environ.get("APPLY") == "1" # dry run unless APPLY=1
PROXY = os.environ.get("PROXY", "") # your residential proxy, http://user:pass@ip:port
def replies_for(post_id, max_pages=5):
"""All replies in one conversation, newest first (reads need no X account)."""
out, cursor = [], ""
for _ in range(max_pages):
r = requests.get(
f"{BASE}/twitter/tweet/advanced_search",
headers=HEADERS,
params={"query": f"conversation_id:{post_id}", "queryType": "Latest", "cursor": cursor},
timeout=30,
)
r.raise_for_status()
body = r.json()
out.extend(body.get("tweets", []))
if not body.get("has_next_page"):
break
cursor = body.get("next_cursor", "")
return out
def login():
"""One login per session: 10,000 credits ($0.10). Returns login_cookies."""
r = requests.post(
f"{BASE}/twitter/user_login_v2",
headers=HEADERS,
json={
"user_name": os.environ["X_USER_NAME"],
"email": os.environ["X_EMAIL"],
"password": os.environ["X_PASSWORD"],
"totp_secret": os.environ.get("X_TOTP_SECRET", ""),
"proxy": PROXY,
},
timeout=60,
)
body = r.json()
if body.get("status") != "success":
raise SystemExit(f"login failed: {body.get('message')}")
return body["login_cookies"]
def mute(cookies, user_id):
r = requests.post(
f"{BASE}/twitter/mute_user_v2",
headers=HEADERS,
json={"login_cookies": cookies, "user_id": user_id, "proxy": PROXY},
timeout=60,
)
return r.json() # {"status": "success" | "error", "message": ..., "x_status"?, "code"?}
# 1. Read the replies and count them per author id.
counts, names = Counter(), {}
for pid in POST_IDS:
for t in replies_for(pid):
a = t["author"]
if a["userName"].lower() == MY_HANDLE.lower() or a["id"] in ALLOWLIST:
continue
counts[a["id"]] += 1
names[a["id"]] = a["userName"]
total = sum(counts.values())
flagged = [(uid, n) for uid, n in counts.most_common() if n >= MIN_REPLIES]
hidden = sum(n for _, n in flagged)
print(f"{total} replies, {len(counts)} authors, {len(flagged)} flagged, "
f"muting them hides {hidden} replies ({100 * hidden / max(total, 1):.1f}%)")
for uid, n in flagged:
print(f" {n:>3} replies @{names[uid]} id={uid}")
# 2. Review the list, then run again with APPLY=1 to mute.
if APPLY and flagged:
cookies = login()
done = []
for uid, _ in flagged:
res = mute(cookies, uid)
print(uid, res.get("status"), res.get("message", ""))
if res.get("status") == "success":
done.append(uid)
time.sleep(10) # fixed, human pace; one account, your own
with open("muted.json", "w") as f:
json.dump(done, f) # keep the ids so you can unmute later
Researching this?Free starter credits cover end-to-end testing — Google sign-in, no card. Get a key.
Questions readers ask
What happens when you mute someone on Twitter (X)?
You stop seeing their posts in your timeline and their activity in your view. Per X's developer docs they are not notified, and they can still follow you, see your posts and send you DMs. Their replies remain visible to everyone else in the conversation.
Does the person know I muted them?
No. X's developer documentation states that muting is private: the muted user is not notified and cannot tell they have been muted. A block, by contrast, removes them as a follower and stops them seeing your posts.
Can a muted account still reply to my posts?
Yes. A mute changes only what you see. The account can still reply, quote or mention you, and other readers still see those replies. A mute does not hide anything from other readers.
Is there an API to mute a user on X?
Yes. The official X API has POST /2/users/:id/muting with an OAuth 2.0 user token (mute.write scope). TwitterAPI.io offers POST /twitter/mute_user_v2 with login_cookies, user_id and proxy, at 60 credits ($0.0006) per successful call; calls that return status: error are not charged.
How do I unmute a user with the API?
On TwitterAPI.io call POST /twitter/unmute_user_v2 with the same three fields as the mute call. On the official X API send DELETE /2/users/:source_user_id/muting/:target_user_id; X's docs say unmuting an account you are not muting succeeds with no action.
Can I mute by handle instead of user ID?
The mute endpoints take the numeric user ID. Resolve a handle with /twitter/user/info (one profile read) or the Twitter ID finder tool, or read author.id directly from reply objects returned by advanced search.
Is muting through an API against X's rules?
Muting from your own account is an ordinary account action, but any automated write acts as that account and X's automation rules apply. Keep a normal human pace and use only accounts you own or manage; X can rate-limit, lock or suspend an account.
Can I mute words through the API?
Muted words are an in-app setting and neither route covered here exposes them. Our guide on how to block words on Twitter walks through the app options.
Continue
- TwitterAPI.io docs: Mute User (mute_user_v2) request body, response fields and price
- TwitterAPI.io docs: Unmute User (unmute_user_v2)
- TwitterAPI.io docs: user_login_v2 (login_cookies, 2FA, price)
- X developer docs: Mutes integration guide (mute vs block table, privacy, pagination)
- X developer docs: Mute user (POST /2/users/{id}/muting, mute.write scope)
- X developer docs: pay-per-usage pricing (Posts: Read, Mute: Read, Mute: Delete)
- X (Twitter) API overview and endpoints
- How to block (mute) words on Twitter
- Mass block on Twitter (X): tools and block lists
- Soft block on Twitter (X), explained
- Twitter login and post API guide (login_cookies)
- Twitter conversation ID: rebuild a reply thread
- Twitter ID finder: handle to numeric user ID
- TwitterAPI.io pay-per-use pricing
- 01Gnip and Twitter (X) Data: PowerTrack, Decahose and What Replaced Them
- 02Twitter (X) and Puppeteer in 2026: What a Node.js Scraper Runs Into, and the API Route
- 03Twitter (X) with Playwright in 2026: What a Browser Script Gets, and the JSON Route in Python and Node
- 04Twitter (X) Bookmarks API: Read, Add, Remove and Export Bookmarks, Plus What bookmarkCount Reveals
- 05TweeterPy for Twitter (X): which calls need a login, what breaks, and how to port it to REST
- 06Twitter (X) Compliance API: Batch Jobs, Compliance Streams and Keeping Stored Tweets Current
- 07Grok for Startups: what the xAI credits cover, who qualifies, and where Twitter (X) data fits
- 08Twitter (X) Account Locked: Why It Happens and How to Unlock It
Writing about something you built with TwitterAPI.io? Our community rewards program pays API credits for honest tutorials, build logs and videos.
Stop reading. Start building.
Starter credits cover real testing on real data. Google sign-in, no card, no application queue.
Get an API keyAlready building with TwitterAPI.io? Publish an honest tutorial or build log about it and earn up to $200 a month in API credits.