twitter

3.1.0

Explore all defined operations, data models and types for this version. For live editing and client SDK generators, inspect on TypeHub.

Open in TypeHub
Operations (33)

Adds a Tweet to the authenticated user's Bookmarks.

POST /users/:user_id/bookmarks Bookmark_Response 2 arguments
Operation

Removes a Tweet from the authenticated user's Bookmarks.

DELETE /users/:user_id/bookmarks/:tweet_id Bookmark_Response 2 arguments
Operation

Allows you to get an authenticated user's 800 most recent bookmarked Tweets.

GET /users/:user_id/bookmarks Tweet_Collection 5 arguments
Operation

Uploads a media file (base64 in JSON) for use in Tweets or Direct Messages. Use the returned id in media.media_ids when creating a Tweet.

POST /media/upload Media_Upload_Response 1 argument
Operation

Returns Quote Tweets for a Tweet specified by the requested Tweet ID.

GET /tweets/:tweet_id/quote_tweets Tweet_Collection 6 arguments
Operation

Causes the authenticated user to Retweet the target Tweet.

POST /users/:user_id/retweets Retweet_Response 2 arguments
Operation

Allows the authenticated user to undo a Retweet.

DELETE /users/:user_id/retweets/:source_tweet_id Retweet_Response 2 arguments
Operation

Returns the Retweets for a given Tweet ID.

GET /tweets/:tweet_id/retweets Tweet_Collection 5 arguments
Operation

Returns Tweets from the last seven days that match a search query.

GET /tweets/search/recent Tweet_Collection 5 arguments
Operation

The Trends lookup endpoint allow developers to get the Trends for a location, specified using the where-on-earth id (WOEID).

GET /trends/by/woeid/:woeid Trend_Collection 3 arguments
Operation

Creates a Tweet on behalf of an authenticated user.

POST /tweets Tweet_Create_Response 1 argument
Operation

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

DELETE /tweets/:tweet_id Tweet_Delete_Response 1 argument
Operation

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

GET /tweets/:tweet_id Tweet_Entity 3 arguments
Operation

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

GET /tweets Tweet_Collection 3 arguments
Operation

Allows you to get information about a Tweet’s liking users.

GET /tweets/:tweet_id/liking_users User_Collection 5 arguments
Operation

Returns a list of users who have Retweeted the specified Tweet.

GET /tweets/:tweet_id/retweeted_by User_Collection 5 arguments
Operation

Hides or unhides a reply to a Tweet.

PUT /tweets/:tweet_id/hidden HideReply_Response 2 arguments
Operation

The Usage API in the Twitter API v2 allows developers to programmatically retrieve their project usage. Using thie endpoint, developers can keep a track and monitor of the number of Tweets they have pulled for a given billing cycle.

GET /usage/tweets Tweet_Usage_Response 2 arguments
Operation

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

POST /users/:user_id/likes Like_Response 2 arguments
Operation

Returns a variety of information about one or more users specified by their usernames.

GET /users/by User_Collection 3 arguments
Operation

Allows the authenticated user to follow another user.

POST /users/:user_id/following Follow_Response 2 arguments
Operation

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

GET /users/:user_id User_Entity 3 arguments
Operation

Returns a variety of information about one or more users specified by the requested IDs.

GET /users User_Collection 3 arguments
Operation

Returns information about a single user specified by their username.

GET /users/by/username/:username User_Entity 3 arguments
Operation

Returns a list of users who are followers of the specified user ID.

GET /users/:user_id/followers User_Collection 5 arguments
Operation

Returns a list of users the specified user ID is following.

GET /users/:user_id/following User_Collection 5 arguments
Operation

Tweets liked by a user

GET /users/:user_id/liked_tweets Tweet_Collection 5 arguments
Operation

Returns information about an authorized user.

GET /users/me User_Entity 2 arguments
Operation

Returns Tweets mentioning a single user specified by the requested user ID.

GET /users/:user_id/mentions Tweet_Collection 4 arguments
Operation

Allows you to retrieve a collection of the most recent Tweets and Retweets posted by you and users you follow. This endpoint can return every Tweet created on a timeline over the last 7 days as well as the most recent 800 regardless of creation date.

GET /users/:user_id/timelines/reverse_chronological Tweet_Collection 5 arguments
Operation

Returns Tweets composed by a single user, specified by the requested user ID.

GET /users/:user_id/tweets Tweet_Collection 5 arguments
Operation

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

DELETE /users/:user_id/likes/:tweet_id Like_Response 2 arguments
Operation

Allows the authenticated user to unfollow another user.

DELETE /users/:source_user_id/following/:target_user_id Follow_Response 2 arguments
Operation
Types (68)
Bookmark

Result of a bookmark or remove bookmark action.

Type
Bookmark_Response

Response wrapper.

Type
Collection_Meta

Metadata about a paginated collection response.

Type
Create_Bookmark_Request

Request body to bookmark a Tweet.

Type
Error

A single error or problem entry returned by the X API, either as a partial error in a 200 response or inside an error response.

Type
Errors

Error response of the X API. Contains the top-level problem fields and optionally a list of individual errors.

Type
Fields

Field selection parameters which define the fields returned for each object type.

Type
Follow

Result of a follow or unfollow action.

Type
Follow_Response

Follow/unfollow response wrapper.

Type
HideReply

Result of a hide or unhide reply action.

Type
HideReply_Response

Response wrapper.

Type
Includes

Objects referenced by the primary data and requested via the expansions parameter.

Type
Like

Result of a like or unlike action.

Type
Like_Response

Response wrapper.

Type
Media

An image, video or animated GIF attached to a Tweet.

Type
Media_Public_Metrics

Public engagement metrics for the media.

Type
Media_Upload

An uploaded media object.

Type
Media_Upload_Image

Image details of an uploaded media.

Type
Media_Upload_Processing_Info

Asynchronous processing state of an uploaded media.

Type
Media_Upload_Request

Request body for a one-shot media upload (JSON, base64).

Type
Media_Upload_Response

Media upload response wrapper.

Type
Media_Variant

A playback or display variant of a media object.

Type
Pagination

Time range and pagination parameters for timeline and search endpoints.

Type
Place

A geographic place tagged in a Tweet.

Type
Poll

A poll attached to a Tweet.

Type
Poll_Option

A choice in a poll.

Type
Retweet

Result of a Retweet or undo Retweet action.

Type
Retweet_Response

Retweet response wrapper.

Type
Single_Tweet

Request body referencing a single Tweet.

Type
Target_User

Request body referencing a target user.

Type
Trend

A trending topic.

Type
Trend_Collection

A list of trends.

Type
Trend_Fields

Field selection for the trends endpoint.

Type
Tweet

Request body to create a Tweet.

Type
Tweet_Attachments

The type of attachments (if any) present in this Tweet.

Type
Tweet_Collection

A list of Tweets.

Type
Tweet_Create

The created Tweet.

Type
Tweet_Create_Response

Response wrapper.

Type
Tweet_Delete

Result of a Tweet deletion.

Type
Tweet_Delete_Response

Response wrapper.

Type
Tweet_Details

A Tweet (Post) object.

Type
Tweet_Details_Geo

The location tagged on the Tweet, if the user provided one.

Type
Tweet_Details_Geo_Coordinates

A GeoJSON Point geometry.

Type
Tweet_Edit_Controls

Indicates how much longer (if at all) this Tweet can be edited.

Type
Tweet_Edit_Options

Options to edit an existing Tweet instead of creating a new one.

Type
Tweet_Entities

Entities (hashtags, cashtags, mentions, URLs) parsed from the Tweet text.

Type
Tweet_Entities_Mention

A user mention found in the Tweet text.

Type
Tweet_Entities_Tag

A hashtag or cashtag found in the Tweet text.

Type
Tweet_Entities_Url

A URL found in the Tweet text.

Type
Tweet_Entity

A single Tweet response.

Type
Tweet_Geo

Location information for the Tweet being created.

Type
Tweet_Media

Media attached to the Tweet being created.

Type
Tweet_Note_Tweet

The full content of a long Tweet (more than 280 characters).

Type
Tweet_Poll

Poll attached to the Tweet being created.

Type
Tweet_Public_Metrics

Public engagement metrics for the Tweet at the time of the request.

Type
Tweet_Referenced_Tweet

A Tweet that this Tweet refers to (Retweet, Quote or Reply).

Type
Tweet_Reply

Reply information for the Tweet being created.

Type
Tweet_Usage

Tweet consumption usage of the project for the current billing cycle.

Type
Tweet_Usage_Daily_Client_App

Per client app daily Tweet usage.

Type
Tweet_Usage_Daily_Project

Project-level daily Tweet usage.

Type
Tweet_Usage_Day

A single day's Tweet usage entry.

Type
Tweet_Usage_Response

Response wrapper.

Type
Usage_Fields

Field selection for the usage endpoint.

Type
User

An X user account.

Type
User_Collection

A list of users.

Type
User_Entity

A single user response.

Type
User_Public_Metrics

Public metrics for this User.

Type
Withheld

Withholding details for withheld content.

Type
part of the Apioo-Project