Twitter

Learn how to use Twitter with Composio

Overview

Enum

TWITTER

Description

Twitter, Inc. was an American social media company based in San Francisco, California, which operated and was named for named for its flagship social media network prior to its rebrand as X.

Authentication Details

client_id
stringRequired
client_secret
stringRequired
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to dm.write dm.read mute.read mute.write space.read tweet.write tweet.read tweet.moderate.write users.read follows.read follows.write like.read like.write list.read list.write block.read block.write bookmark.read bookmark.write offline.access
base_url
stringDefaults to https://api.x.com

Actions

Adds a user to a specified twitter list; the list must be owned by the authenticated user.

Action Parameters

id
stringRequired
user_id
stringRequired

Action Response

data
object
error
successful
boolean
Adds a specified, existing, and accessible tweet to a user's bookmarks, with success indicated by the 'bookmarked' field in the response.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
object
error
successful
boolean
Retrieves tweets bookmarked by the authenticated user, where the provided user id must match the authenticated user's id.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 2
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Creates a new group direct message (dm) conversation on twitter with specified participant ids and an initial message, which can include text and media attachments.

Action Parameters

conversation_type
stringRequired
message
objectRequired
participant_ids
arrayRequired

Action Response

data
object
error
successful
boolean
Creates a new compliance job to check the status of tweet or user ids; upload ids as a plain text file (one id per line) to the `upload url` received in the response.

Action Parameters

name
string
resumable
boolean
type
stringRequired

Action Response

data
object
error
successful
boolean
Creates a new, empty list on x (formerly twitter), for which the provided name must be unique for the authenticated user; accounts are added separately.

Action Parameters

description
string
name
stringRequired
private
boolean

Action Response

data
object
error
successful
boolean
Creates a tweet on twitter; `text` is required unless `card uri`, `media media ids`, `poll options`, or `quote tweet id` is provided.

Action Parameters

card_uri
string
direct_message_deep_link
string
for_super_followers_only
boolean
geo__place__id
string
media__media__ids
array
media__tagged__user__ids
array
nullcast
boolean
poll__duration__minutes
integer
poll__options
array
poll__reply__settings
string
quote_tweet_id
string
reply__exclude__reply__user__ids
array
reply__in__reply__to__tweet__id
string
reply_settings
string
text
string

Action Response

data
object
error
successful
boolean
Permanently deletes a specific twitter direct message (dm) event using its `event id` if the authenticated user sent it; this action is irreversible and does not delete entire conversations.

Action Parameters

event_id
stringRequired

Action Response

data
object
error
successful
boolean
Permanently deletes a specified twitter list using its id, which must be owned by the authenticated user; this action is irreversible and the list must already exist.

Action Parameters

id
stringRequired

Action Response

data
object
error
successful
boolean
Fetches members of a specific twitter list, identified by its unique id.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves a list of users who purchased tickets for a specific, valid, and ticketed twitter space.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves a list of users who follow a specified public twitter user id.

Action Parameters

expansions
array
id
stringRequired
max_results
integer
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves users followed by a specific twitter user, allowing pagination and customization of returned user and tweet data fields via expansions.

Action Parameters

expansions
array
id
stringRequired
max_results
integer
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Allows the authenticated user (`id`) to follow a specific twitter list (`list id`) they are permitted to access, subscribing them to the list's timeline; this does not automatically follow individual list members.

Action Parameters

id
stringRequired
list_id
stringRequired

Action Response

data
object
error
successful
boolean
Allows an authenticated user (path `id`) to follow another user (`target user id`), which results in a pending request if the target user's tweets are protected.

Action Parameters

id
stringRequired
target_user_id
stringRequired

Action Response

data
object
error
successful
boolean
Returns a count of tweets from the full archive that match a specified query, aggregated by day, hour, or minute; `start time` must be before `end time` if both are provided, and `since id`/`until id` cannot be used with `start time`/`end time`.

Action Parameters

end_time
string
granularity
stringDefaults to hour
next_token
string
pagination_token
string
query
stringRequired
search__count__fields
array
since_id
string
start_time
string
until_id
string

Action Response

data
object
error
successful
boolean
Retrieves all twitter lists a specified user is a member of, including public lists and private lists the authenticated user is authorized to view.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
max_results
integerDefaults to 100
pagination_token
string
user__fields
array

Action Response

data
object
error
successful
boolean
Call this action to retrieve lists created (owned) by a specific twitter user, not lists they follow or are subscribed to.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
max_results
integerDefaults to 100
pagination_token
string
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves the lists a specific, existing twitter user has pinned to their profile to highlight them.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves user objects for accounts blocked by the specified user id; this is a read-only view of a user's block list.

Action Parameters

expansions
array
id
stringRequired
max_results
integer
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Fetches a specific direct message (dm) event by its unique id, allowing optional expansion of related data like users or tweets; ensure the `event id` refers to an existing dm event accessible to the authenticated user.

Action Parameters

dm__event__fields
array
event_id
stringRequired
expansions
array
media__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Fetches direct message (dm) events for a one-on-one conversation with a specified participant id, ordered chronologically newest to oldest; does not support group dms.

Action Parameters

dm__event__fields
array
event_types
arrayDefaults to ['MessageCreate', 'ParticipantsLeave', 'ParticipantsJoin']
expansions
array
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
participant_id
stringRequired
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Fetches a list of users who follow a specific twitter list, identified by its id; ensure the authenticated user has access if the list is private.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Returns user objects muted by the x user identified by the `id` path parameter.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves users who publicly retweeted a specified public post id, excluding quote tweets and retweets from private accounts.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Returns recent direct message events for the authenticated user, such as new messages or changes in conversation participants.

Action Parameters

dm__event__fields
array
event_types
arrayDefaults to ['MessageCreate', 'ParticipantsLeave', 'ParticipantsJoin']
expansions
array
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Returns metadata (not tweets) for lists a specific twitter user follows, optionally including expanded owner details.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
max_results
integerDefaults to 100
pagination_token
string
user__fields
array

Action Response

data
object
error
successful
boolean
Hides or unhides an existing reply tweet.

Action Parameters

hidden
booleanRequired
tweet_id
stringRequired

Action Response

data
object
error
successful
boolean
Returns metadata for a specific twitter list, identified by its id; does not return list members but can expand the owner's user object via the `expansions` parameter.

Action Parameters

expansions
array
id
stringRequired
list__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Fetches the most recent tweets posted by members of a specified twitter list.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves users who have liked the post (tweet) identified by the provided id.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Mutes a target user on behalf of an authenticated user, preventing the target's tweets and retweets from appearing in the authenticated user's home timeline without notifying the target.

Action Parameters

id
stringRequired
target_user_id
stringRequired

Action Response

data
object
error
successful
boolean
Pins a specified list to the authenticated user's profile, provided the list exists, the user has access rights, and the pin limit (typically 5 lists) is not exceeded.

Action Parameters

id
stringRequired
list_id
stringRequired

Action Response

data
object
error
successful
boolean
Establishes a persistent stream of real-time events for when tweet labels are applied or removed, offering insights into content categorization.

Action Parameters

backfill_minutes
integer
end_time
string
start_time
string

Action Response

data
error
successful
boolean
Irreversibly deletes a specific tweet by its id; the tweet may persist in third-party caches after deletion.

Action Parameters

id
stringRequired

Action Response

data
object
error
successful
boolean
Fetches comprehensive details for a single tweet by its unique id, provided the tweet exists and is accessible.

Action Parameters

expansions
array
id
stringRequired
media__fields
array
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves detailed information for one or more posts (tweets) identified by their unique ids, allowing selection of specific fields and expansions.

Action Parameters

expansions
array
ids
arrayRequired
media__fields
array
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Fetches tweet usage statistics for a project (e.g., consumption, caps, daily breakdowns for project & client apps) to monitor api limits; data can be retrieved for 1 to 90 days.

Action Parameters

days
integerDefaults to 7
usage__fields
array

Action Response

data
object
error
successful
boolean
Retrieves the count of tweets matching a specified search query within the last 7 days, aggregated by 'minute', 'hour', or 'day'.

Action Parameters

end_time
string
granularity
stringDefaults to hour
next_token
string
pagination_token
string
query
stringRequired
search__count__fields
array
since_id
string
start_time
string
until_id
string

Action Response

data
object
error
successful
boolean
Removes a tweet, specified by `tweet id`, from the authenticated user's bookmarks; the tweet must have been previously bookmarked by the user for the action to have an effect.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
object
error
successful
boolean
Removes a user from a twitter list; the response `is member` field will be `false` if removal was successful or the user was not a member, and the updated list of members is not returned.

Action Parameters

id
stringRequired
user_id
stringRequired

Action Response

data
object
error
successful
boolean
Returns a list of recent compliance jobs, filtered by type (tweets or users) and optionally by status.

Action Parameters

compliance__job__fields
array
status
string
type
stringRequired

Action Response

data
object
error
successful
boolean
Retrieves status, download/upload urls, and other details for an existing twitter compliance job specified by its unique id.

Action Parameters

compliance__job__fields
array
id
stringRequired

Action Response

data
object
error
successful
boolean
Retrieves direct message (dm) events for a specific conversation id on twitter, useful for analyzing messages and participant activities.

Action Parameters

dm__event__fields
array
event_types
arrayDefaults to ['MessageCreate', 'ParticipantsLeave', 'ParticipantsJoin']
expansions
array
id
stringRequired
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves tweets from a specified twitter space id; the space must be accessible and results are batched (not streamed).

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
media__fields
array
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves tweets that quote a specified tweet, requiring a valid tweet id.

Action Parameters

exclude
array
expansions
array
id
stringRequired
max_results
integerDefaults to 10
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves tweets that retweeted a specified public or authenticated-user-accessible tweet id, optionally customizing the response with fields and expansions.

Action Parameters

expansions
array
id
stringRequired
max_results
integerDefaults to 100
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves tweets liked by a specified twitter user, provided their liked tweets are public or accessible.

Action Parameters

expansions
array
id
stringRequired
max_results
integer
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Fetches the openapi specification (json) for twitter's api v2, used to programmatically understand the api's structure for developing client libraries or tools.

Action Parameters

Action Response

data
object
error
successful
boolean
Retweets a tweet (`tweet id`) for a given user (`id`), provided the tweet is public (or user follows if protected), not already retweeted by the user, and its author has not blocked the user.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
object
error
successful
boolean
Searches for twitter spaces by a textual query, optionally filtering by state (live, scheduled, all) to discover audio conversations.

Action Parameters

expansions
array
max_results
integerDefaults to 100
query
stringRequired
space__fields
array
state
stringDefaults to all
topic__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Sends a message, with optional text and/or media attachments (using pre-uploaded `media id`s), to a specified twitter direct message conversation.

Action Parameters

attachments
array
dm_conversation_id
stringRequired
text
string

Action Response

data
object
error
successful
boolean
Sends a new direct message with text and/or media (media id for attachments must be pre-uploaded) to a specified twitter user; this creates a new dm and does not modify existing messages.

Action Parameters

attachments
array
participant_id
stringRequired
text
string

Action Response

data
object
error
successful
boolean
Retrieves details for a twitter space by its id, allowing for customization and expansion of related data, provided the space id is valid and accessible.

Action Parameters

expansions
array
id
stringRequired
space__fields
array
topic__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves twitter spaces created by a list of specified user ids, with options to customize returned data fields.

Action Parameters

expansions
array
space__fields
array
topic__fields
array
user__fields
array
user_ids
arrayRequired

Action Response

data
object
error
successful
boolean
Fetches detailed information for one or more twitter spaces (live, scheduled, or ended) by their unique ids; at least one space id must be provided.

Action Parameters

expansions
array
ids
arrayRequired
space__fields
array
topic__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Enables a user (via `id`) to unfollow a specific twitter list (via `list id`), which removes its tweets from their timeline and stops related notifications; the action reports `following: false` on success, even if the user was not initially following the list.

Action Parameters

id
stringRequired
list_id
stringRequired

Action Response

data
object
error
successful
boolean
Allows the authenticated `source user id` to unfollow an existing twitter user (`target user id`), which removes the follow relationship.

Action Parameters

source_user_id
stringRequired
target_user_id
stringRequired

Action Response

data
object
error
successful
boolean
Allows an authenticated user (`id`) to remove their like from a specific post (`tweet id`); the action is idempotent and completes successfully even if the post was not liked.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
object
error
successful
boolean
Unmutes a `target user id` for the `source user id` (authenticated user), allowing the source user to see tweets and notifications from the target user again.

Action Parameters

source_user_id
stringRequired
target_user_id
stringRequired

Action Response

data
object
error
successful
boolean
Unpins a list (specified by list id) from a user's profile (specified by id), provided the list is currently pinned by that user.

Action Parameters

id
stringRequired
list_id
stringRequired

Action Response

data
object
error
successful
boolean
Removes a user's retweet of a specified post, if the user had previously retweeted it.

Action Parameters

id
stringRequired
source_tweet_id
stringRequired

Action Response

data
object
error
successful
boolean
Updates an existing twitter list's name, description, or privacy status, requiring the list id and at least one mutable property.

Action Parameters

description
string
id
stringRequired
name
string
private
boolean

Action Response

data
object
error
successful
boolean
Retrieves the most recent tweets and retweets posted by a specified twitter user in reverse chronological order, excluding replies/mentions unless part of self-threads/retweets; useful for showing latest activity without algorithmic sorting.

Action Parameters

end_time
string
exclude
array
expansions
array
id
stringRequired
max_results
integer
media__fields
array
pagination_token
string
place__fields
array
poll__fields
array
since_id
string
start_time
string
tweet__fields
array
until_id
string
user__fields
array

Action Response

data
object
error
successful
boolean
Allows the authenticated user (`id`) to like a specific, accessible tweet (`tweet id`), provided neither user has blocked the other and the authenticated user is not restricted from liking.

Action Parameters

id
stringRequired
tweet_id
stringRequired

Action Response

data
object
error
successful
boolean
Retrieves detailed public information for a twitter user by their id, optionally expanding related data (e.g., pinned tweets) and specifying particular user or tweet fields to return.

Action Parameters

expansions
array
id
stringRequired
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Retrieves detailed information for specified x (formerly twitter) user ids, optionally customizing returned fields and expanding related entities.

Action Parameters

expansions
array
ids
arrayRequired
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean
Fetches public profile information for a valid and existing twitter user by their username, optionally expanding related data like pinned tweets; results may be limited for protected profiles not followed by the authenticated user.

Action Parameters

expansions
array
tweet__fields
array
user__fields
array
username
stringRequired

Action Response

data
object
error
successful
boolean
Retrieves detailed information for 1 to 100 twitter users by their usernames (each 1-15 alphanumeric characters/underscores), allowing customizable user/tweet fields and expansion of related data like pinned tweets.

Action Parameters

expansions
array
tweet__fields
array
user__fields
array
usernames
arrayRequired

Action Response

data
object
error
successful
boolean
Returns profile information for the currently authenticated x user, customizable via request fields.

Action Parameters

expansions
array
tweet__fields
array
user__fields
array

Action Response

data
object
error
successful
boolean