Tweets 11 endpoints

GET /2/tweets/{id}

Returns a variety of information about the Tweet specified by the requested ID.

operationId: Tweets_lookupById

Parameters

Name In Required Type Description
id path required

A single Tweet ID.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/{id}
GET /2/tweets/{id}/quote_tweets

Returns a variety of information about each Tweet that quotes the Tweet specified by the requested ID.

operationId: Tweets_getQuoteTweets

Parameters

Name In Required Type Description
id path required

A single Tweet ID.

max_results query optional integer

The maximum number of results to be returned.

pagination_token query optional

This parameter is used to get a specified ‘page’ of results.

exclude query optional array

The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/{id}/quote_tweets
PUT /2/tweets/{tweet_id}/hidden

Hides or unhides a reply to an owned conversation.

operationId: Tweets_hideReply

Parameters

Name In Required Type Description
tweet_id path required

The ID of the reply that you want to hide or unhide.

Request Body

application/json
schema TweetHideRequest
Property Type Required
hidden boolean required

Responses

default

The request has failed.

200

The request has succeeded.

PUT /2/tweets/{tweet_id}/hidden
GET /2/users/{id}/liked_tweets

Returns a list of Tweets liked by the provided User ID

operationId: Tweets_getLikedTweets

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get the next ‘page’ of results.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/liked_tweets
POST /2/users/{id}/likes

Causes the User (in the path) to like the specified Tweet. The User in the path must match the User context authorizing the request.

operationId: Tweets_likeTweet

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User that is requesting to like the Tweet.

Request Body

application/json
schema UsersLikesCreateRequest
Property Type Required
tweet_id string required

Responses

default

The request has failed.

200

The request has succeeded.

POST /2/users/{id}/likes
DELETE /2/users/{id}/likes/{tweet_id}

Causes the User (in the path) to unlike the specified Tweet. The User must match the User context authorizing the request

operationId: Tweets_unlikeTweetById

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User that is requesting to unlike the Tweet.

tweet_id path required

The ID of the Tweet that the User is requesting to unlike.

Responses

default

The request has failed.

200

The request has succeeded.

DELETE /2/users/{id}/likes/{tweet_id}
GET /2/users/{id}/mentions

Returns Tweet objects that mention username associated to the provided User ID

operationId: Tweets_getMentionsById

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

since_id query optional

The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified.

until_id query optional

The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get the next ‘page’ of results.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/mentions
POST /2/users/{id}/retweets

Causes the User (in the path) to retweet the specified Tweet. The User in the path must match the User context authorizing the request.

operationId: Tweets_retweetTweetById

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User that is requesting to retweet the Tweet.

Request Body

application/json
schema UsersRetweetsCreateRequest
Property Type Required
tweet_id string required

Responses

default

The request has failed.

200

The request has succeeded.

POST /2/users/{id}/retweets
DELETE /2/users/{id}/retweets/{source_tweet_id}

Causes the User (in the path) to unretweet the specified Tweet. The User must match the User context authorizing the request

operationId: Tweets_unretweetById

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User that is requesting to retweet the Tweet.

source_tweet_id path required

The ID of the Tweet that the User is requesting to unretweet.

Responses

default

The request has failed.

200

The request has succeeded.

DELETE /2/users/{id}/retweets/{source_tweet_id}
GET /2/users/{id}/timelines/reverse_chronological

Returns Tweet objects that appears in the provided User ID’s home timeline

operationId: Tweets_getUserHomeTimeline

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User to list Reverse Chronological Timeline Tweets of.

since_id query optional

The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified.

until_id query optional

The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get the next ‘page’ of results.

exclude query optional array

The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/timelines/reverse_chronological
GET /2/users/{id}/tweets

Returns a list of Tweets authored by the provided User ID

operationId: Tweets_listByUserId

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

since_id query optional

The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified.

until_id query optional

The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get the next ‘page’ of results.

exclude query optional array

The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/tweets

Users 19 endpoints

GET /2/lists/{id}/followers

Returns a list of Users that follow a List by the provided List ID

operationId: Users_getFollowersByListId

Parameters

Name In Required Type Description
id path required

The ID of the List.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get a specified ‘page’ of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/lists/{id}/followers
GET /2/lists/{id}/members

Returns a list of Users that are members of a List by the provided List ID.

operationId: Users_getMembersByListId

Parameters

Name In Required Type Description
id path required

The ID of the List.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get a specified ‘page’ of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/lists/{id}/members
GET /2/tweets/{id}/liking_users

Returns a list of Users that have liked the provided Tweet ID

operationId: Users_listLikingUsers

Parameters

Name In Required Type Description
id path required

A single Tweet ID.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get the next ‘page’ of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/{id}/liking_users
GET /2/tweets/{id}/retweeted_by

Returns a list of Users that have retweeted the provided Tweet ID

operationId: Users_getRetweetedByTweetIdUsers

Parameters

Name In Required Type Description
id path required

A single Tweet ID.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get the next ‘page’ of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/{id}/retweeted_by
GET /2/users

This endpoint returns information about Users. Specify Users by their ID.

operationId: Users_lookupByIds

Parameters

Name In Required Type Description
ids query required array

A list of User IDs, comma-separated. You can specify up to 100 IDs.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users
GET /2/users/by

This endpoint returns information about Users. Specify Users by their username.

operationId: Users_lookupByUsernames

Parameters

Name In Required Type Description
usernames query required array

A list of usernames, comma-separated.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/by
GET /2/users/by/username/{username}

This endpoint returns information about a User. Specify User by username.

operationId: Users_lookupByUsername

Parameters

Name In Required Type Description
username path required string

A username.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/by/username/{username}
GET /2/users/me

This endpoint returns information about the requesting User.

operationId: Users_lookupMe

Parameters

Name In Required Type Description
user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/me
GET /2/users/{id}

This endpoint returns information about a User. Specify User by ID.

operationId: Users_lookupById

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}
GET /2/users/{id}/blocking

Returns a list of Users that are blocked by the provided User ID

operationId: Users_getBlockedUsers

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User for whom to return results.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get a specified ‘page’ of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/blocking
POST /2/users/{id}/blocking

Causes the User (in the path) to block the target User. The User (in the path) must match the User context authorizing the request

operationId: Users_blockUserById

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User that is requesting to block the target User.

Request Body

required
application/json
schema BlockUserRequest
Property Type Required
target_user_id string required

Responses

default

The request has failed.

200

The request has succeeded.

POST /2/users/{id}/blocking
GET /2/users/{id}/followers

Returns a list of Users who are followers of the specified User ID.

operationId: Users_getFollowersById

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get a specified ‘page’ of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/followers
GET /2/users/{id}/following

Returns a list of Users that are being followed by the provided User ID

operationId: Users_getFollowingUsers

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get a specified ‘page’ of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/following
POST /2/users/{id}/following

Causes the User(in the path) to follow, or “request to follow” for protected Users, the target User. The User(in the path) must match the User context authorizing the request

operationId: Users_followUser

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User that is requesting to follow the target User.

Request Body

application/json
schema UsersFollowingCreateRequest
Property Type Required
target_user_id string required

Responses

default

The request has failed.

200

The request has succeeded.

POST /2/users/{id}/following
GET /2/users/{id}/muting

Returns a list of Users that are muted by the provided User ID

operationId: Users_getMutedUsersById

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User for whom to return results.

max_results query optional integer

The maximum number of results.

pagination_token query optional

This parameter is used to get the next ‘page’ of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/muting
POST /2/users/{id}/muting

Causes the User (in the path) to mute the target User. The User (in the path) must match the User context authorizing the request.

operationId: Users_muteUserById

Parameters

Name In Required Type Description
id path required

The ID of the authenticated source User that is requesting to mute the target User.

Request Body

application/json
schema MuteUserRequest
Property Type Required
target_user_id string required

Responses

default

The request has failed.

200

The request has succeeded.

POST /2/users/{id}/muting
DELETE /2/users/{source_user_id}/blocking/{target_user_id}

Causes the source User to unblock the target User. The source User must match the User context authorizing the request

operationId: Users_unblockUserById

Parameters

Name In Required Type Description
source_user_id path required

The ID of the authenticated source User that is requesting to unblock the target User.

target_user_id path required

The ID of the User that the source User is requesting to unblock.

Responses

default

The request has failed.

200

The request has succeeded.

DELETE /2/users/{source_user_id}/blocking/{target_user_id}
DELETE /2/users/{source_user_id}/following/{target_user_id}

Causes the source User to unfollow the target User. The source User must match the User context authorizing the request

operationId: Users_unfollowUser

Parameters

Name In Required Type Description
source_user_id path required

The ID of the authenticated source User that is requesting to unfollow the target User.

target_user_id path required

The ID of the User that the source User is requesting to unfollow.

Responses

default

The request has failed.

200

The request has succeeded.

DELETE /2/users/{source_user_id}/following/{target_user_id}
DELETE /2/users/{source_user_id}/muting/{target_user_id}

Causes the source User to unmute the target User. The source User must match the User context authorizing the request

operationId: Users_unmuteByUserId

Parameters

Name In Required Type Description
source_user_id path required

The ID of the authenticated source User that is requesting to unmute the target User.

target_user_id path required

The ID of the User that the source User is requesting to unmute.

Responses

default

The request has failed.

200

The request has succeeded.

DELETE /2/users/{source_user_id}/muting/{target_user_id}