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

# Account Activity API

> Receive real-time account activity via 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>;
};

The Account Activity API delivers real-time account activity events to your webhook. Subscribe to user accounts and receive notifications when they post, receive DMs, get followed, and more.

## Overview

<CardGroup cols={2}>
  <Card title="Webhook delivery" icon="webhook">
    Events delivered to your server
  </Card>

  <Card title="Real-time" icon="bolt">
    Instant event notifications
  </Card>

  <Card title="Comprehensive" icon="list">
    Posts, DMs, follows, likes, and more
  </Card>

  <Card title="Subscription-based" icon="bell">
    Subscribe to user accounts
  </Card>
</CardGroup>

***

## How it works

1. **Register webhook** — Register your webhook URL
2. **Subscribe users** — Add user subscriptions
3. **Receive events** — Get activity events via POST requests
4. **Process events** — Handle events in your application

***

## Event types

| Category            | Events                               |
| :------------------ | :----------------------------------- |
| **Posts**           | Create, delete, favorite, unfavorite |
| **Direct Messages** | Received, sent, typing indicator     |
| **Follows**         | Follow, unfollow                     |
| **Blocks**          | Block, unblock                       |
| **Mutes**           | Mute, unmute                         |

***

## Webhook security

All webhook requests include:

* **CRC validation** — Verify webhook authenticity
* **Signature header** — `x-twitter-webhooks-signature`
* **HTTPS required** — All webhook URLs must use HTTPS

***

## Example: Register a webhook

```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=..."
```

***

## Getting started

<Note>
  **Prerequisites**

  * An approved [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * A [Project and App](/resources/fundamentals/developer-apps) in the Developer Console
  * A publicly accessible HTTPS webhook endpoint
</Note>

<CardGroup cols={2}>
  <Card title="Activity stream" icon="stream" href="/x-api/activity/introduction">
    Streaming alternative to webhooks
  </Card>

  <Card title="Migration guide" icon="right-left" href="/x-api/account-activity/migrate/overview">
    Migrate from v1.1
  </Card>

  <Card title="API Reference" icon="code" href="/x-api/account-activity/register-webhook">
    Full endpoint documentation
  </Card>
</CardGroup>
