Xconnector v1

Version 1

Connector Overview: This page documents all 79 actions for the Xconnector v1 R4.

View API Documentation

Batch Compliance (3)

POST Create a batch compliance job

/2/compliance/jobs

Creates a new compliance job for Post IDs or user IDs.

A compliance job will contain an ID and a destination URL. The destination URL represents the location that contains the list of IDs consumed by your App

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (1)

Option Name

Description

Type

N/A

GET Get a compliance job by ID

/2/compliance/jobs/{id}

Get a single compliance job with the specified ID.

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

N/A

Response Type

N/A

GET Get all batch compliance jobs

/2/compliance/jobs

Returns a list of recent compliance jobs.

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Type

N/A

Response Type

N/A

Blocks

GET Blocks lookup

/2/users/{id}/blocking

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

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The user ID whose blocked users you would like to retrieve. The user’s ID must correspond to the user ID of the authenticating user, meaning that you must pass the Access Tokens associated with the user ID when authenticating your request.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld
Default values:
id,text
OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 1000.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Bookmarks (3)

POST Bookmark a Post

/2/users/{id}/bookmarks

Allows an authenticated user to like a Post.

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the user who wishes to like a Post. The ID must belong to the authenticating user.

Response Type

N/A

Options (1)

Option Name

Description

Tweet Id

N/A

GET Bookmarked Posts

/2/users/{id}/bookmarks

Returns a list of Posts that have been bookmarked by a specified user ID.

For full details, see the API reference for this endpoint.

Sign up for the X API.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. User ID of the user to request liked Posts for.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

DELETE Remove a Bookmark

/2/users/{id}/bookmarks/{tweet_id}

Allows an authenticated user to unlike a Post.

For full details, see the API reference for this endpoint.

Sign up for the X API.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the user who wishes to unlike a Tweet. The ID must belong to the authenticating user.

Tweet Id

The ID of the Tweet to be unliked

Response Type

N/A

Direct Messages Lookup (3)

GET DM events by 1-1 conversation

/2/dm_conversations/with/{participant_id}/dm_events

Returns DM Events for a DM Conversation by participant ID.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Participant Id

The User ID of who this one-to-one Direct Message is with.

Event Types

Allowed values: MessageCreate,ParticipantsJoin,ParticipantsLeave

Comma-separated list of fields (with no spaces).

All event types are returned by default.

Max Results

The maximum number of search results to be returned by a request. A number between 1 and the system limit (currently 100). By default, a request response will return 100 results.

Pagination Token

This parameter is used to get the next or previous 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Media.fields

Allowed values: duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values: media_key,type

Requires the attachments.media_keys expansion.

Comma-separated list of fields (with no spaces).

Tweet.fields

Allowed values: attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld

Default fields: id, text, and edit_history_tweet_ids.

Requires the referenced_tweets.id expansion.

Comma-separated list of fields (with no spaces).

User.fields

Allowed values: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld

Default values: id,name,username

Requires the participants_ids and/or sender_id expansions.

Comma-separated list of fields (with no spaces).

Expansions

Allowed values: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld

Default values: id,name,username

Requires the participants_ids and/or sender_id expansions.

Comma-separated list of fields (with no spaces).

Dm Event.fields

N/A

Response Type

N/A

GET DM events by User

/2/dm_events

Returns all of the DM Events for an authenticated user.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Dm Event.fields

Allowed values: id,text,event_type,dm_conversation_id,created_at,sender_id,attachments,participant_ids,referenced_tweets

id, text, and event_type are returned by default.

Comma-separated list of fields (with no spaces).

Event Types

Allowed values: MessageCreate,ParticipantsJoin,ParticipantsLeave

Comma-separated list of fields (with no spaces).

All event types are returned by default.

Max Results

The maximum number of search results to be returned by a request. A number between 1 and the system limit (currently 100). By default, a request response will return 100 results.

Pagination Token

This parameter is used to get the next or previous 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Media.fields

Allowed values: duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values: media_key,type

Requires the attachments.media_keys expansion.

Comma-separated list of fields (with no spaces).

Tweet.fields

Allowed values: attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld

Default fields: id, text, and edit_history_tweet_ids.

Requires the referenced_tweets.id expansion.

Comma-separated list of fields (with no spaces).

User.fields

Allowed values: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld

Default values: id,name,username

Requires the participants_ids and/or sender_id expansions.

Comma-separated list of fields (with no spaces).

Expansions

Allowed values: sender_id,referenced_tweets.id,attachments.media_keys,participant_ids
Comma-separated list of fields (with no spaces).

Response Type

N/A

GET Get DMs by conversation

/2/dm_conversations/{dm_conversation_id}/dm_events

Returns DM Events for a DM Conversation by conversation ID.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Dm Conversation Id

Events are retrieved for the conversation associated with this ID. Supports both one-to-one and group conversations.

Dm Event.fields

Allowed values: id,text,event_type,dm_conversation_id,created_at,sender_id,attachments,participant_ids,referenced_tweets
id, text, and event_type are returned by default.
Comma-separated list of fields (with no spaces).

Event Types

Allowed values: MessageCreate,ParticipantsJoin,ParticipantsLeave
Comma-separated list of fields (with no spaces).
All event types are returned by default.

Max Results

The maximum number of search results to be returned by a request. A number between 1 and the system limit (currently 100). By default, a request response will return 100 results.

Pagination Token

This parameter is used to get the next or previous 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Media.fields

Allowed values: duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width
Default values: media_key,type
Requires the attachments.media_keys expansion.
Comma-separated list of fields (with no spaces).

Tweet.fields

Allowed values: attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld
Default fields: id, text, and edit_history_tweet_ids.
Requires the referenced_tweets.id expansion.
Comma-separated list of fields (with no spaces).

User.fields

Allowed values: created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values: id,name,username
Requires the participants_ids and/or sender_id expansions.
Comma-separated list of fields (with no spaces).

Expansions

Allowed values: sender_id,referenced_tweets.id,attachments.media_keys,participant_ids
Comma-separated list of fields (with no spaces).

Response Type

N/A

Engagement Metrics (2)

GET Media Analytics

/2/media/analytics

Allows an authenticated user to find the analytics of a media.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Start Time

The oldest UTC timestamp within last one year. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

End Time

The oldest UTC timestamp within last one year within the 30 days time range. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

Media Analytics.fields

A comma separated list of MediaAnalytics fields to display.

Available options: cta_url_clicks,cta_watch_clicks,media_key,play_from_tap,playback25,playback50,playback75,playback_complete,playback_start,timestamp,video_views,watch_time_ms

Granularity

Specifies the granularity.

Available options:
hourly,daily,weekly,total

Media Keys

A comma separated list of Media Keys. Up to 100 are allowed in a single request.

The Media Key identifier for this attachment.

Response Type

N/A

GET Post Analytics

/2/tweets/analytics

Allows an authenticated user to find the analytics of a post.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Ids

The Post ID for which you are requesting the analytics

Start Time

The oldest UTC timestamp within last one year. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

End Time

The oldest UTC timestamp within last one year within the 30 days time range. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

Analytics.fields

Comma-separated list of fields for the analytics.

Allowed values:
app_install_attempts,app_opens,bookmarks,detail_expands,email_tweet,engagements,follows,hashtag_clicks,id,impressions,likes,media_views,permalink_clicks,quote_tweets,replies,retweets,shares,timestamp,unfollows,url_clicks,user_profile_clicks

Granularity

Specifies the granularity.

Available options:
hourly,daily,weekly,total

Response Type

N/A

Filtered Stream (3)

POST Delete Rules (by rule value)

/2/tweets/search/stream/rules

Delete filter rules. To delete one or more rules, submit a delete object payload with an array of rule values to delete.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

GET Retrieve Rules

/2/tweets/search/stream/rules

Returns a list of filter rules currently active on the streaming endpoint.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

GET Stream (see description)

/2/tweets/search/stream

Streams Posts in real-time based on a specific set of filter rules.

Please note streaming responses are currently not supported in Postman. Use this to help form your request, then click on Code > cURL. Copy the cURL command and paste in terminal to view the response.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,possibly_sensitive,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id

Default values: none

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,preview_image_url,public_metrics,type,url,width

Default values:
media_key,type

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id,options

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Backfill Minutes

Provide a whole number between 1 and 5.

This parameter enables the recovery of up to five minutes worth of data that may have been missed during a disconnection.

The backfilled Tweets will automatically flow through a reconnected stream, with older Tweets generally being delivered before any newly matching Tweets.
This feature will deliver all Tweets that matched your rules and were published during the timeframe selected, meaning that if you were disconnected for 90 seconds, and you requested two minutes of backfill, you will receive 30 seconds worth of duplicate Tweets. Due to this, you should make sure your system is tolerant of duplicate
data.

This feature is currently only available to the academic research product track.

Response Type

N/A

Follows (4)

POST Follow a user ID

/2/users/{id}/following

Allows a user ID to follow another user.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the user who wishes to follow an account. The ID must belong to the authenticating user.

In Postman, you can leave the id field empty to let the collection automatically populate it with the user ID of the user in the current environment.

Response Type

N/A

Options (1)

Option Name

Description

Target User Id

N/A

GET Followers of user ID

/2/users/{id}/followers

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

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single user ID.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld
Default values:
id,text
OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Max Results

The maximum number of results to be returned by a request.
Allowed values: 10 through 1000.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

DELETE Unfollow a user ID

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

Allows a user ID to unfollow another user.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Source User Id

The ID of the user who wishes to follow an account. The ID must belong to the authenticating user.

In Postman, you can leave the source_user_id field empty to let the collection automatically populate it with the user ID of the user in the current environment.

Target User Id

The ID of the user to unfollow.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

GET Users a user ID is following

/2/users/{id}/following

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

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single user ID.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,witheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld
Default values:
id,text
OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Max Results

The maximum number of results to be returned by a request.
Allowed values: 10 through 1000.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Hide Replies

PUT Unhide a reply

/2/tweets/{id}/hidden

Provides the ability to unhide a reply to a Post.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single Tweet ID.

Content-type

N/A

Response Type

N/A

Options (1)

Option Name

Description

Hidden

N/A

Likes (4)

POST Like a Post

/2/users/{id}/likes

Allows an authenticated user to like a Post.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the user who wishes to like a Post. The ID must belong to the authenticating user.

Response Type

N/A

Options (1)

Option Name

Description

Tweet Id

N/A

GET Liked Posts

/2/users/{id}/liked_tweets

Returns a list of Posts that have been liked by a specified user ID.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. User ID of the user to request liked Posts for.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Post object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Max Results

The maximum number of results to be returned by a request.
Allowed values: 5 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

GET Liking users

/2/tweets/{id}/liking_users

Returns a list of users who have liked a specified Post ID.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The Post ID of the Post to request liking users of.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Post object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld
Default values:
id,text
OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

DELETE Unlike a Post

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

Allows an authenticated user to unlike a Post.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the user who wishes to unlike a Post. The ID must belong to the authenticating user.

Tweet Id

The ID of the Post to be unliked

Response Type

N/A

List/List Posts

GET List Posts lookup

/2/lists/{id}/tweets

This endpoint returns all Posts from a List specified by the requested ID

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the List you wish to recieve Tweet details on.

Tweet.fields

Comma-separated list of fields for the Tweet object.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
author_id
Default value: none

User.fields

Comma-separated list of fields for the User object. Expansion required.
Allowed values:
created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values:
id,name,username

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

List/List follows (4)

POST Follow a list

/2/users/{id}/followed_lists

Allows the authenticated user to follow a specified List.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the authenticated user

Response Type

N/A

Options (1)

Option Name

Description

List Id

N/A

GET Follower lookup

/2/lists/{id}/followers

This endpoint returns follower details from the List specified by the requested ID

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the List you wish to recieve follower details on.

User.fields

Comma-separated list of fields for the User object.
Allowed values:
created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values:
id,name,username

Tweet.fields

Comma-separated list of fields for the Tweet object.
Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld
Default values:
id,text
OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

DELETE Unfollow a list

/2/users/{id}/followed_lists/{list_id}

Allows the authenticated user to unfollow a specified List.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the authenticated user

List Id

Required. The ID of the List you wish to unfollow

Response Type

N/A

GET User's followed Lists

/2/users/{id}/followed_lists

This endpoint returns details on Lists a user follows specified by the requested ID

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the user you wish to recieve details on which Lists they follow.

List.fields

Comma-separated fields for the List object.
Allowed values:
created_at, follower_count, member_count, private, description, owner_id
Default values:
id,name

User.fields

Comma-separated list of fields for the User object.
Expansion required.
Allowed values:
created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
owner_id
Default value: none

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

List/List lookup (2)

GET List by ID

/2/lists/{id}

This endpoint returns details about the List specified by the requested ID

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the List you wish to recieve details on.

List.fields

Comma-separated fields for the List object.
Allowed values:
created_at, follower_count, member_count, private, description, owner_id
Default values:
id,name

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
owner_id
Default value: none

User.fields

Comma-separated list of fields for the User object. Expansion required.
Allowed values:
created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values:
id,name,username

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

GET User owned Lists

/2/users/{id}/owned_lists

This endpoint returns details on user owned Lists specified by the requested ID

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the user you wish to recieve details on Lists they own.

List.fields

Comma-separated fields for the List object.
Allowed values:
created_at, follower_count, member_count, private, description, owner_id
Default values:
id,name

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
owner_id
Default value: none

User.fields

Comma-separated list of fields for the User object. Expansion required.
Allowed values:
created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values:
id,name,username

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

List/List members (4)

POST Add a member

/2/lists/{id}/members

Allows the authenticated user to add a member to a List they own.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the list you wish to add a member to - Authenticated user must own the list in order to add the member

Response Type

N/A

Options (1)

Option Name

Description

User Id

N/A

GET Members lookup

/2/lists/{id}/members

This endpoint returns member details from the List specified by the requested ID

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the List you wish to recieve member details on.

User.fields

Comma-separated list of fields for the User object.
Allowed values:
created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values:
id,name,username

Tweet.fields

Comma-separated list of fields for the Tweet object.
Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld
Default values:
id,text
OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

DELETE Remove a member

/2/lists/{id}/members/{user_id}

Allows the authenticated user to remove a member from a List they own.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the List you wish to remove a user from - the List must be owned by the authenticated user

User Id

Required. The ID of the user you wish to remove from the list

Response Type

N/A

GET User memberships

/2/users/{id}/list_memberships

This endpoint returns details on Lists a user is a member of specified by the requested ID

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the user you wish to recieve membership details on.

List.fields

Comma-separated fields for the List object.
Allowed values:
created_at, follower_count, member_count, private, description, owner_id
Default values:
id,name

User.fields

Comma-separated list of fields for the User object.
Expansion required.
Allowed values:
created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
owner_id
Default value: none

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

List/Manage Lists (3)

POST Create a list

/2/lists

Allows the authenticated user to create a new List.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (3)

Option Name

Description

Name

N/A

Description

N/A

Private

N/A

DELETE Delete a list

/2/lists/{id}

Allows the authenticated user to delete a list they own.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the List you wish to delete - the List must be owned by the authenticated user

Response Type

N/A

PUT Update a list

/2/lists/{id}

Allows the authenticated user to update a List they own.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the List you wish to update the metadata of - the List must be owned by the authenticated user

Response Type

N/A

Options (3)

Option Name

Description

Name

N/A

Description

N/A

Private

N/A

List/Pinned Lists (3)

POST Pin a list

/2/users/{id}/pinned_lists

Allows the authenticated user to pin a specified List.

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the authenticated user

Response Type

N/A

Options (1)

Option Name

Description

List Id

N/A

DELETE Unpin a list

/2/lists/{id}/pinned_lists/{list_id}

Allows the authenticated user to unpin a specified List.

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The ID of the authenticated user

List Id

Required. The ID of the List you wish to unpin

Response Type

N/A

GET User's pinned Lists

/2/users/{id}/pinned_lists

This endpoint returns details on a user's pinned Lists specified by the requested ID

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The user ID whose pinned Lists you would like to retrieve. The user’s ID must correspond to the user ID of the authenticating user, meaning that you must pass the Access Tokens associated with the user ID when authenticating your request.

List.fields

Comma-separated fields for the List object.
Allowed values:
created_at, follower_count, member_count, private, description, owner_id
Default values:
id,name

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
owner_id
Default value: none

User.fields

Comma-separated list of fields for the User object. Expansion required.
Allowed values:
created_at, description, entities, id, location, name, pinned_tweet_id, profile_image_url, protected, public_metrics, url, username, verified, withheld
Default values:
id,name,username

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

Manage Direct Messages (3)

POST Add DM to conversation

/2/dm_conversations/{dm_conversation_id}/messages

Creates a new message for a DM Conversation specified by DM Conversation ID.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Dm Conversation Id

The conversation ID that this message will be added to. Supports both one-to-one and group conversations.

Response Type

N/A

Options (1)

Option Name

Description

Text

N/A

POST New 1-1 DM message

/2/dm_conversations/with/{participant_id}/messages

Creates a new message for a DM Conversation with a participant user by ID.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Participant Id

The User ID of who is receiving this one-to-one Direct Message

Response Type

N/A

Options (1)

Option Name

Description

Text

N/A

POST New group DM and conversation

/2/dm_conversations/

Creates a new DM Conversation.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (2)

Option Name

Description

Conversation Type

N/A

Participant Ids

N/A

Manage Posts (2)

POST Create a Post

/2/tweets

Allows an authenticated user to create a Post.

You can add parameters to post polls, quote Posts, Post with reply settings, and Post to Super Followers in addition to other features.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (1)

Option Name

Description

Text

N/A

DELETE Delete a Post

/2/tweets/{id}

Allows an authenticated user to delete a Post.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

ID to of the Tweet you wish to delete

Response Type

N/A

Media/Metadata

POST Create Media Metadata

/2/media/metadata

Allows an authenticated user to add metadata to uploaded media.

You can use this endpoint to attach alt text to media. The media_id parameter specifies the media, while the alt_text contains the descriptive text.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (1)

Option Name

Description

Media Id

N/A

Media/Subtitles (2)

POST Create Media Subtitles

/2/media/subtitles

Allows an authenticated user to add subtitles to uploaded media.

You can use this endpoint to provide subtitles for media. The media_id parameter identifies the media, while additional parameters define the subtitle language and file content.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (2)

Option Name

Description

Media Id

N/A

Media Category

N/A

DELETE Delete Media Subtitles

/2/media/subtitles

Allows an authenticated user to delete subtitles from uploaded media.

You can use this endpoint to remove previously added subtitle information from media. The media_id parameter identifies the media, and specify other parameters to delete the subtitle.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (2)

Option Name

Description

Media Id

N/A

Media Category

N/A

Media/Upload (2)

GET Media Upload STATUS

/2/media/upload

Allows an authenticated user to check the processing status of uploaded media.

You can use this endpoint to monitor the status of video. The media_id parameter is from the the uploaded media, and the command=STATUS parameter retrieves information about whether the processing status is pending, in progress, or complete.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Media Id

Media id for the requested media upload status.

Command

The command for the media upload request.

Response Type

N/A

POST Upload Media

/2/media/upload

Allows an authenticated user to upload media.

You can use this endpoint to upload videos before attaching them to Tweets. The media_type parameter specifies the type of media, while the command parameter controls the upload process by initializing, appending and finalizing the upload.

For full details, see the API reference for this endpoint.

To get started, sign up for the X API.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Media Type

Specifies the MIME type of the media being uploaded

Command

command : Specifies the current step in the media upload process.
Allowed values: INIT, APPEND, FINALIZE, STATUS

Response Type

N/A

Options (1)

Option Name

Description

Media

N/A

Mutes (3)

POST Mute a user ID

/2/users/{id}/muting

Allows a user ID to mute another user.

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single user ID.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

GET Mutes lookup

/2/users/{id}/muting

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

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The user ID whose muted users you would like to retrieve. The user’s ID must correspond to the user ID of the authenticating user, meaning that you must pass the Access Tokens associated with the user ID when authenticating your request.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld
Default values:
id,text
OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 1000.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

Options (1)

Option Name

Description

Options

N/A

DELETE Unmute a user ID

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

Allows a user ID to unmute another user.

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Source User Id

The ID of the user who wishes to unmute an account. The ID must belong to the authenticating user.

In Postman, you can leave the source_user_id field empty to let the collection automatically populate it with the user ID of the user in the current environment.

Target User Id

The ID of the user to unmute.

Response Type

N/A

Post Counts (2)

GET Full-archive Post counts

/2/tweets/counts/all

Search across the complete history of public Posts matching a search query; since the first Post was created in March 2006.

For full details, see the API reference for this endpoint.

NOTE this endpoint requires access via the Academic Research product track

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Start Time

The oldest UTC timestamp from which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

End Time

The newest, most recent UTC timestamp to which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

Since Id

Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. The ID specified is exclusive and responses will not include it.

Until Id

Returns results with a Tweet ID less than (that is, older than) the specified ID. The ID specified is exclusive and responses will not include it.

Next Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Granularity

This is the granularity that you want the timeseries count data to be grouped by. Possible values are day, hour or minute. The default granularity, if not specified is hour.

Query

N/A

Response Type

N/A

GET Recent Post counts

/2/tweets/counts/recent

Search for public Posts created in the last 7 days.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Query

Required. Query for matching Tweets. Up to 512 characters.

Start Time

The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

End Time

The newest, most recent UTC timestamp to which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

Since Id

Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. The ID specified is exclusive and responses will not include it.

Until Id

Returns results with a Tweet ID less than (that is, older than) the specified ID. The ID specified is exclusive and responses will not include it.

Granularity

This is the granularity that you want the timeseries count data to be grouped by. Possible values are day, hour or minute. The default granularity, if not specified is hour.

Response Type

N/A

Post Lookup (2)

GET Multiple Posts

/2/tweets

This endpoint returns details about up to 100 Posts specified by the requested IDs.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Ids

Required. Enter up to 100 comma-separated Tweet IDs.

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id

Default values: none

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values:
media_key,type

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id, options

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Response Type

N/A

GET Single Post Usercontext

/2/tweets/{id}

This endpoint returns details about the Post specified by the requested ID.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single Tweet ID.

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id,edit_history_tweet_ids

Default values: none

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values:
media_key,type

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id, options

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Response Type

N/A

Quote Posts

GET Quote Posts by Post ID

/2/tweets/{id}/quote_tweets

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

For full details, see the API reference for this endpoint.

Sign up for the Twitter API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single user ID.

Max Results

Specifies the number of Tweets to try and retrieve, up to a maximum of 100 per distinct request.

Retweets and replies are included in the count, even if exclude=retweets,replies are supplied.

By default, 10 results are returned if this parameter is not supplied. The minimum permitted value is 5.

Start Time

YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z

End Time

YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z

Since Id

Returns results with an ID greater than (that is, more recent than) the specified ID. Only the 3200 most recent Tweets are available. The result will exclude the since_id. If the limit of Tweets has occurred since the since_id, the since_id will be forced to the oldest ID available.

Until Id

Returns results with an ID less less than (that is, older than) the specified ID. Only the 3200 most recent Tweets are available. The result will exclude the until_id. If the limit of Tweets has occurred since the until_id, the until_id will be forced to the most recent ID available.

Pagination Token

This parameter is used to move forwards or backwards through pages of results, based on the value of the next_token or previous_token in the response. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id,edit_history_tweet_ids

Default values: none

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values:
media_key,type

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id, options

Response Type

N/A

Reposts (3)

POST Repost a post

/2/users/{id}/retweets

Allows an authenticated user to Repost a post.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the user who wishes to Repost a Post. The ID must belong to the authenticating user.

Response Type

N/A

Options (1)

Option Name

Description

Tweet Id

N/A

GET Reposted by

/2/tweets/{id}/retweeted_by

Returns a list of users who have liked a specified Post ID.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The Post ID of the Post to request Reposting users of.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Max Results

The maximum number of results to be returned by a request.
Allowed values: 1 through 100.
Default value: 100

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Response Type

N/A

DELETE Undo a Repost

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

Allows an authenticated user to undo a Repost of a post.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the user who wishes to undo a Reweet. The ID must belong to the authenticating user.

Source Tweet Id

The ID of the Tweet to remove of Retweet of

Response Type

N/A

Sampled Stream

GET Stream (see description)

/2/tweets/sample/stream

Stream, in real-time, roughly a 1% sample of all public Posts.

Please note streaming responses are currently not supported in Postman. Use this to help form your request, then click on Code > cURL. Copy the cURL command and paste in terminal to view the response.

For full details, see the API reference for these endpoints.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,possibly_sensitive,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id,edit_history_tweet_ids

Default values: none

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,preview_image_url,public_metrics,type,url,width

Default values:
media_key,type

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id,options

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Backfill Minutes

Provide a whole number between 1 and 5.

This parameter enables the recovery of up to five minutes worth of data that may have been missed during a disconnection.

The backfilled Tweets will automatically flow through a reconnected stream, with older Tweets generally being delivered before any newly matching Tweets.
This feature will deliver all Tweets that matched your rules and were published during the timeframe selected, meaning that if you were disconnected for 90 seconds, and you requested two minutes of backfill, you will receive 30 seconds worth of duplicate Tweets. Due to this, you should make sure your system is tolerant of duplicate
data.

This feature is currently only available to the academic research product track.

Response Type

N/A

Search Posts (2)

GET Full-archive search

/2/tweets/search/all

Search across the complete history of public Posts matching a search query; since the first Post was created in March 2006.

For full details, see the API reference for this endpoint.

NOTE this endpoint requires access via the Academic Research product track

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Query

Required. Query for matching Tweets. Up to 1024 characters.

Start Time

The oldest UTC timestamp from which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

End Time

The newest, most recent UTC timestamp to which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

Since Id

Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. The ID specified is exclusive and responses will not include it.

Until Id

Returns results with a Tweet ID less than (that is, older than) the specified ID. The ID specified is exclusive and responses will not include it.

Max Results

The maximum number of search results to be returned by a request. A number between 10 and the system limit (currently 100). By default, a request response will return 10 results.

Next Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,possibly_sensitive,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id,edit_history_tweet_ids

Default values: none

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,preview_image_url,public_metrics,type,url,width

Default values:
media_key,type

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id, options

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Response Type

N/A

GET Recent search

/2/tweets/search/recent

Search for public Posts created in the last 7 days.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Query

Required. Query for matching Tweets. Up to 512 characters.

Start Time

The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

End Time

The newest, most recent UTC timestamp to which the Tweets will be provided. YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339).

Since Id

Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. The ID specified is exclusive and responses will not include it.

Until Id

Returns results with a Tweet ID less than (that is, older than) the specified ID. The ID specified is exclusive and responses will not include it.

Max Results

The maximum number of search results to be returned by a request. A number between 10 and the system limit (currently 100). By default, a request response will return 10 results.

Next Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id,edit_history_tweet_ids

Default values: none

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values:
media_key,type

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id, options

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Response Type

N/A

Spaces/Search Spaces

GET Search Spaces by title

/2/spaces/search

This endpoint returns Spaces matching the specified keyword query.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Query

Required. A search term. Can be a keyword, hashtag, or mention.

State

Return only Spaces with a specific running status.

Allowed values (specify only one of the following):
live,scheduled

Space.fields

Comma-separated list of fields from the Space object you want to return from your request.

Available fields:
host_ids,created_at,creator_id,id,lang,invited_user_ids, participant_count,speaker_ids,started_at,state,title,updated_at, scheduled_start,is_ticketed,ended_at,topic_ids

Default fields:
id,state

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Available values:
invited_user_ids,speaker_ids,creator_id,host_ids

User.fields

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Available values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Topic.fields

Comma-separated list of fields from the Space Topics object you want to return from your request
.
Available values:
id,name,description

Response Type

N/A

Spaces/Spaces lookup (4)

GET Lookup Spaces created by one or more users

/2/spaces/by/creator_id

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

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

User Ids

Required. A comma-separated list of user IDs. You can specify up 100 IDs in a single request.

Space.fields

Comma-separated list of fields from the Space object you want to return from your request.

Available fields:
host_ids,created_at,creator_id,id,lang,invited_user_ids, participant_count,speaker_ids,started_at,state,title,updated_at, scheduled_start,is_ticketed,ended_at,topic_ids

Default fields:
id,state

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Available values:
invited_user_ids,speaker_ids,creator_id,host_ids

User.fields

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Available values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name.username

Topic.fields

Comma-separated list of fields from the Space Topics object you want to return from your request.

Available values:
id,name,description

Response Type

N/A

GET Spaces lookup by list of IDs

/2/spaces

This endpoint returns information about one or more Spaces with the specified comma-separated list of IDs. You can request up to 100 Spaces in a single request

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Ids

Required. A comma separated list of IDs of the Spaces to lookup. You can specify up to 100 IDs.

Space.fields

Comma-separated list of fields from the Space object you want to return from your request.

Available fields:
host_ids,created_at,creator_id,id,lang,invited_user_ids, participant_count,speaker_ids,started_at,state,title,updated_at, scheduled_start,is_ticketed,ended_at,topic_ids

Default fields:
id,state

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Available values:
invited_user_ids,speaker_ids,creator_id,host_ids

User.fields

Comma-separated list of fields from the Space object you want to return from your request.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Topic.fields

Comma-separated list of fields from the Space Topics object you want to return from your request.

Available values:
id,name,description

Response Type

N/A

GET Spaces lookup by single ID

/2/spaces/{id}

This endpoint returns information about a single Space with the specified ID.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

The ID of the Spaces to lookup.

Space.fields

Comma-separated list of fields from the Space object you want to return from your request.

Available fields:
host_ids,created_at,creator_id,id,lang,invited_user_ids, participant_count,speaker_ids,started_at,state,title,updated_at, scheduled_start,is_ticketed,ended_at,topic_ids

Default fields:
id,state

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Available values:
invited_user_ids,speaker_ids,creator_id,host_ids

User.fields

Comma-separated list of fields from the Space object you want to return from your request.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Topic.fields

Comma-separated list of fields from the Space Topics object you want to return from your request.

Available values:
id,name,description

Response Type

N/A

GET Users who bought a ticket to a Space

/2/spaces/{id}/buyers

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

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. The user ID whose blocked users you would like to retrieve. The user’s ID must correspond to the user ID of the authenticating user, meaning that you must pass the Access Tokens associated with the user ID when authenticating your request.

User.fields

Comma-separated fields for the user object.
Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld
Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.
Allowed value:
pinned_tweet_id
Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.
Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld
Default values:
id,text
OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Pagination Token

This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

User.fields

Comma-separated fields for the user object.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed value:
pinned_tweet_id

Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld

Default values:
id,text

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Response Type

N/A

Timelines (3)

GET Reverse chronological home timeline by ID

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

Allows you to retrieve a collection of the most recent Posts and Reposts posted by you or a user you follow. This endpoint can return every Post created on a timeline over the last 7 days and the most recent 800 regardless of the creation date.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

N/A

Max Results

Specifies the number of Tweets to try and retrieve, up to a maximum of 100 per distinct request.

Retweets and replies are included in the count, even if exclude=retweets,replies are supplied.

By default, 10 results are returned if this parameter is not supplied. The minimum permitted value is 5.

Start Time

YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z

End Time

YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z

Since Id

Returns results with an ID greater than (that is, more recent than) the specified ID. Only the 3200 most recent Tweets are available. The result will exclude the since_id. If the limit of Tweets has occurred since the since_id, the since_id will be forced to the oldest ID available.

Until Id

Returns results with an ID less less than (that is, older than) the specified ID. Only the 3200 most recent Tweets are available. The result will exclude the until_id. If the limit of Tweets has occurred since the until_id, the until_id will be forced to the most recent ID available.

Pagination Token

This parameter is used to move forwards or backwards through pages of results, based on the value of the next_token or previous_token in the response. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id,edit_history_tweet_ids

Default values: none

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values:
media_key,type

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id, options

Response Type

N/A

GET User mention timeline by ID

/2/users/{id}/mentions

Allows you to retrieve a collection of the most recent Posts and Reposts posted by you or a user you follow. This endpoint returns up to the last 3200 Tweets.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single user ID.

Max Results

Specifies the number of Tweets to try and retrieve, up to a maximum of 100 per distinct request.

Retweets and replies are included in the count, even if exclude=retweets,replies are supplied.

By default, 10 results are returned if this parameter is not supplied. The minimum permitted value is 5.

Start Time

YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z

End Time

YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z

Since Id

Returns results with an ID greater than (that is, more recent than) the specified ID. Only the 3200 most recent Tweets are available. The result will exclude the since_id. If the limit of Tweets has occurred since the since_id, the since_id will be forced to the oldest ID available.

Until Id

Returns results with an ID less less than (that is, older than) the specified ID. Only the 3200 most recent Tweets are available. The result will exclude the until_id. If the limit of Tweets has occurred since the until_id, the until_id will be forced to the most recent ID available.

Pagination Token

This parameter is used to move forwards or backwards through pages of results, based on the value of the next_token or previous_token in the response. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id,edit_history_tweet_ids

Default values: none

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids

Default values:
id,text,edit_history_tweet_ids

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values:
media_key,type

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id, options

Response Type

N/A

GET User post timeline by ID

/2/users/{id}/tweets

Returns the most recent Posts composed by a single user specified by the requested user ID.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single user ID.

Max Results

Specifies the number of Tweets to try and retrieve, up to a maximum of 100 per distinct request.

Retweets and replies are included in the count, even if exclude=retweets,replies are supplied.

By default, 10 results are returned if this parameter is not supplied. The minimum permitted value is 5.

Start Time

YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z

End Time

YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest UTC timestamp from which the Tweets will be provided. Only the 3200 most recent Tweets are available. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). Minimum allowable time is 2010-11-06T00:00:00Z

Since Id

Returns results with an ID greater than (that is, more recent than) the specified ID. Only the 3200 most recent Tweets are available. The result will exclude the since_id. If the limit of Tweets has occurred since the since_id, the since_id will be forced to the oldest ID available.

Until Id

Returns results with an ID less less than (that is, older than) the specified ID. Only the 3200 most recent Tweets are available. The result will exclude the until_id. If the limit of Tweets has occurred since the until_id, the until_id will be forced to the most recent ID available.

Pagination Token

This parameter is used to move forwards or backwards through pages of results, based on the value of the next_token or previous_token in the response. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.

Expansions

Comma-separated list of fields to expand. Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed values: attachments.poll_ids,attachments.media_keys,author_id,geo.place_id,in_reply_to_user_id,referenced_tweets.id,entities.mentions.username,referenced_tweets.id.author_id,edit_history_tweet_ids

Default values: none

Tweet.fields

Comma-separated list of fields for the Tweet object.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld,edit_history_tweet_ids,edit_controls

Default values:
id,text,edit_history_tweet_ids

User.fields

Comma-separated list of fields for the user object. Expansion required.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Media.fields

Comma-separated list of fields for the media object. Expansion required.

Allowed values:
duration_ms,height,media_key,non_public_metrics,organic_metrics,preview_image_url,promoted_metrics,public_metrics,type,url,width

Default values:
media_key,type

Place.fields

Comma-separated list of fields for the place object. Expansion required.

Allowed values:
contained_within,country,country_code,full_name,geo,id,name,place_type

Default values:
id,full_name

Poll.fields

Comma-separated list of fields for the poll object. Expansion required.

Allowed values:
duration_minutes,end_datetime,id,options,voting_status

Default values:
id, options

Response Type

N/A

Usage Posts

GET Get Posts Usage

/2/usage/tweets

Returns the Posts usage at a project and client app level

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Usage.fields

Comma-separated list of fields for the usage object.
Allowed values:
cap_reset_day,daily_client_app_usage,daily_project_usage,project_cap,project_id,project_usage

Default values:
cap_reset_day,project_cap,project_id,project_usage

Days

Number of days for which you want the usage for

Response Type

N/A

User Lookup (5)

GET Authenticated User Lookup

/2/me

This endpoint returns the information about an authorized user.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

User.fields

Comma-separated fields for the user object.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed value:
pinned_tweet_id

Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld

Default values:
id,text

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Response Type

N/A

GET User by ID

/2/users/{id}

This endpoint returns details about a user by ID.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Id

Required. Enter a single user ID.

User.fields

Comma-separated fields for the user object.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed value:
pinned_tweet_id

Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld

Default values:
id,text

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Response Type

N/A

GET User by Username

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

This endpoint returns details about a user by username.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Username

Required. Enter a single Twitter username (handle).

User.fields

Comma-separated fields for the user object.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed value:
pinned_tweet_id

Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,source,text,withheld

Default values:
id,text

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Response Type

N/A

GET Users by ID

/2/users

This endpoint returns details about up to 100 users by ID.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Ids

Required. Enter up to 100 comma-separated user IDs.

User.fields

Comma-separated fields for the user object.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed value:
pinned_tweet_id

Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld

Default values:
id,text

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Response Type

N/A

GET Users by Username

/2/users/by

This endpoint returns details about up to 100 users specified by username.

For full details, see the API reference for this endpoint.

Sign up for the X API

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Usernames

Required. Enter up to 100 comma-separated usernames.

User.fields

Comma-separated fields for the user object.

Allowed values:
created_at,description,entities,id,location,name,pinned_tweet_id,profile_image_url,protected,public_metrics,url,username,verified,withheld

Default values:
id,name,username

Expansions

Expansions enable requests to expand an ID into a full object in the includes response object.

Allowed value:
pinned_tweet_id

Default value: none

Tweet.fields

Comma-separated list of fields for the Tweet object. Expansion required.

Allowed values:
attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,non_public_metrics,organic_metrics,possibly_sensitive,promoted_metrics,public_metrics,referenced_tweets,reply_settings,source,text,withheld

Default values:
id,text

OAuth1.0a User Context authorization required if any of the following fields are included in the request:
non_public_metrics,organic_metrics,promoted_metrics

Response Type

N/A