Twitter

Learn how to use Twitter with Composio

Overview

SLUG

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
full
stringDefaults to https://api.x.com
bearer_token
string

Tools

SLUG: TWITTER_CREATE_LIST

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_CREATION_OF_A_POST

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_DELETE_LIST

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_FOLLOW_USER

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_GET_BLOCKED_USERS

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_POST_DELETE_BY_POST_ID

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_UNFOLLOW_USER

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_USER_LOOKUP_BY_USERNAME

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_USER_LOOKUP_ME

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_ADD_A_LIST_MEMBER

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_ADD_POST_TO_BOOKMARKS

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_BOOKMARKS_BY_USER

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_CREATE_A_NEW_DM_CONVERSATION

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_CREATE_COMPLIANCE_JOB_REQUEST

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_DELETE_DM

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_FETCH_LIST_MEMBERS_BY_ID

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_FETCH_SPACE_TICKET_BUYERS_LIST

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_FOLLOWERS_BY_USER_ID

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_FOLLOWING_BY_USER_ID

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
objectRequired
error
string
successful
booleanRequired

SLUG: TWITTER_FOLLOW_A_LIST

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
objectRequired
error
string
successful
booleanRequired