Skip to main content

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.


title: “Account Activity API: Enterprise” keywords: [“enterprise Account Activity API”, “enterprise AAA”, “Account Activity enterprise”, “enterprise webhooks”, “enterprise activity”] description: Overview Enterprise The Account Activity API provides you the ability to subscribe to realtime activities related to a user account via webhooks. This…---
This endpoint has been updated to include Post edit metadata. Learn more about these metadata on the “Edit Posts” fundamentals pageThis endpoint is often used with the Direct Messages endpoints. We have launched new v2 Direct Messages endpoints. Note that the Enterprise and Premium Account Activity APIs support v2 one-to-one messages, but do not yet support group conversations.   
Overview Enterprise The Account Activity API provides you the ability to subscribe to realtime activities related to a user account via webhooks. This means that you can receive realtime Posts, Direct Messages, and other account events from one or more of your owned or subscribed accounts through a single connection. You will receive all related activities below for each user subscription on your webhook registration:
Activity types
* Posts (by user)

* Post deletes (by user)
* @mentions (of user)
* Replies (to or from user)
* Retweets (by user or of user)
* Quote Tweets (by user or of user)
* Retweets of Quoted Tweets (by user or of user)
* Likes (by user or of user)
* Follows (by user or of user)

* Unfollows (by user)
* Blocks (by user)
* Unblocks (by user)
* Mutes (by user)
* Unmutes (by user)
* Direct Messages sent (by user)
* Direct Messages received (by user)
* Typing indicators (to user)
* Read receipts (to user)
* Subscription revokes (by user)
Please note - We do not deliver home timeline data via the Account Activity API. Please use the GET statuses/home_timeline to pull this data.  

Video Series

Check out our four-part video series on the Account Activity API to get up to speed!

Feature summary

TierPricingNumber of unique subscriptionsNumber of webhooksReliability and Activity Recovery
EnterpriseContact salesUp to 500+3+Retries and Replay
* Have questions? Running into errors? * Read our Frequently asked questions or Error Troubleshooting guide. * Explore our sample code: * Enterprise Account Activity API dashboard, a node web app that displays webhook events using the enterprise tier of the Account Activity API and includes Replay functionality. * The SnowBot chatbot, a Ruby web app built on the enterprise Account Activity and Direct Message APIs.

Manage webhooks and subscribed users

⏱ 10 min read The enterprise Account Activity API provides you webhook-based JSON messages any time there are events associated with X accounts subscribed to your service. X delivers those activities to your registered webhook. In the following steps, you will learn how to manage webhooks and subscribed users. You will learn how to register, view, and remove, both webhooks and subscribed users. We’ll be using simple cURL commands to make requests to the various API endpoints. cURL is a command-line tool for getting or sending requests using the URL syntax. You will need: * A registered X app - register here * A bearer token - learn more * A webhook that passes a Challenge-Response Check (CRC) - learn more * An enterprise account - [apply here]https://developer.x.com/en/products/x-api/enterprise Before you get started, we recommend you check out our Github repo here that provides a sample web app and helper scripts to get started with X’s Account Activity API

Managing a webhook:

Using a webhook provides you the ability to subscribe to realtime activities related to a user account through a single connection. 
Let’s begin with registering a new webhook URL for the given application context.The URL will be validated via a CRC request before saving. Once you’ve registered a webhook, make sure to document the webhook ID as you will need it later on.Copy the following cURL request into your command line after making changes to the following:* URL <URL> e.g. https://yourdomain.com/webhooks/twitter/* Consumer key <CONSUMER_KEY> e.g. xvz1evFS4wEEPTGEFPHBog* Access token <ACCESS_TOKEN> e.g.  370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb
curl --request POST --url 'https://api.x.com/1.1/account_activity/webhooks.json?url=<URL>' --header 'authorization: OAuth oauth_consumer_key="<CONSUMER_KEY>", oauth_nonce="GENERATED", oauth_signature="GENERATED", oauth_signature_method="HMAC-SHA1", oauth_timestamp="GENERATED", oauth_token="<ACCESS_TOKEN>", oauth_version="1.0"'

Managing subscribed users:

Once you’ve registered a Webhook, you can add a subscribed user to the Account Activity API to begin receiving their account activities.
We’ll begin with subscribing a user so you recieve all event types.Copy the following cURL request into your command line after making changes to the following:* Webhook ID <:WEBHOOK_ID> e.g. 1234567890* Consumer key name <CONSUMER_KEY> e.g. xvz1evFS4wEEPTGEFPHBog* Subscribing user’s access token <SUBSCRIBING_USER'S_ACCESS_TOKEN> e.g. 370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb
curl --request POST --url https://api.x.com/1.1/account_activity/webhooks/<:WEBHOOK_ID>/subscriptions/all.json --header 'authorization: OAuth oauth_consumer_key="<CONSUMER_KEY>", oauth_nonce="GENERATED", oauth_signature="GENERATED", oauth_signature_method="HMAC-SHA1", oauth_timestamp="GENERATED", oauth_token="<SUBSCRIBING_USER'S_ACCESS_TOKEN>", oauth_version="1.0"'
Great job! You should now able to manage your webhooks and subscribed users.

Referenced articles

* Overview of Challenge-Response Check (CRC) * Account Activity Data Types * Managing Webhooks and Subscriptions

A video walkthrough of the Account Activity API

In this video walkthrough, you will learn about the capabilities of the premium and enterprise tiers of the Account Activity API. By the end of this video, you will learn abo