client.Users (UsersClient).
Methods
BlockDmsAsync
POST /2/users/{id}/dm/block
Block DMs
Blocks direct messages to or from a specific User by their ID for the authenticated user.
Parameters
Returns:Task<BlockUsersDmsResponse>
CreateBookmarkAsync
POST /2/users/{id}/bookmarks
Create Bookmark
Adds one or more Posts to the authenticated user’s Bookmarks. Supply tweet_id for a single Post, or tweet_ids (at most 25) to bookmark several in one request. Optional folder_id applies to every Post in the request. Billing and rate limits still apply per HTTP request.
Parameters
The authenticated user’s numeric ID, not
me: the id from Get My User (GET /2/users/me).Task<JsonElement>
CreateBookmarkFolderAsync
POST /2/users/{id}/bookmarks/folders
Create Bookmark Folder
Creates a new Bookmark folder for the authenticated user.
Parameters
The authenticated user’s numeric ID, not
me: the id from Get My User (GET /2/users/me).Task<CreateUsersBookmarkFolderResponse>
DeleteBookmarkAsync
DELETE /2/users/{id}/bookmarks/{tweet_id}
Delete Bookmark
Removes a Post from the authenticated user’s Bookmarks by its ID.
Parameters
The authenticated user’s numeric ID, not
me: the id from Get My User (GET /2/users/me).Task<DeleteUsersBookmarkResponse>
FollowListAsync
POST /2/users/{id}/followed_lists
Follow List
Causes the authenticated user to follow a specific List by its ID.
Parameters
Returns:Task<FollowListResponse>
FollowUserAsync
POST /2/users/{id}/following
Follow User
Causes the authenticated user to follow a specific User by their ID.
Parameters
Returns:Task<FollowUserResponse>
GetAffiliatesAsync
GET /2/users/{id}/affiliates Paginated
Get Affiliates
Retrieves a list of Users who are affiliated with a specific organization User by their ID.
Parameters
Returns:Task<GetUsersAffiliatesResponse> (use GetAffiliatesPages(...) for IAsyncEnumerable page iteration)
GetBlockingAsync
GET /2/users/{id}/blocking Paginated
Get Blocked Users
Returns the Users that the given User is blocking.
Parameters
Returns:Task<GetUsersBlockingResponse> (use GetBlockingPages(...) for IAsyncEnumerable page iteration)
GetBookmarkFoldersAsync
GET /2/users/{id}/bookmarks/folders Paginated
Get Bookmark Folders
Retrieves a list of Bookmark folders created by the authenticated user.
Parameters
The authenticated user’s numeric ID, not
me: the id from Get My User (GET /2/users/me).Task<GetUsersBookmarkFoldersResponse> (use GetBookmarkFoldersPages(...) for IAsyncEnumerable page iteration)
GetBookmarksAsync
GET /2/users/{id}/bookmarks Paginated
Get Bookmarks
Retrieves a list of Posts bookmarked by the authenticated user.
Parameters
The authenticated user’s numeric ID, not
me: the id from Get My User (GET /2/users/me).Task<GetUsersBookmarksResponse> (use GetBookmarksPages(...) for IAsyncEnumerable page iteration)
GetBookmarksByFolderIdAsync
GET /2/users/{id}/bookmarks/folders/{folder_id} Paginated
Get Bookmarks by Folder ID
Retrieves Posts in a specific Bookmark folder by its ID for the authenticated user.
Parameters
The authenticated user’s numeric ID, not
me: the id from Get My User (GET /2/users/me).Task<GetUsersBookmarksByFolderIdResponse> (use GetBookmarksByFolderIdPages(...) for IAsyncEnumerable page iteration)
GetByIdAsync
GET /2/users/{id}
Get User by ID
Retrieves details of a specific User by their ID.
Parameters
Returns:Task<GetUsersByIdResponse>
GetByIdsAsync
GET /2/users
Get Users by IDs
Retrieves details of multiple Users by their IDs.
Parameters
Returns:Task<GetUsersByIdsResponse>
GetByUsernameAsync
GET /2/users/by/username/{username}
Get User by Username
Retrieves details of a specific User by their username.
Parameters
Returns:Task<GetUsersByUsernameResponse>
GetByUsernamesAsync
GET /2/users/by
Get Users by Usernames
Retrieves details of multiple Users by their usernames.
Parameters
Returns:Task<GetUsersByUsernamesResponse>
GetFollowedListsAsync
GET /2/users/{id}/followed_lists Paginated
Get Followed Lists
Retrieves a list of Lists followed by a specific User by their ID.
Parameters
Returns:Task<GetUsersFollowedListsResponse> (use GetFollowedListsPages(...) for IAsyncEnumerable page iteration)
GetFollowersAsync
GET /2/users/{id}/followers Paginated
Get Followers
Retrieves a list of Users who follow a specific User by their ID.
Parameters
Returns:Task<GetUsersFollowersResponse> (use GetFollowersPages(...) for IAsyncEnumerable page iteration)
GetFollowingAsync
GET /2/users/{id}/following Paginated
Get Following
Retrieves a list of Users followed by a specific User by their ID.
Parameters
Returns:Task<GetUsersFollowingResponse> (use GetFollowingPages(...) for IAsyncEnumerable page iteration)
GetLikedPostsAsync
GET /2/users/{id}/liked_tweets Paginated
Get Liked Posts
Retrieves a list of Posts liked by a specific User by their ID.
Parameters
Returns:Task<GetUsersLikedPostsResponse> (use GetLikedPostsPages(...) for IAsyncEnumerable page iteration)
GetListMembershipsAsync
GET /2/users/{id}/list_memberships Paginated
Get List Memberships
Retrieves a list of Lists that a specific User is a member of by their ID.
Parameters
Returns:Task<GetUsersListMembershipsResponse> (use GetListMembershipsPages(...) for IAsyncEnumerable page iteration)
GetMeAsync
GET /2/users/me
Get My User
Retrieves details of the authenticated user.
Parameters
Returns:Task<GetUsersMeResponse>
GetMeFollowersAsync
GET /2/users/me/followers Paginated
Get the Authenticated User’s Followers
Returns the Users who follow the authenticated user. Same results as GET /2/users/{id}/followers with your own user ID, without looking it up.
Parameters
Returns:Task<GetUsersMeFollowersResponse> (use GetMeFollowersPages(...) for IAsyncEnumerable page iteration)
GetMeFollowingAsync
GET /2/users/me/following Paginated
Get the Users the Authenticated User Follows
Returns the Users the authenticated user follows. Same results as GET /2/users/{id}/following with your own user ID, without looking it up.
Parameters
Returns:Task<GetUsersMeFollowingResponse> (use GetMeFollowingPages(...) for IAsyncEnumerable page iteration)
GetMentionsAsync
GET /2/users/{id}/mentions Paginated
Get Mentions
Retrieves a list of Posts that mention a specific User by their ID.
When both are provided, start_time must be earlier than end_time. When both are provided, since_id must be less than until_id.
Parameters
Returns:Task<GetUsersMentionsResponse> (use GetMentionsPages(...) for IAsyncEnumerable page iteration)
GetMutingAsync
GET /2/users/{id}/muting Paginated
Get Muting
Retrieves a list of Users muted by the authenticated user.
Parameters
Returns:Task<GetUsersMutingResponse> (use GetMutingPages(...) for IAsyncEnumerable page iteration)
GetOwnedListsAsync
GET /2/users/{id}/owned_lists Paginated
Get Owned Lists
Retrieves a list of Lists owned by a specific User by their ID.
Parameters
Returns:Task<GetUsersOwnedListsResponse> (use GetOwnedListsPages(...) for IAsyncEnumerable page iteration)
GetPinnedListsAsync
GET /2/users/{id}/pinned_lists
Get Pinned Lists
Retrieves a list of Lists pinned by the authenticated user.
Parameters
Returns:Task<GetUsersPinnedListsResponse>
GetPostsAsync
GET /2/users/{id}/tweets Paginated
Get Posts
Retrieves a list of Posts authored by a specific User by their ID.
When both are provided, start_time must be earlier than end_time. When both are provided, since_id must be less than until_id.
Parameters
Returns:Task<GetUsersPostsResponse> (use GetPostsPages(...) for IAsyncEnumerable page iteration)
GetPublicKeyAsync
GET /2/users/{id}/public_keys
Get User Public Keys
Returns a user’s registered public keys for X Chat encryption.
Every key field is returned by default, so public_key.fields can be left out. It takes public_key, signing_public_key, identity_public_key_signature, public_key_version and juicebox_config.
Parameters
Numeric user ID, not
me. For your own keys, use the id from Get My User (GET /2/users/me).Task<GetUsersPublicKeyResponse>
GetPublicKeysAsync
GET /2/users/public_keys
Get Public Keys for Multiple Users
Returns the public keys that up to 100 users registered for X Chat encryption, looked up by numeric user ID. Each key carries the user_id of the user it belongs to.
Every key field is returned by default, so public_key.fields can be left out. It takes public_key, signing_public_key, identity_public_key_signature, public_key_version, juicebox_config and user_id.
Parameters
Returns:Task<GetUsersPublicKeysResponse>
GetRepostsOfMeAsync
GET /2/users/reposts_of_me Paginated
Get Reposts of Me
Retrieves a list of Posts that repost content from the authenticated user.
Parameters
Returns:Task<GetUsersRepostsOfMeResponse> (use GetRepostsOfMePages(...) for IAsyncEnumerable page iteration)
GetTimelineAsync
GET /2/users/{id}/timelines/reverse_chronological Paginated
Get Timeline
Retrieves a reverse chronological list of Posts in the authenticated user’s Timeline.
When both are provided, start_time must be earlier than end_time. When both are provided, since_id must be less than until_id.
Parameters
Returns:Task<GetUsersTimelineResponse> (use GetTimelinePages(...) for IAsyncEnumerable page iteration)
IdBlockAsync
POST /2/users/{id}/blocking
Block User
Causes the source User to block the target User. A block also removes any follow between the two Users, in both directions, and unblocking does not restore it. Each call blocks one account: block only accounts the authenticated User named or approved, because finding or reviewing accounts is not approval to block them.
Parameters
Returns:Task<UsersIdBlockResponse>
IdUnblockAsync
DELETE /2/users/{source_user_id}/blocking/{target_user_id}
Unblock User
Causes the source User to unblock the target User. Unblocking does not restore any follow the block removed, so blocking and then unblocking a follower removes them as a follower: do that only for followers the authenticated User approved removing.
Parameters
Returns:Task<UsersIdUnblockResponse>
LikePostAsync
POST /2/users/{id}/likes
Like Post
Causes the authenticated user to like a specific Post by its ID.
Parameters
Returns:Task<LikePostResponse>
MuteUserAsync
POST /2/users/{id}/muting
Mute User
Causes the authenticated user to mute a specific User by their ID.
Parameters
Returns:Task<MuteUserResponse>
PinListAsync
POST /2/users/{id}/pinned_lists
Pin List
Causes the authenticated user to pin a specific List by its ID.
Parameters
Returns:Task<PinListResponse>
RepostPostAsync
POST /2/users/{id}/retweets
Repost Post
Causes the authenticated user to repost a specific Post by its ID.
Parameters
Returns:Task<RepostPostResponse>
SearchAsync
GET /2/users/search Paginated
Search Users
Retrieves a list of Users matching a search query.
Parameters
A name or @username (1-50 chars): letters and digits in any language, spaces, and _ ’ . - @ & ”
Task<SearchUsersResponse> (use SearchPages(...) for IAsyncEnumerable page iteration)
UnblockDmsAsync
POST /2/users/{id}/dm/unblock
Unblock DMs
Unblocks direct messages to or from a specific User by their ID for the authenticated user.
Parameters
Returns:Task<UnblockUsersDmsResponse>
UnfollowListAsync
DELETE /2/users/{id}/followed_lists/{list_id}
Unfollow List
Causes the authenticated user to unfollow a List by its ID.
Parameters
Returns:Task<UnfollowListResponse>
UnfollowUserAsync
DELETE /2/users/{source_user_id}/following/{target_user_id}
Unfollow User
Causes the authenticated user to unfollow a specific user by their ID.
Parameters
Returns:Task<UnfollowUserResponse>
UnlikePostAsync
DELETE /2/users/{id}/likes/{tweet_id}
Unlike Post
Causes the authenticated user to unlike a specific Post by its ID.
Parameters
Returns:Task<UnlikePostResponse>
UnmuteUserAsync
DELETE /2/users/{source_user_id}/muting/{target_user_id}
Unmute User
Causes the authenticated user to unmute the target user.
Parameters
Returns:Task<UnmuteUserResponse>
UnpinListAsync
DELETE /2/users/{id}/pinned_lists/{list_id}
Unpin List
Causes the authenticated user to unpin a List by its ID.
Parameters
Returns:Task<UnpinListResponse>
UnrepostPostAsync
DELETE /2/users/{id}/retweets/{source_tweet_id}
Unrepost Post
Causes the authenticated user to unrepost a specific Post by its ID.
Parameters
Returns:Task<UnrepostPostResponse>