Skip to main content
This guide walks you through hiding and unhiding replies to Posts in conversations you started.
PrerequisitesBefore you begin, you’ll need:
  • A developer account with an approved App
  • User Access Token (OAuth 1.0a or OAuth 2.0 PKCE)

Hide a reply

Find the reply's Post ID

Get the ID of the reply you want to hide. You can only hide replies to conversations started by the authenticated user.
https://x.com/user/status/1232720193182412800
                          └── This is the Post ID

Send the hide request

cURL
curl -X PUT "https://api.x.com/2/tweets/1232720193182412800/hidden" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hidden": true}'
from xdk import Client
from xdk.oauth1_auth import OAuth1

oauth1 = OAuth1(
    api_key="YOUR_API_KEY",
    api_secret="YOUR_API_SECRET",
    access_token="YOUR_ACCESS_TOKEN",
    access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
)

client = Client(auth=oauth1)

# Hide a reply
response = client.posts.hide_reply("1232720193182412800", hidden=True)
print(f"Hidden: {response.data.hidden}")
import { Client, OAuth1 } from "@xdevplatform/xdk";

const oauth1 = new OAuth1({
  apiKey: "YOUR_API_KEY",
  apiSecret: "YOUR_API_SECRET",
  accessToken: "YOUR_ACCESS_TOKEN",
  accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
});

const client = new Client({ oauth1 });

// Hide a reply
const response = await client.posts.hideReply("1232720193182412800", {
  hidden: true,
});
console.log(`Hidden: ${response.data?.hidden}`);

Confirm the reply is hidden

{
  "data": {
    "hidden": true
  }
}
The reply is now hidden from the main conversation view. Users can still see it by clicking “View hidden replies.”

Unhide a reply

To make a hidden reply visible again:
cURL
curl -X PUT "https://api.x.com/2/tweets/1232720193182412800/hidden" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"hidden": false}'
from xdk import Client
from xdk.oauth1_auth import OAuth1

oauth1 = OAuth1(
    api_key="YOUR_API_KEY",
    api_secret="YOUR_API_SECRET",
    access_token="YOUR_ACCESS_TOKEN",
    access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
)

client = Client(auth=oauth1)

# Unhide a reply
response = client.posts.hide_reply("1232720193182412800", hidden=False)
print(f"Hidden: {response.data.hidden}")
import { Client, OAuth1 } from "@xdevplatform/xdk";

const oauth1 = new OAuth1({
  apiKey: "YOUR_API_KEY",
  apiSecret: "YOUR_API_SECRET",
  accessToken: "YOUR_ACCESS_TOKEN",
  accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
});

const client = new Client({ oauth1 });

// Unhide a reply
const response = await client.posts.hideReply("1232720193182412800", {
  hidden: false,
});
console.log(`Hidden: ${response.data?.hidden}`);
Response:
{
  "data": {
    "hidden": false
  }
}

Important notes

  • You can only hide replies to conversations you started
  • Hidden replies are still visible via “View hidden replies”
  • The reply author is not notified when their reply is hidden

Next steps

Manage by topic

Moderate replies based on content

Real-time moderation

Moderate replies as they arrive

API Reference

Full endpoint documentation