DELETE /2/users/:id/likes/:tweet_id

Allows a user or authenticated user ID to unlike a Tweet.

The request succeeds with no action when the user sends a request to a user they're not liking the Tweet or have already unliked the Tweet.

Endpoint URL

https://api.twitter.com/2/users/:id/likes/:tweet_id

Authentication and rate limits

Authentication methods
supported by this endpoint

OAuth 2.0 Authorization Code with PKCE

OAuth 1.0a is also available for this endpoint.

Rate limit

User rate limit (User context): 50 requests per 15-minute window per each authenticated user

OAuth 2.0 scopes required by this endpoint

tweet.read

users.read

like.write

Learn more about OAuth 2.0 Authorization Code with PKCE

Path parameters

NameTypeDescription
id
 Required 
stringThe user ID who you are removing a Like of a Tweet 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.
tweet_id
 Required 
stringThe ID of the Tweet that you would like the id to unlike.


Example code with offical SDKs

      (async () => {
  try {
    const unlikeTweet = await twitterClient.tweets.usersIdUnlike(
      // The ID of the user that is requesting to unlike the tweet
      "2244994945",

      // The ID of the tweet that the user is requesting to unlike
      "1228393702244134912"
    );
    console.dir(unlikeTweet, {
      depth: null,
    });
  } catch (error) {
    console.log(error);
  }
})();

    
      // Set the params values

// String | The ID of the user that is requesting to unlike the tweet
String id = "2244994945";

// String | The ID of the tweet that the user is requesting to unlike
String tweetId = "1228393702244134912";

try {
    UsersLikesDeleteResponse result = apiInstance.tweets().usersIdUnlike(id, tweetId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TweetsApi#usersIdUnlike");
    System.err.println("Status code: " + e.getCode());
    System.err.println("Reason: " + e.getResponseBody());
    System.err.println("Response headers: " + e.getResponseHeaders());
    e.printStackTrace();
}

    

Example responses

      {
  "data": {
    "liked": false
  }
}
    

Response fields

NameTypeDescription
likedbooleanIndicates whether the user is unliking the specified Tweet as a result of this request. The returned value is false for a successful unlike request.