Twitter API v2

Social media platform API

developer.x.com/en/docs/twitter-api ↗
Version
2.62
OpenAPI
3.0.0
Endpoints
80
Schemas
228
91
Quality
Updated
3 days ago
Social social media messaging
Use this API in your AI agent

Query structured spec data via REST or MCP. Get exactly what your agent needs.

Get API Key

Server URLs

https://api.twitter.com

Endpoints

Clear filters

Bookmarks 1 endpoints

GET /2/users/{id}/bookmarks

Returns Tweet objects that have been bookmarked by the requesting User

operationId: Bookmarks_getUserBookmarks

Parameters

Name In Required Type Description
id path required

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

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/bookmarks

Compliance 5 endpoints

GET /2/compliance/jobs

Returns recent Compliance Jobs for a given job type and optional job status

operationId: Compliance_listJobs

Parameters

Name In Required Type Description
type query required string

Type of Compliance Job to list.

status query optional string

Status of Compliance Job to list.

compliance_job.fields query optional array

A comma separated list of ComplianceJob fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/compliance/jobs
GET /2/compliance/jobs/{id}

Returns a single Compliance Job by ID

operationId: Compliance_getJobById

Parameters

Name In Required Type Description
id path required

The ID of the Compliance Job to retrieve.

compliance_job.fields query optional array

A comma separated list of ComplianceJob fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/compliance/jobs/{id}
GET /2/tweets/compliance/stream

Streams 100% of compliance data for Tweets

operationId: Compliance_streamData

Parameters

Name In Required Type Description
backfill_minutes query optional integer

The number of minutes of backfill requested.

partition query required integer

The partition number.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet Compliance events will be provided.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweet Compliance events will be provided.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/compliance/stream
GET /2/tweets/label/stream

Streams 100% of labeling events applied to Tweets

operationId: Compliance_streamTweetsLabelEvents

Parameters

Name In Required Type Description
backfill_minutes query optional integer

The number of minutes of backfill requested.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet labels will be provided.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Tweet labels will be provided.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/label/stream
GET /2/users/compliance/stream

Streams 100% of compliance data for Users

operationId: Compliance_streamUsersData

Parameters

Name In Required Type Description
backfill_minutes query optional integer

The number of minutes of backfill requested.

partition query required integer

The partition number.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/compliance/stream

Directmessages 3 endpoints

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

Returns DM Events for a DM Conversation

operationId: DirectMessages_getDmEvents

Parameters

Name In Required Type Description
participant_id path required

The ID of the participant user for the One to One DM conversation.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

event_types query optional array

The set of event_types to include in the results.

dm_event.fields query optional array

A comma separated list of DmEvent fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

user.fields query optional array

A comma separated list of User fields to display.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

Returns DM Events for a DM Conversation

operationId: DirectMessages_getDmEvents

Parameters

Name In Required Type Description
id path required

The DM Conversation ID.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

event_types query optional array

The set of event_types to include in the results.

dm_event.fields query optional array

A comma separated list of DmEvent fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

user.fields query optional array

A comma separated list of User fields to display.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/dm_conversations/{id}/dm_events
GET /2/dm_events

Returns recent DM Events across DM conversations

operationId: DirectMessages_getRecentDmEvents

Parameters

Name In Required Type Description
max_results query optional integer

The maximum number of results.

pagination_token query optional

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

event_types query optional array

The set of event_types to include in the results.

dm_event.fields query optional array

A comma separated list of DmEvent fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

user.fields query optional array

A comma separated list of User fields to display.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/dm_events

General 1 endpoints

GET /2/openapi.json

Full OpenAPI Specification in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md)

operationId: General_getOpenApiSpec

Responses

200

The request was successful

GET /2/openapi.json

Lists 5 endpoints

GET /2/lists/{id}

Returns a List.

operationId: Lists_lookupByListId

Parameters

Name In Required Type Description
id path required

The ID of the List.

list.fields query optional array

A comma separated list of List fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/lists/{id}
GET /2/users/{id}/followed_lists

Returns a User’s followed Lists.

operationId: Lists_getFollowed

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

list.fields query optional array

A comma separated list of List fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/followed_lists
GET /2/users/{id}/list_memberships

Get a User’s List Memberships.

operationId: Lists_getUserMemberships

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

list.fields query optional array

A comma separated list of List fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/list_memberships
GET /2/users/{id}/owned_lists

Get a User’s Owned Lists.

operationId: Lists_getUserOwnedLists

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

list.fields query optional array

A comma separated list of List fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/owned_lists
GET /2/users/{id}/pinned_lists

Get a User’s Pinned Lists.

operationId: Lists_getUserPinnedLists

Parameters

Name In Required Type Description
id path required

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

list.fields query optional array

A comma separated list of List fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/pinned_lists

Spaces 6 endpoints

GET /2/spaces

Returns a variety of information about the Spaces specified by the requested IDs

operationId: Spaces_lookupSpaceIds

Parameters

Name In Required Type Description
ids query required array

The list of Space IDs to return.

space.fields query optional array

A comma separated list of Space fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

topic.fields query optional array

A comma separated list of Topic fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/spaces
GET /2/spaces/by/creator_ids

Returns a variety of information about the Spaces created by the provided User IDs

operationId: Spaces_lookupByCreatorIds

Parameters

Name In Required Type Description
user_ids query required array

The IDs of Users to search through.

space.fields query optional array

A comma separated list of Space fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

topic.fields query optional array

A comma separated list of Topic fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/spaces/by/creator_ids
GET /2/spaces/search

Returns Spaces that match the provided query.

operationId: Spaces_findMatchingSpaces

Parameters

Name In Required Type Description
query query required string

The search query.

state query optional string

The state of Spaces to search for.

max_results query optional integer

The number of results to return.

space.fields query optional array

A comma separated list of Space fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

topic.fields query optional array

A comma separated list of Topic fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/spaces/search
GET /2/spaces/{id}

Returns a variety of information about the Space specified by the requested ID

operationId: Spaces_lookupSpaceById

Parameters

Name In Required Type Description
id path required string

The ID of the Space to be retrieved.

space.fields query optional array

A comma separated list of Space fields to display.

expansions query optional array

A comma separated list of fields to expand.

user.fields query optional array

A comma separated list of User fields to display.

topic.fields query optional array

A comma separated list of Topic fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/spaces/{id}
GET /2/spaces/{id}/buyers

Retrieves the list of Users who purchased a ticket to the given space

operationId: Spaces_getBuyersList

Parameters

Name In Required Type Description
id path required string

The ID of the Space to be retrieved.

pagination_token query optional

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

max_results query optional integer

The maximum number of results.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/spaces/{id}/buyers
GET /2/spaces/{id}/tweets

Retrieves Tweets shared in the specified Space.

operationId: Spaces_getTweets

Parameters

Name In Required Type Description
id path required string

The ID of the Space to be retrieved.

max_results query optional integer

The number of Tweets to fetch from the provided space. If not provided, the value will default to the maximum of 100.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/spaces/{id}/tweets

Tweets 17 endpoints

GET /2/lists/{id}/tweets

Returns a list of Tweets associated with the provided List ID.

operationId: Tweets_listByListId

Parameters

Name In Required Type Description
id path required

The ID of the List.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Tweets_lookupByTweetIds

Parameters

Name In Required Type Description
ids query required array

A comma separated list of Tweet IDs. Up to 100 are allowed in a single request.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets
GET /2/tweets/counts/all

Returns Tweet Counts that match a search query.

operationId: Tweets_getTweetCounts

Parameters

Name In Required Type Description
query query required string

One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).

since_id query optional

Returns results with a Tweet ID greater than (that is, more recent than) the specified ID.

until_id query optional

Returns results with a Tweet ID less than (that is, older than) the specified ID.

next_token query optional

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.

pagination_token query optional

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 query optional string

The granularity for the search counts results.

search_count.fields query optional array

A comma separated list of SearchCount fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/counts/all
GET /2/tweets/counts/recent

Returns Tweet Counts from the last 7 days that match a search query.

operationId: Tweets_getRecentTweetCounts

Parameters

Name In Required Type Description
query query required string

One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).

since_id query optional

Returns results with a Tweet ID greater than (that is, more recent than) the specified ID.

until_id query optional

Returns results with a Tweet ID less than (that is, older than) the specified ID.

next_token query optional

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.

pagination_token query optional

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 query optional string

The granularity for the search counts results.

search_count.fields query optional array

A comma separated list of SearchCount fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/counts/recent
GET /2/tweets/firehose/stream

Streams 100% of public Tweets.

operationId: Tweets_getFirehoseStream

Parameters

Name In Required Type Description
backfill_minutes query optional integer

The number of minutes of backfill requested.

partition query required integer

The partition number.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/firehose/stream
GET /2/tweets/sample/stream

Streams a deterministic 1% of public Tweets.

operationId: Tweets_streamSample

Parameters

Name In Required Type Description
backfill_minutes query optional integer

The number of minutes of backfill requested.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/sample/stream
GET /2/tweets/sample10/stream

Streams a deterministic 10% of public Tweets.

operationId: Tweets_streamSample10

Parameters

Name In Required Type Description
backfill_minutes query optional integer

The number of minutes of backfill requested.

partition query required integer

The partition number.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/sample10/stream
GET /2/tweets/search/all

Returns Tweets that match a search query.

operationId: Tweets_searchAll

Parameters

Name In Required Type Description
query query required string

One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).

since_id query optional

Returns results with a Tweet ID greater than (that is, more recent than) the specified ID.

until_id query optional

Returns results with a Tweet ID less than (that is, older than) the specified ID.

max_results query optional integer

The maximum number of search results to be returned by a request.

next_token query optional

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.

pagination_token query optional

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.

sort_order query optional string

This order in which to return results.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/search/all
GET /2/tweets/search/recent

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

operationId: Tweets_getRecentTweets

Parameters

Name In Required Type Description
query query required string

One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).

since_id query optional

Returns results with a Tweet ID greater than (that is, more recent than) the specified ID.

until_id query optional

Returns results with a Tweet ID less than (that is, older than) the specified ID.

max_results query optional integer

The maximum number of search results to be returned by a request.

next_token query optional

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.

pagination_token query optional

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.

sort_order query optional string

This order in which to return results.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/search/recent
GET /2/tweets/search/stream

Streams Tweets matching the stream’s active rule set.

operationId: Tweets_getFilteredStream

Parameters

Name In Required Type Description
backfill_minutes query optional integer

The number of minutes of backfill requested.

start_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided.

end_time query optional string

YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/search/stream
GET /2/tweets/search/stream/rules

Returns rules from a User’s active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids.

operationId: Tweets_searchStreamRules

Parameters

Name In Required Type Description
ids query optional array

A comma-separated list of Rule IDs.

max_results query optional integer

The maximum number of results.

pagination_token query optional string

This value is populated by passing the ‘next_token’ returned in a request to paginate through results.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/tweets/search/stream/rules
GET /2/tweets/{id}

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

operationId: Tweets_lookupById

Parameters

Name In Required Type Description
id path required

A single Tweet ID.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Tweets_getQuoteTweets

Parameters

Name In Required Type Description
id path required

A single Tweet ID.

max_results query optional integer

The maximum number of results to be returned.

pagination_token query optional

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

exclude query optional array

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

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

Returns a list of Tweets liked by the provided User ID

operationId: Tweets_getLikedTweets

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/liked_tweets
GET /2/users/{id}/mentions

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

operationId: Tweets_getMentionsById

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

since_id query optional

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

until_id query optional

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

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

start_time query optional string

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

end_time query optional string

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

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Tweets_getUserHomeTimeline

Parameters

Name In Required Type Description
id path required

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

since_id query optional

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

until_id query optional

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

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

exclude query optional array

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

start_time query optional string

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

end_time query optional string

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

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

Returns a list of Tweets authored by the provided User ID

operationId: Tweets_listByUserId

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

since_id query optional

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

until_id query optional

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

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

exclude query optional array

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

start_time query optional string

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

end_time query optional string

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

tweet.fields query optional array

A comma separated list of Tweet fields to display.

expansions query optional array

A comma separated list of fields to expand.

media.fields query optional array

A comma separated list of Media fields to display.

poll.fields query optional array

A comma separated list of Poll fields to display.

user.fields query optional array

A comma separated list of User fields to display.

place.fields query optional array

A comma separated list of Place fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/tweets

Users 13 endpoints

GET /2/lists/{id}/followers

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

operationId: Users_getFollowersByListId

Parameters

Name In Required Type Description
id path required

The ID of the List.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_getMembersByListId

Parameters

Name In Required Type Description
id path required

The ID of the List.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_listLikingUsers

Parameters

Name In Required Type Description
id path required

A single Tweet ID.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_getRetweetedByTweetIdUsers

Parameters

Name In Required Type Description
id path required

A single Tweet ID.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_lookupByIds

Parameters

Name In Required Type Description
ids query required array

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_lookupByUsernames

Parameters

Name In Required Type Description
usernames query required array

A list of usernames, comma-separated.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_lookupByUsername

Parameters

Name In Required Type Description
username path required string

A username.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

This endpoint returns information about the requesting User.

operationId: Users_lookupMe

Parameters

Name In Required Type Description
user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_lookupById

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_getBlockedUsers

Parameters

Name In Required Type Description
id path required

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

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_getFollowersById

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_getFollowingUsers

Parameters

Name In Required Type Description
id path required

The ID of the User to lookup.

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

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

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

operationId: Users_getMutedUsersById

Parameters

Name In Required Type Description
id path required

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

max_results query optional integer

The maximum number of results.

pagination_token query optional

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

user.fields query optional array

A comma separated list of User fields to display.

expansions query optional array

A comma separated list of fields to expand.

tweet.fields query optional array

A comma separated list of Tweet fields to display.

Responses

default

The request has failed.

200

The request has succeeded.

GET /2/users/{id}/muting

Schemas

object AddOrDeleteRulesRequest
{
  "oneOf": [
    {
      "$ref": "#/components/schemas/AddRulesRequest"
    },
    {
      "$ref": "#/components/schemas/DeleteRulesRequest"
    }
  ]
}
object AddOrDeleteRulesResponse
{
  "type": "object",
  "required": [
    "meta"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Rule"
      },
      "description": "All user-specified stream filtering rules that were created."
    },
    "meta": {
      "$ref": "#/components/schemas/RulesResponseMetadata"
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Problem"
      },
      "minItems": 1
    }
  },
  "description": "A response from modifying user-specified stream filtering rules."
}
object AddRulesRequest
{
  "type": "object",
  "required": [
    "add"
  ],
  "properties": {
    "add": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/RuleNoId"
      }
    }
  },
  "description": "A request to add a user-specified stream filtering rule."
}
integer Aggregate
{
  "type": "integer",
  "format": "int32",
  "description": "The sum of results returned in this response."
}
object AnimatedGif
{
  "allOf": [
    {
      "$ref": "#/components/schemas/Media"
    },
    {
      "type": "object",
      "properties": {
        "variants": {
          "$ref": "#/components/schemas/Variants"
        },
        "preview_image_url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  ]
}
object BlockUserMutationResponse
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "blocking": {
          "type": "boolean"
        }
      }
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Problem"
      },
      "minItems": 1
    }
  }
}
object BlockUserRequest
{
  "type": "object",
  "required": [
    "target_user_id"
  ],
  "properties": {
    "target_user_id": {
      "$ref": "#/components/schemas/UserId"
    }
  }
}
object BookmarkAddRequest
{
  "type": "object",
  "required": [
    "tweet_id"
  ],
  "properties": {
    "tweet_id": {
      "$ref": "#/components/schemas/TweetId"
    }
  }
}
object BookmarkMutationResponse
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "bookmarked": {
          "type": "boolean"
        }
      }
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Problem"
      },
      "minItems": 1
    }
  }
}
object CashtagEntity
{
  "allOf": [
    {
      "$ref": "#/components/schemas/EntityIndicesInclusiveExclusive"
    },
    {
      "$ref": "#/components/schemas/CashtagFields"
    }
  ]
}
object CashtagFields
{
  "type": "object",
  "required": [
    "tag"
  ],
  "properties": {
    "tag": {
      "type": "string",
      "example": "TWTR"
    }
  },
  "description": "Represent the portion of text recognized as a Cashtag, and its start and end position within the text."
}
object ClientForbiddenProblem
{
  "allOf": [
    {
      "$ref": "#/components/schemas/Problem"
    },
    {
      "type": "object",
      "properties": {
        "reason": {
          "enum": [
            "official-client-forbidden",
            "client-not-enrolled"
          ],
          "type": "string"
        },
        "registration_url": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  ],
  "description": "A problem that indicates your client is forbidden from making this request."
}
object ComplianceJob
{
  "type": "object",
  "required": [
    "id",
    "type",
    "created_at",
    "upload_url",
    "download_url",
    "upload_expires_at",
    "download_expires_at",
    "status"
  ],
  "properties": {
    "id": {
      "$ref": "#/components/schemas/JobId"
    },
    "name": {
      "$ref": "#/components/schemas/ComplianceJobName"
    },
    "type": {
      "$ref": "#/components/schemas/ComplianceJobType"
    },
    "status": {
      "$ref": "#/components/schemas/ComplianceJobStatus"
    },
    "created_at": {
      "$ref": "#/components/schemas/CreatedAt"
    },
    "upload_url": {
      "$ref": "#/components/schemas/UploadUrl"
    },
    "download_url": {
      "$ref": "#/components/schemas/DownloadUrl"
    },
    "upload_expires_at": {
      "$ref": "#/components/schemas/UploadExpiration"
    },
    "download_expires_at": {
      "$ref": "#/components/schemas/DownloadExpiration"
    }
  }
}
string ComplianceJobName
{
  "type": "string",
  "example": "my-job",
  "maxLength": 64,
  "description": "User-provided name for a compliance job."
}
string ComplianceJobStatus
{
  "enum": [
    "created",
    "in_progress",
    "failed",
    "complete",
    "expired"
  ],
  "type": "string",
  "description": "Status of a compliance job."
}
string ComplianceJobType
{
  "enum": [
    "tweets",
    "users"
  ],
  "type": "string",
  "description": "Type of compliance job to list."
}
object ConnectionExceptionProblem
{
  "allOf": [
    {
      "$ref": "#/components/schemas/Problem"
    },
    {
      "type": "object",
      "properties": {
        "connection_issue": {
          "enum": [
            "TooManyConnections",
            "ProvisioningSubscription",
            "RuleConfigurationIssue",
            "RulesInvalidIssue"
          ],
          "type": "string"
        }
      }
    }
  ],
  "description": "A problem that indicates something is wrong with the connection."
}
object ContextAnnotation
{
  "type": "object",
  "required": [
    "domain",
    "entity"
  ],
  "properties": {
    "domain": {
      "$ref": "#/components/schemas/ContextAnnotationDomainFields"
    },
    "entity": {
      "$ref": "#/components/schemas/ContextAnnotationEntityFields"
    }
  },
  "description": "Annotation inferred from the Tweet text."
}
object ContextAnnotationDomainFields
{
  "type": "object",
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[0-9]{1,19}$",
      "description": "The unique id for a context annotation domain."
    },
    "name": {
      "type": "string",
      "description": "Name of the context annotation domain."
    },
    "description": {
      "type": "string",
      "description": "Description of the context annotation domain."
    }
  },
  "description": "Represents the data for the context annotation domain."
}
object ContextAnnotationEntityFields
{
  "type": "object",
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[0-9]{1,19}$",
      "description": "The unique id for a context annotation entity."
    },
    "name": {
      "type": "string",
      "description": "Name of the context annotation entity."
    },
    "description": {
      "type": "string",
      "description": "Description of the context annotation entity."
    }
  },
  "description": "Represents the data for the context annotation entity."
}
string CountryCode
{
  "type": "string",
  "example": "US",
  "pattern": "^[A-Z]{2}$",
  "description": "A two-letter ISO 3166-1 alpha-2 country code."
}
object CreateAttachmentsMessageRequest
{
  "type": "object",
  "required": [
    "attachments"
  ],
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "description": "Text of the message."
    },
    "attachments": {
      "$ref": "#/components/schemas/DmAttachments"
    }
  }
}
object CreateComplianceJobRequest
{
  "type": "object",
  "required": [
    "type"
  ],
  "properties": {
    "name": {
      "$ref": "#/components/schemas/ComplianceJobName"
    },
    "type": {
      "enum": [
        "tweets",
        "users"
      ],
      "type": "string",
      "description": "Type of compliance job to list."
    },
    "resumable": {
      "type": "boolean",
      "description": "If true, this endpoint will return a pre-signed URL with resumable uploads enabled."
    }
  },
  "description": "A request to create a new batch compliance job."
}
object CreateComplianceJobResponse
{
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/components/schemas/ComplianceJob"
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Problem"
      },
      "minItems": 1
    }
  }
}
object CreateDmConversationRequest
{
  "type": "object",
  "required": [
    "conversation_type",
    "participant_ids",
    "message"
  ],
  "properties": {
    "message": {
      "$ref": "#/components/schemas/CreateMessageRequest"
    },
    "participant_ids": {
      "$ref": "#/components/schemas/DmParticipants"
    },
    "conversation_type": {
      "enum": [
        "Group"
      ],
      "type": "string",
      "description": "The conversation type that is being created."
    }
  }
}
object CreateDmEventResponse
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "dm_conversation_id",
        "dm_event_id"
      ],
      "properties": {
        "dm_event_id": {
          "$ref": "#/components/schemas/DmEventId"
        },
        "dm_conversation_id": {
          "$ref": "#/components/schemas/DmConversationId"
        }
      }
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Problem"
      },
      "minItems": 1
    }
  }
}
object CreateMessageRequest
{
  "anyOf": [
    {
      "$ref": "#/components/schemas/CreateTextMessageRequest"
    },
    {
      "$ref": "#/components/schemas/CreateAttachmentsMessageRequest"
    }
  ]
}
object CreateTextMessageRequest
{
  "type": "object",
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "description": "Text of the message."
    },
    "attachments": {
      "$ref": "#/components/schemas/DmAttachments"
    }
  }
}
string CreatedAt
{
  "type": "string",
  "format": "date-time",
  "example": "2021-01-06T18:40:40.000Z",
  "description": "Creation time of the compliance job."
}
object DeleteRulesRequest
{
  "type": "object",
  "required": [
    "delete"
  ],
  "properties": {
    "delete": {
      "type": "object",
      "properties": {
        "ids": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/RuleId"
          },
          "description": "IDs of all deleted user-specified stream filtering rules."
        },
        "values": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/RuleValue"
          },
          "description": "Values of all deleted user-specified stream filtering rules."
        }
      },
      "description": "IDs and values of all deleted user-specified stream filtering rules."
    }
  },
  "description": "A response from deleting user-specified stream filtering rules."
}
object DisallowedResourceProblem
{
  "allOf": [
    {
      "$ref": "#/components/schemas/Problem"
    },
    {
      "type": "object",
      "required": [
        "resource_id",
        "resource_type",
        "section"
      ],
      "properties": {
        "section": {
          "enum": [
            "data",
            "includes"
          ],
          "type": "string"
        },
        "resource_id": {
          "type": "string"
        },
        "resource_type": {
          "enum": [
            "user",
            "tweet",
            "media",
            "list",
            "space"
          ],
          "type": "string"
        }
      }
    }
  ],
  "description": "A problem that indicates that the resource requested violates the precepts of this API."
}
array DmAttachments
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/DmMediaAttachment"
  },
  "description": "Attachments to a DM Event."
}
string DmConversationId
{
  "type": "string",
  "example": "123123123-456456456",
  "pattern": "^([0-9]{1,19}-[0-9]{1,19}|[0-9]{15,19})$",
  "description": "Unique identifier of a DM conversation. This can either be a numeric string, or a pair of numeric strings separated by a '-' character in the case of one-on-one DM Conversations."
}
object DmEvent
{
  "type": "object",
  "required": [
    "id",
    "event_type"
  ],
  "properties": {
    "id": {
      "$ref": "#/components/schemas/DmEventId"
    },
    "text": {
      "type": "string"
    },
    "sender_id": {
      "$ref": "#/components/schemas/UserId"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "event_type": {
      "type": "string",
      "example": "MessageCreate"
    },
    "attachments": {
      "type": "object",
      "properties": {
        "card_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "A list of card IDs (if cards are attached)."
        },
        "media_keys": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/MediaKey"
          },
          "minItems": 1,
          "description": "A list of Media Keys for each one of the media attachments (if media are attached)."
        }
      },
      "description": "Specifies the type of attachments (if any) present in this DM."
    },
    "participant_ids": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/UserId"
      },
      "minItems": 1,
      "description": "A list of participants for a ParticipantsJoin or ParticipantsLeave event_type."
    },
    "referenced_tweets": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TweetId"
          }
        }
      },
      "minItems": 1,
      "description": "A list of Tweets this DM refers to."
    },
    "dm_conversation_id": {
      "$ref": "#/components/schemas/DmConversationId"
    }
  }
}
string DmEventId
{
  "type": "string",
  "example": "1146654567674912769",
  "pattern": "^[0-9]{1,19}$",
  "description": "Unique identifier of a DM Event."
}
object DmMediaAttachment
{
  "type": "object",
  "required": [
    "media_id"
  ],
  "properties": {
    "media_id": {
      "$ref": "#/components/schemas/MediaId"
    }
  }
}
array DmParticipants
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/UserId"
  },
  "maxItems": 49,
  "minItems": 2,
  "description": "Participants for the DM Conversation."
}
string DownloadExpiration
{
  "type": "string",
  "format": "date-time",
  "example": "2021-01-06T18:40:40.000Z",
  "description": "Expiration time of the download URL."
}
string DownloadUrl
{
  "type": "string",
  "format": "uri",
  "description": "URL from which the user will retrieve their compliance results."
}
object DuplicateRuleProblem
{
  "allOf": [
    {
      "$ref": "#/components/schemas/Problem"
    },
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    }
  ],
  "description": "The rule you have submitted is a duplicate."
}
string End
{
  "type": "string",
  "format": "date-time",
  "description": "The end time of the bucket."
}
object EntityIndicesInclusiveExclusive
{
  "type": "object",
  "required": [
    "start",
    "end"
  ],
  "properties": {
    "end": {
      "type": "integer",
      "example": 61,
      "minimum": 0,
      "description": "Index (zero-based) at which position this entity ends.  The index is exclusive."
    },
    "start": {
      "type": "integer",
      "example": 50,
      "minimum": 0,
      "description": "Index (zero-based) at which position this entity starts.  The index is inclusive."
    }
  },
  "description": "Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`.  The start index is inclusive, the end index is exclusive."
}
object EntityIndicesInclusiveInclusive
{
  "type": "object",
  "required": [
    "start",
    "end"
  ],
  "properties": {
    "end": {
      "type": "integer",
      "example": 61,
      "minimum": 0,
      "description": "Index (zero-based) at which position this entity ends.  The index is inclusive."
    },
    "start": {
      "type": "integer",
      "example": 50,
      "minimum": 0,
      "description": "Index (zero-based) at which position this entity starts.  The index is inclusive."
    }
  },
  "description": "Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`.  The start index is inclusive, the end index is inclusive."
}
object Error
{
  "type": "object",
  "required": [
    "code",
    "message"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "format": "int32"
    },
    "message": {
      "type": "string"
    }
  }
}
object Expansions
{
  "type": "object",
  "properties": {
    "media": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Media"
      },
      "minItems": 1
    },
    "polls": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Poll"
      },
      "minItems": 1
    },
    "users": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/User"
      },
      "minItems": 1
    },
    "places": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Place"
      },
      "minItems": 1
    },
    "topics": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Topic"
      },
      "minItems": 1
    },
    "tweets": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Tweet"
      },
      "minItems": 1
    }
  }
}
object FieldUnauthorizedProblem
{
  "allOf": [
    {
      "$ref": "#/components/schemas/Problem"
    },
    {
      "type": "object",
      "required": [
        "resource_type",
        "field",
        "section"
      ],
      "properties": {
        "field": {
          "type": "string"
        },
        "section": {
          "enum": [
            "data",
            "includes"
          ],
          "type": "string"
        },
        "resource_type": {
          "enum": [
            "user",
            "tweet",
            "media",
            "list",
            "space"
          ],
          "type": "string"
        }
      }
    }
  ],
  "description": "A problem that indicates that you are not allowed to see a particular field on a Tweet, User, etc."
}
object FilteredStreamingTweetResponse
{
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/components/schemas/Tweet"
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Problem"
      },
      "minItems": 1
    },
    "includes": {
      "$ref": "#/components/schemas/Expansions"
    },
    "matching_rules": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/RuleId"
          },
          "tag": {
            "$ref": "#/components/schemas/RuleTag"
          }
        }
      },
      "description": "The list of rules which matched the Tweet"
    }
  },
  "description": "A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched."
}
object FullTextEntities
{
  "type": "object",
  "properties": {
    "urls": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/UrlEntity"
      },
      "minItems": 1
    },
    "cashtags": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/CashtagEntity"
      },
      "minItems": 1
    },
    "hashtags": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/HashtagEntity"
      },
      "minItems": 1
    },
    "mentions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/MentionEntity"
      },
      "minItems": 1
    },
    "annotations": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/components/schemas/EntityIndicesInclusiveInclusive"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "example": "Person",
                "description": "Annotation type."
              },
              "probability": {
                "type": "number",
                "format": "double",
                "maximum": 1,
                "minimum": 0,
                "description": "Confidence factor for annotation type."
              },
              "normalized_text": {
                "type": "string",
                "example": "Barack Obama",
                "description": "Text used to determine annotation."
              }
            },
            "description": "Represents the data for the annotation."
          }
        ],
        "description": "Annotation for entities based on the Tweet text."
      },
      "minItems": 1
    }
  }
}
object GeneralGetOpenApiSpecResponse
{
  "type": "object",
  "example": {},
  "properties": {}
}
object Geo
{
  "type": "object",
  "required": [
    "type",
    "bbox",
    "properties"
  ],
  "properties": {
    "bbox": {
      "type": "array",
      "items": {
        "type": "number",
        "format": "double",
        "maximum": 180,
        "minimum": -180
      },
      "example": [
        -105.193475,
        39.60973,
        -105.053164,
        39.761974
      ],
      "maxItems": 4,
      "minItems": 4
    },
    "type": {
      "enum": [
        "Feature"
      ],
      "type": "string"
    },
    "geometry": {
      "$ref": "#/components/schemas/Point"
    },
    "properties": {
      "type": "object"
    }
  }
}

Versions

Version Endpoints Schemas Ingested Status
2.62 80 228 2026-05-11 current
2.62 80 228 2026-04-20
2.62 80 228 2026-04-16