> ## 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.

# Quickstart

> Esta guía te muestra cómo ocultar y mostrar respuestas a Posts en conversaciones que tú iniciaste. Referencia del nivel estándar de X API v2 sobre hide replies.

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <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>;
};

Esta guía te muestra cómo ocultar y mostrar respuestas a Posts en conversaciones que tú iniciaste.

<Note>
  **Requisitos previos**

  Antes de comenzar, necesitarás:

  * Una [cuenta de desarrollador](https://developer.x.com/en/portal/petition/essential/basic-info) con una App aprobada
  * Un User Access Token (OAuth 1.0a o OAuth 2.0 PKCE)
</Note>

***

## Ocultar una respuesta

<Steps>
  <Step title="Encuentra el ID del Post de respuesta" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-chat.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=9fde7d51b4f18c96d3a38a81d519761f" width="24" height="24" data-path="icons/xds/icon-chat.svg">
    Obtén el ID de la respuesta que quieres ocultar. Solo puedes ocultar respuestas a conversaciones iniciadas por el usuario autenticado.

    ```
    https://x.com/user/status/1232720193182412800
                              └── Este es el ID del Post
    ```
  </Step>

  <Step title="Envía la solicitud de ocultar" icon="eye-slash">
    <CodeGroup dropdown>
      ```bash cURL theme={null}
      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}'
      ```

      ```python title="Python SDK" lines wrap icon="python" 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)

      # Oculta una respuesta
      response = client.posts.hide_reply("1232720193182412800", hidden=True)
      print(f"Hidden: {response.data.hidden}")
      ```

      ```javascript title="JavaScript SDK" lines wrap icon="square-js" 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 });

      // Oculta una respuesta
      const response = await client.posts.hideReply("1232720193182412800", {
        hidden: true,
      });
      console.log(`Hidden: ${response.data?.hidden}`);
      ```
    </CodeGroup>
  </Step>

  <Step title="Confirma que la respuesta esté oculta" icon="check">
    ```json theme={null}
    {
      "data": {
        "hidden": true
      }
    }
    ```

    La respuesta ahora está oculta de la vista principal de la conversación. Los usuarios aún pueden verla haciendo clic en "Ver respuestas ocultas".
  </Step>
</Steps>

***

## Mostrar una respuesta

Para volver a hacer visible una respuesta oculta:

<CodeGroup dropdown>
  ```bash cURL theme={null}
  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}'
  ```

  ```python title="Python SDK" lines wrap icon="python" 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)

  # Muestra una respuesta
  response = client.posts.hide_reply("1232720193182412800", hidden=False)
  print(f"Hidden: {response.data.hidden}")
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" 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 });

  // Muestra una respuesta
  const response = await client.posts.hideReply("1232720193182412800", {
    hidden: false,
  });
  console.log(`Hidden: ${response.data?.hidden}`);
  ```
</CodeGroup>

**Respuesta:**

```json theme={null}
{
  "data": {
    "hidden": false
  }
}
```

***

## Notas importantes

<Note>
  * Solo puedes ocultar respuestas a conversaciones **que tú iniciaste**
  * Las respuestas ocultas siguen siendo visibles a través de "Ver respuestas ocultas"
  * El autor de la respuesta no es notificado cuando su respuesta se oculta
</Note>

***

## Próximos pasos

<CardGroup cols={2}>
  <Card title="Gestionar por tema" icon="tags" href="/x-api/posts/hide-replies/integrate/manage-replies-by-topic">
    Modera respuestas basadas en el contenido
  </Card>

  <Card title="Moderación en tiempo real" icon="bolt" href="/x-api/posts/hide-replies/integrate/manage-replies-in-realtime">
    Modera respuestas a medida que llegan
  </Card>

  <Card title="Referencia de la API" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-code.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=488e23401b19225b89acc0136d242219" href="/x-api/posts/hide-reply" width="24" height="24" data-path="icons/xds/icon-code.svg">
    Documentación completa del endpoint
  </Card>
</CardGroup>
