Blocks contains the Twitter API v2 versions of the following standard v1.1 endpoints:

To see what's new with these v2 endpoints, please visit our comparison guide.

Learn more about the new Twitter API v2: Early Access.

Introduction

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

 

Blocks lookup

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. 
 

Manage blocks

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. 
 

To access these endpoint, you must have an approved developer account. When authenticating, you must use keys and tokens from a developer App that is located within a Project

Learn more about getting access to the Twitter API v2 endpoints in our getting started page.

Was this document helpful?
Thank you

Thank you for the feedback. We’re really glad we could help!

Thank you for the feedback. How could we improve this document?
Thank you for the feedback. Your comments will help us improve our documents in the future.