Skip to main content
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

Webhook delivery

Events delivered to your server

Real-time

Instant event notifications

Comprehensive

Posts, DMs, follows, likes, and more

Subscription-based

Subscribe to user accounts

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

CategoryEvents
PostsCreate, delete, favorite, unfavorite
Direct MessagesReceived, sent, typing indicator
FollowsFollow, unfollow
BlocksBlock, unblock
MutesMute, unmute

Webhook security

All webhook requests include:
  • CRC validation — Verify webhook authenticity
  • Signature headerx-twitter-webhooks-signature
  • HTTPS required — All webhook URLs must use HTTPS

Example: Register a webhook

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

Prerequisites