The endpoints described in this section are the replacements of the v1.1 endpoints that allow you to manage and lookup blocking relationships:
If you are currently using any of these endpoints, you can use our migration materials to start working with the new v2 versions.
Learn more about the new Twitter API v2: Early Access.
Blocking users is a core security feature on Twitter. Using the endpoints in the manage blocks endpoint group, you can build safer experiences for Twitter users or block users programmatically based on previous engagements. You can also unblock users after a given period of time, based on the criteria that you determine. Using blocks lookup, you can see who you or an authenticated user has blocked. This can be useful for determining how you can interact with a given account.
Since you are making requests for private information with blocks lookup, and on behalf of a user with manage blocks, you must authenticate these endpoints with OAuth 1.0a User Context and use the Access Tokens associated with a user that has authorized your App, which can be generated using the 3-legged OAuth flow.
The blocks lookup GET endpoint allows you to see which accounts you’ve blocked on behalf of an authorized user. This endpoint has a rate limit of 15 requests per 15 minutes per user.
The manage blocks endpoints enable you to block or unblock a specified user on behalf of an authenticated user. For this endpoint group, there are two methods available: POST and DELETE. The POST method allows you to block a user, and the DELETE method allows you to unblock. There is a user rate limit of 50 requests per 15 minutes per endpoint with both the POST and DELETE methods.
Learn more about getting access to the Twitter API v2 endpoints in our getting started page.