POST /2/users/:id/likes

POST /2/users/:id/likes

Causes the user ID identified in the path parameter to Like the target Tweet.

Endpoint URL

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


Learn more about OAuth 2.0 Authorization Code with PKCE

Path parameters

stringThe user ID who you are liking 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.

JSON body parameters

stringThe ID of the Tweet that you would like the user id to Like.

Example code with offical SDKs

      (async () => {
  try {
    const likeTweet = await twitterClient.tweets.usersIdLike(
      // The ID of the user that is requesting to like the tweet

        // The ID of the tweet that the user is requesting to like
        tweet_id: "1521887626935947265",
    console.dir(likeTweet, {
      depth: null,
  } catch (error) {

      // Set the params values

UsersLikesCreateRequest usersLikesCreateRequest = new UsersLikesCreateRequest();

// String | The ID of the user that is requesting to like the tweet

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

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


Example responses

Successful response
  "data": {
    "liked": true

Response fields

likedbooleanIndicates whether the user likes the specified Tweet as a result of this request.