Please note We have released a new compliance tool to X API v2 called batch compliance. This new tool allows you to upload large datasets of Post or user IDs to retrieve their compliance status in order to determine what data requires action in order to bring your datasets into compliance.
In addtion, both the batch compliance and the compliance firehose have been updated to support Post edits. For the compliance firehose, a new ‘tweet_edit’ event was added. See the Compliance Data Objects documentation for more details. Learn more about how Edit Post metadata works on the Edit Posts fundamentals page.
Enterprise
One of X’s core values is to defend and respect the user’s voice. This includes respecting their expectations and intent when they delete, modify, or edit the content they choose to share on X. We believe that this is critically important to the long term health of one of the largest public, real-time information platforms in the world. X puts controls in the hands of its users, giving individuals the ability to control their own X experience. We believe that business consumers that receive X data have a responsibility to honor the expectations and intent of end users.
For more information on the types of compliance events that are possible on the X platform, reference our article, Honoring User Intent on X.
Any developer or company consuming X data via an API holds an obligation to use all reasonable efforts to honor changes to user content. This obligation extends to user events such as deletions, modifications, and changes to sharing options (e.g., content becoming protected or withheld). This also includes when users edit their Posts. Please reference the specific language in the Developer Policy and/or your X Data Agreement to understand how this obligation affects your use of X data.
X offers the following solutions that deliver information about these user compliance events and whether a specific Post or User is publicly available or not. A brief overview of the solutions and their general integration patterns is detailed below:
Original Message Type | Object | Permanent (Yes/No) | Recommended Action |
---|---|---|---|
delete | Status | Yes | Delete associated Post. |
status_withheld | Status | Yes | Suppress associated Post in specific countries listed in the status_withheld message. |
drop | Status | No | Remove the Post from public view. |
undrop | Status | No | Status may be displayed again and treated as public. |
tweet_edit | Status | Yes | Honor and, where relevant, display the new edit. |
user_delete | User | No | Suppress or delete all Posts by associated user. |
user_undelete | User | No | All Posts by associated user may be displayed again and treated as public. |
user_protect | User | No | Suppress or delete all Posts by associated user. |
user_unprotect | User | No | All Posts by associated user may be displayed again and treated as public. |
user_suspend | User | No | Suppress or delete all Posts by associated user. |
user_unsuspend | User | No | All Posts by associated user may be displayed again and treated as public. |
scrub_geo | User | Yes | Delete all geodata provided by X for all Posts by the user prior to the specified Post in the scrub_geomessage. Note that subsequent Posts by a user may contain geodata that may be used. |
user_withheld | User | Yes | Suppress Posts by associated user in specific countries listed in the user_withheld message. |
delete | Favorite | Yes | Delete associated like/favorite. |
Action | Description |
---|---|
Protect Account | A X user can protect or unprotect their account at any time. Protected accounts require manual user approval of every person who is allowed to view their account’s Posts. For more information, see About Public and Protected Posts. |
Delete Account | A X user can decide to delete their account and all associated status messages at any time. X retains the account information for 30 days after deletion in case the user decides to undelete and effectively reactivate their account. |
Scrub Geo | A X user can remove all location data from past Posts at any time. This known as “scrub geo”. |
Suspend Account | X retains the right to suspend accounts that are in violation of the X Rules or if an account is suspected to have been hacked or compromised. Account suspensions can only be reversed (unsuspend) by X. |
Withhold Account | X retains the right to reactively withhold access to certain content in a specific country from time to time. A withheld account can only be made unwithheld by X. For more information, see Country Withheld Content. |
Action | Description |
---|---|
Delete Status | A X user can delete a status at any point in time. Deleted statuses cannot be reversed and are permanently deleted. |
Withhold Status | X retains the right to reactively withhold access to certain content in a specific country from time to time. A withheld status can only be made unwithheld by X. For more information, see Country Withheld Content. |
Method | Description |
---|---|
GET /compliance/:stream | Connect to the Data Stream |
Request Method | HTTP GET |
Connection Type | Keep-Alive |
URL | Found on the stream’s API Help page of your dashboard, and resembles the following structure: https://gnip-stream.x.com/stream/compliance/accounts/:account_name/publishers/twitter/:stream_label.json?partition=1 Note: The “partition” parameter is required. You will need to connect to all 8 partitions, each containing 12.5% of the total volume, to consume the full stream. |
Compression | Gzip. To connect to the stream using Gzip compression, simply send an Accept-Encoding header in the connection request. The header should look like the following: Accept-Encoding: gzip |
Character Encoding | UTF-8 |
Response Format | JSON. The header of your request should specify JSON format for the response. |
Rate Limit | 10 requests per 60 seconds. |
Read Timeout | Set a read timeout on your client, and ensure that it is set to a value beyond 30 seconds. |
Support for Tweet edits | All Tweet edits trigger a “tweet_edit” Compliance event. See the Compliance Data Objects documentation for more details. |
partition=1
of the Compliance firehose - you’ll need to connect to all 8 partitions to consume the entirety of this stream.
Status | Text | Definition |
---|---|---|
200 | Success | The connection was successfully opened, and new activities will be sent through as they arrive. |
401 | Unauthorized | HTTP authentication failed due to invalid credentials. Log in to console.gnip.com with your credentials to ensure you are using them correctly with your request. |
406 | Not Acceptable | Generally, this occurs where your client fails to properly include the headers to accept gzip encoding from the stream, but can occur in other circumstances as well. Will contain a JSON message similar to “This connection requires compression. To enable compression, send an ‘Accept-Encoding: gzip’ header in your request and be ready to uncompress the stream as it is read on the client end.” |
429 | Rate Limited | Your app has exceeded the limit on connection requests. |
503 | Service Unavailable | Twitter server issue. Reconnect using an exponential backoff pattern. If no notice about this issue has been posted on the X API Status Page, contact support. |