createBlock abstract method

Future<TwitterResponse<BlockStateData, void>> createBlock({
  1. required String userId,
  2. required String targetUserId,

Causes the user (in the path) to block the target user. The user (in the path) must match the user Access Tokens being used to authorize the request.


  • userId: The user ID who you would like to initiate the block on behalf of. It must match your own user ID or that of an authenticating user, meaning that you must pass the Access Tokens associated with the user ID when authenticating your request.

  • targetUserId: The user ID of the user that you would like the id to block. The body should contain a string of the user ID inside of a JSON object.

Endpoint Url

Authentication Methods

  • OAuth 2.0 Authorization Code with PKCE
  • OAuth 1.0a

Required Scopes

  • block.write

Rate Limits

  • User rate limit (OAuth 2.0 user Access Token): 50 requests per 15-minute window per each authenticated user



Future<TwitterResponse<BlockStateData, void>> createBlock(
    {required String userId, required String targetUserId});