> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration guide

> The v2 hide replies endpoint is replacing the Labs hide replies endpoint. Reference for the X API v2 standard tier covering hide replies.

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

## Comparing X API's hide replies endpoints

The v2 hide replies endpoint is replacing the Labs hide replies endpoint. If you have code, apps, or tools that use the Labs version of this endpoint, and are considering migrating to the newer X API v2 endpoint, then this guide is for you.

In order to use the new X API v2 (including the hide replies endpoint), you will need to [opt in to the new Developer Console](https://developer.x.com/en/portal/opt-in), create a [Project](/resources/fundamentals/developer-apps), and add an App to that Project. You can then use the credentials associated with that App to make requests to the hide replies endpoint. Adding the same App that's enrolled for the Labs v2 hide replies endpoint will keep your users authenticated.

The following table compares the differences between Labs and the newer X API v2 endpoint:

| **Description**                                                                                                                                                    | **Labs v2**                                                        | **X API v2**                                         |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------- | :--------------------------------------------------- |
| Host domain                                                                                                                                                        | [https://api.x.com](https://api.x.com)                             | [https://api.x.com](https://api.x.com)               |
| Endpoint path                                                                                                                                                      | /labs/2/tweets/:id/hidden                                          | /2/tweets/:id/hidden                                 |
| Authentication                                                                                                                                                     | OAuth 1.0a User context                                            | OAuth 1.0a User context                              |
| HTTP methods supported                                                                                                                                             | PUT                                                                | PUT                                                  |
| Default request rate limits                                                                                                                                        | 10 requests per 15 minutes (shared across all authenticated users) | 50 requests per 15 min (for each authenticated user) |
| Can hide replies                                                                                                                                                   | ✔︎                                                                 | ✔︎                                                   |
| Can unhide a previously hidden reply                                                                                                                               | ✔︎                                                                 | ✔︎                                                   |
| Can hide or unhide replies multiple times                                                                                                                          | ✔︎                                                                 | ✔︎                                                   |
| Requires the use of credentials from a [developer App](/resources/fundamentals/developer-apps) associated with a [project](/resources/fundamentals/developer-apps) |                                                                    | ✔                                                    |

***

## Code examples

### Hide a reply (v2)

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl -X PUT "https://api.x.com/2/tweets/1234567890/hidden" \
    -H "Authorization: OAuth ..." \
    -H "Content-Type: application/json" \
    -d '{"hidden": true}'
  ```

  ```python Python theme={null}
  # Requires OAuth 1.0a User Context authentication
  import requests
  from requests_oauthlib import OAuth1

  auth = OAuth1(
      "API_KEY", "API_SECRET",
      "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET"
  )

  url = "https://api.x.com/2/tweets/1234567890/hidden"
  response = requests.put(url, auth=auth, json={"hidden": True})
  print(response.json())
  ```

  ```python Python SDK theme={null}
  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("1234567890", hidden=True)
  print(f"Hidden: {response.data.hidden}")
  ```

  ```javascript JavaScript SDK theme={null}
  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("1234567890", { hidden: true });
  console.log(`Hidden: ${response.data?.hidden}`);
  ```
</CodeGroup>

**Other migration resources**

[X API migration hub](/x-api/migrate/overview)
