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

# API de Account Activity

> Recibe en tiempo real la actividad de la cuenta mediante webhooks

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>;
};

La Account Activity API proporciona eventos de actividad de la cuenta en tiempo real a tu webhook. Suscríbete a cuentas de usuario y recibe notificaciones cuando publiquen, reciban mensajes directos (DM), consigan nuevos seguidores y más.

<div id="overview">
  ## Descripción general
</div>

<CardGroup cols={2}>
  <Card title="Entrega con webhooks" icon="webhook">
    Eventos entregados a tu servidor
  </Card>

  <Card title="En tiempo real" icon="bolt">
    Notificaciones de eventos al instante
  </Card>

  <Card title="Completo" icon="list">
    Publicaciones, DMs, seguidores, Me gusta y más
  </Card>

  <Card title="Basado en suscripciones" icon="bell">
    Suscríbete a cuentas de usuario
  </Card>
</CardGroup>

***

<div id="how-it-works">
  ## Cómo funciona
</div>

1. **Registrar webhook** — Registra la URL del webhook
2. **Suscribir usuarios** — Añade suscripciones de usuario
3. **Recibir eventos** — Obtén eventos de actividad mediante solicitudes POST
4. **Procesar eventos** — Procesa los eventos en la aplicación

***

<div id="event-types">
  ## Tipos de eventos
</div>

| Categoría             | Eventos                                                    |
| :-------------------- | :--------------------------------------------------------- |
| **Publicaciones**     | Crear, eliminar, marcar como favorito, quitar de favoritos |
| **Mensajes directos** | Recibido, enviado, indicador de escritura                  |
| **Seguimientos**      | Seguir, dejar de seguir                                    |
| **Bloqueos**          | Bloquear, desbloquear                                      |
| **Silencios**         | Silenciar, dejar de silenciar                              |

***

<div id="webhook-security">
  ## Seguridad de los webhooks
</div>

Todas las solicitudes de webhook incluyen:

* **Validación CRC** — Verificar la autenticidad del webhook
* **Encabezado de firma** — `x-twitter-webhooks-signature`
* **HTTPS obligatorio** — Todas las URL de webhook deben utilizar HTTPS

***

<div id="example-register-a-webhook">
  ## Ejemplo: registrar un webhook
</div>

```bash theme={null}
curl -X POST "https://api.x.com/1.1/account_activity/all/env-name/webhooks.json?\
url=https%3A%2F%2Fyour-server.com%2Fwebhook" \
  -H "Authorization: OAuth oauth_consumer_key=..."
```

***

<div id="getting-started">
  ## Primeros pasos
</div>

<Note>
  **Requisitos previos**

  * Una [cuenta de desarrollador](https://developer.x.com/en/portal/petition/essential/basic-info) aprobada
  * Un [Proyecto y App](/es/resources/fundamentals/developer-apps) en la Consola de desarrollador
  * Un endpoint de webhook HTTPS accesible públicamente
</Note>

<CardGroup cols={2}>
  <Card title="Flujo de actividad" icon="stream" href="/es/x-api/activity/introduction">
    Alternativa mediante streaming a los webhooks
  </Card>

  <Card title="Guía de migración" icon="right-left" href="/es/x-api/account-activity/migrate/overview">
    Migra desde v1.1
  </Card>

  <Card title="Referencia de la API" icon="code" href="/es/x-api/account-activity/register-webhook">
    Documentación completa del endpoint
  </Card>
</CardGroup>
