X Users API
Endpoints related to retrieving, managing relationships of Users — 42 operation(s) in the X-published contract.
Operations 44
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Ask an LLM
“Can I fetch profiles for a batch of user IDs at once?”
“Which profile fields can I request for multiple users by ID?”
Tell an agent
Get the users with IDs {ids}.
Look up user IDs {ids} with fields {fields}.
Ask an LLM
“How do I turn a list of @handles into user profiles in one call?”
“Can I resolve multiple usernames to user IDs together?”
Tell an agent
Look up the users {usernames}.
Get profiles for these handles at once: {usernames}.
Ask an LLM
“What's the v2 way to get a single profile from an @handle?”
“Can I include a user's pinned post when looking them up by username?”
Tell an agent
Get the v2 profile for @{username}.
Look up @{username} and expand {expansions}.
Ask an LLM
“Which account is my access token acting as?”
“How can I get my own user ID and profile?”
Tell an agent
Show my own profile.
Get my authenticated account with fields {fields}.
Ask an LLM
“Can I fetch the X Chat encryption public keys for a batch of users?”
“What public keys are registered for multiple user IDs?”
Tell an agent
Get Chat public keys for users {ids}.
Fetch encryption keys for {ids} in one request.
Ask an LLM
“Which of my posts have other people reposted?”
“Can I page through reposts of my own content?”
Tell an agent
Show reposts of my posts.
List the latest {max_results} reposts of my content.
Ask an LLM
“What accounts match a name or keyword?”
“Can I search users and page through the matches?”
Tell an agent
Search users for {query}.
Find up to {max_results} accounts matching {query}.
Ask an LLM
“What's the v2 call for a single user profile by numeric ID?”
“Can I request specific profile fields for one user ID?”
Tell an agent
Get the v2 profile for user {id}.
Look up user {id} with fields {fields} on v2.
Ask an LLM
“Which affiliated accounts are linked to an organization's profile?”
“Can I page through a user's affiliates?”
Tell an agent
List the affiliates of user {id}.
Show {max_results} affiliate accounts for {id}.
Ask an LLM
“Which accounts have I blocked?”
“Can I export my full block list?”
Tell an agent
List the accounts user {id} is blocking.
Show {max_results} blocked accounts for {id}.
Ask an LLM
“What posts have I bookmarked?”
“Can I export all my bookmarks through the API?”
Tell an agent
Show bookmarks for user {id}.
List the latest {max_results} posts {id} has bookmarked.
Ask an LLM
“Can I save a post to my bookmarks programmatically?”
“Can I bookmark a post straight into a specific folder?”
Tell an agent
Bookmark post {tweet_id} for user {id}.
Save post {tweet_id} into bookmark folder {folder_id} for {id}.
Ask an LLM
“Which bookmark folders have I created?”
“Can I list all bookmark folders on my account?”
Tell an agent
List bookmark folders for user {id}.
Show {max_results} of {id}'s bookmark folders.
Ask an LLM
“Can I organize my bookmarks by creating a new folder?”
“What's needed to make a named bookmark folder?”
Tell an agent
Create a bookmark folder called {name} for user {id}.
Make a new folder {name} in {id}'s bookmarks.
GET
/2/users/{id}/bookmarks/folders/{folder_id}
List bookmarks in one folder · Get Users Bookmarks by Folder ID
#
Ask an LLM
“Which posts are saved in a particular bookmark folder?”
“Can I read just one bookmark folder's contents?”
Tell an agent
Show the bookmarks in folder {folder_id} for user {id}.
List {max_results} posts saved in bookmark folder {folder_id} of {id}.
Ask an LLM
“What's the call to unbookmark a post?”
“Can I remove a saved post from my bookmarks by its ID?”
Tell an agent destructive · confirm first
Remove post {tweet_id} from {id}'s bookmarks.
Unbookmark {tweet_id} for user {id}.
Ask an LLM
“Can I stop a specific user from sending me Direct Messages?”
“Is there a DM-only block for an account?”
Tell an agent
Block DMs from user {id}.
Stop {id} from sending me direct messages.
Ask an LLM
“How do I let a user I DM-blocked message me again?”
“Can I lift a Direct Message block on an account?”
Tell an agent
Unblock DMs from user {id}.
Let {id} send me direct messages again.
Ask an LLM
“Which Lists does an account follow?”
“Can I page through all Lists a user is following?”
Tell an agent
Show the Lists user {id} follows.
Get {max_results} Lists followed by {id}.
Ask an LLM
“How do I follow a List so its posts show up for me?”
“Can I follow someone else's public List?”
Tell an agent
Follow List {list_id} as user {id}.
Have {id} start following List {list_id}.
Ask an LLM
“Is there a way to stop following a List?”
“Can I unfollow a List by its ID?”
Tell an agent destructive · confirm first
Unfollow List {list_id} for user {id}.
Have {id} stop following List {list_id}.
Ask an LLM
“Who follows a given account?”
“Can I page through all of a user's followers?”
Tell an agent
List the followers of user {id}.
Get {max_results} followers of {id}.
Ask an LLM
“Which accounts does a user follow?”
“Can I get the full following list for an account?”
Tell an agent
List the accounts user {id} follows.
Get {max_results} accounts that {id} is following.
Ask an LLM
“Can I follow another account via the API?”
“Can my app follow a user on behalf of the signed-in account?”
Tell an agent
Follow user {target_user_id} as {id}.
Have {id} follow {target_user_id}.
Ask an LLM
“Which posts has an account liked?”
“Can I page through a user's liked posts?”
Tell an agent
Show posts liked by user {id}.
Get the last {max_results} posts {id} liked.
Ask an LLM
“Is liking a post possible through the API?”
“Can my app like a post for the signed-in user?”
Tell an agent
Like post {tweet_id} as user {id}.
Have {id} like {tweet_id}.
Ask an LLM
“Can I take back a like I gave a post?”
“Can I undo a like by the post's ID?”
Tell an agent destructive · confirm first
Unlike post {tweet_id} for user {id}.
Remove {id}'s like on {tweet_id}.
Ask an LLM
“Which Lists has an account been added to?”
“Can I see every List that includes a particular user?”
Tell an agent
Show the Lists that include user {id}.
Get {max_results} List memberships for {id}.
Ask an LLM
“Who has mentioned an account recently?”
“Can I get a user's mentions within a date range?”
Tell an agent
Show posts mentioning user {id}.
Get mentions of {id} between {start_time} and {end_time}.
Ask an LLM
“Which accounts have I muted?”
“Can I export my mute list?”
Tell an agent
List the accounts user {id} has muted.
Show {max_results} muted accounts for {id}.
Ask an LLM
“How do I mute an account so I stop seeing their posts?”
“Can my app mute someone for the signed-in user?”
Tell an agent
Mute user {target_user_id} for {id}.
Have {id} mute {target_user_id}.
Ask an LLM
“Which Lists has an account created?”
“Can I page through all Lists a user owns?”
Tell an agent
Show the Lists owned by user {id}.
Get {max_results} Lists that {id} created.
Ask an LLM
“Which Lists has a user pinned?”
“Can I see my pinned Lists with their owner details?”
Tell an agent
Show the pinned Lists of user {id}.
Get {id}'s pinned Lists with fields {fields}.
Ask an LLM
“Can I pin a List to the top of my Lists?”
“Can I pin a List by its ID for the signed-in user?”
Tell an agent
Pin List {list_id} for user {id}.
Have {id} pin List {list_id}.
Ask an LLM
“What removes a List from my pinned set?”
“Can I remove a List from my pinned Lists?”
Tell an agent destructive · confirm first
Unpin List {list_id} for user {id}.
Have {id} unpin List {list_id}.
Ask an LLM
“What Chat encryption keys has a single user registered?”
“Where do I get one person's public key before messaging them in XChat?”
Tell an agent
Get the Chat public keys of user {id}.
Show {id}'s registered encryption keys.
Ask an LLM
“How do I repost a post to my followers?”
“Can my app repost something for the signed-in user?”
Tell an agent
Repost post {tweet_id} as user {id}.
Have {id} repost {tweet_id}.
Ask an LLM
“Is it possible to undo a repost?”
“Can I remove my repost of a post by its ID?”
Tell an agent destructive · confirm first
Undo the repost of {source_tweet_id} for user {id}.
Have {id} unrepost {source_tweet_id}.
Ask an LLM
“What's in my home timeline in reverse chronological order?”
“Can I pull my home feed for a time range, excluding some post types?”
Tell an agent
Show the home timeline for user {id}.
Get {id}'s home feed from {start_time} to {end_time} excluding {exclude}.
Ask an LLM
“What has a particular account posted recently?”
“Can I fetch a user's own posts while excluding some post types?”
Tell an agent
Show the posts authored by user {id}.
Get {id}'s posts since post {since_id}, excluding {exclude}.
Ask an LLM
“What's the way to unfollow an account?”
“Can my app unfollow someone on behalf of the signed-in user?”
Tell an agent destructive · confirm first
Unfollow {target_user_id} as {source_user_id}.
Have {source_user_id} stop following {target_user_id}.
Ask an LLM
“Can I unmute an account I muted earlier?”
“Can I start seeing a muted user's posts again?”
Tell an agent destructive · confirm first
Unmute {target_user_id} for {source_user_id}.
Have {source_user_id} unmute {target_user_id}.
Ask an LLM
“Is there a legacy non-/2 route to look up a user by ID?”
“Which unversioned endpoint returns a user from their numeric ID?”
Tell an agent
Look up user {id} via the unversioned /users endpoint.
Use the legacy user-by-ID route for {id}.
GET
/users/by/username/{username}
Look up a user by username (unversioned) · Look up a user by username
#
Ask an LLM
“Does the older unversioned API still resolve an @handle to a profile?”
“Which unversioned endpoint returns a profile for a username?”
Tell an agent
Look up @{username} via the unversioned /users/by/username route.
Use the legacy user-by-username endpoint for {username}.