> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UsersClient

> Methods for X API v2 Users endpoints.

Access **Users** endpoints via `client.users()` (`UsersClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`blockDms`](#blockdms) | `POST /2/users/{id}/dm/block` | Standard | Block DMs |
| [`createBookmark`](#createbookmark) | `POST /2/users/{id}/bookmarks` | Standard | Create Bookmark |
| [`createBookmarkFolder`](#createbookmarkfolder) | `POST /2/users/{id}/bookmarks/folders` | Standard | Create Bookmark Folder |
| [`deleteBookmark`](#deletebookmark) | `DELETE /2/users/{id}/bookmarks/{tweet_id}` | Standard | Delete Bookmark |
| [`followList`](#followlist) | `POST /2/users/{id}/followed_lists` | Standard | Follow List |
| [`followUser`](#followuser) | `POST /2/users/{id}/following` | Standard | Follow User |
| [`getAffiliates`](#getaffiliates) | `GET /2/users/{id}/affiliates` | Paginated | Get Affiliates |
| [`getBlocking`](#getblocking) | `GET /2/users/{id}/blocking` | Paginated | Get Blocked Users |
| [`getBookmarkFolders`](#getbookmarkfolders) | `GET /2/users/{id}/bookmarks/folders` | Paginated | Get Bookmark Folders |
| [`getBookmarks`](#getbookmarks) | `GET /2/users/{id}/bookmarks` | Paginated | Get Bookmarks |
| [`getBookmarksByFolderId`](#getbookmarksbyfolderid) | `GET /2/users/{id}/bookmarks/folders/{folder_id}` | Paginated | Get Bookmarks by Folder ID |
| [`getById`](#getbyid) | `GET /2/users/{id}` | Standard | Get User by ID |
| [`getByIds`](#getbyids) | `GET /2/users` | Standard | Get Users by IDs |
| [`getByUsername`](#getbyusername) | `GET /2/users/by/username/{username}` | Standard | Get User by Username |
| [`getByUsernames`](#getbyusernames) | `GET /2/users/by` | Standard | Get Users by Usernames |
| [`getFollowedLists`](#getfollowedlists) | `GET /2/users/{id}/followed_lists` | Paginated | Get Followed Lists |
| [`getFollowers`](#getfollowers) | `GET /2/users/{id}/followers` | Paginated | Get Followers |
| [`getFollowing`](#getfollowing) | `GET /2/users/{id}/following` | Paginated | Get Following |
| [`getLikedPosts`](#getlikedposts) | `GET /2/users/{id}/liked_tweets` | Paginated | Get Liked Posts |
| [`getListMemberships`](#getlistmemberships) | `GET /2/users/{id}/list_memberships` | Paginated | Get List Memberships |
| [`getMe`](#getme) | `GET /2/users/me` | Standard | Get My User |
| [`getMeFollowers`](#getmefollowers) | `GET /2/users/me/followers` | Paginated | Get the Authenticated User's Followers |
| [`getMeFollowing`](#getmefollowing) | `GET /2/users/me/following` | Paginated | Get the Users the Authenticated User Follows |
| [`getMentions`](#getmentions) | `GET /2/users/{id}/mentions` | Paginated | Get Mentions |
| [`getMuting`](#getmuting) | `GET /2/users/{id}/muting` | Paginated | Get Muting |
| [`getOwnedLists`](#getownedlists) | `GET /2/users/{id}/owned_lists` | Paginated | Get Owned Lists |
| [`getPinnedLists`](#getpinnedlists) | `GET /2/users/{id}/pinned_lists` | Standard | Get Pinned Lists |
| [`getPosts`](#getposts) | `GET /2/users/{id}/tweets` | Paginated | Get Posts |
| [`getPublicKey`](#getpublickey) | `GET /2/users/{id}/public_keys` | Standard | Get User Public Keys |
| [`getPublicKeys`](#getpublickeys) | `GET /2/users/public_keys` | Standard | Get Public Keys for Multiple Users |
| [`getRepostsOfMe`](#getrepostsofme) | `GET /2/users/reposts_of_me` | Paginated | Get Reposts of Me |
| [`getTimeline`](#gettimeline) | `GET /2/users/{id}/timelines/reverse_chronological` | Paginated | Get Timeline |
| [`idBlock`](#idblock) | `POST /2/users/{id}/blocking` | Standard | Block User |
| [`idUnblock`](#idunblock) | `DELETE /2/users/{source_user_id}/blocking/{target_user_id}` | Standard | Unblock User |
| [`likePost`](#likepost) | `POST /2/users/{id}/likes` | Standard | Like Post |
| [`muteUser`](#muteuser) | `POST /2/users/{id}/muting` | Standard | Mute User |
| [`pinList`](#pinlist) | `POST /2/users/{id}/pinned_lists` | Standard | Pin List |
| [`repostPost`](#repostpost) | `POST /2/users/{id}/retweets` | Standard | Repost Post |
| [`search`](#search) | `GET /2/users/search` | Paginated | Search Users |
| [`unblockDms`](#unblockdms) | `POST /2/users/{id}/dm/unblock` | Standard | Unblock DMs |
| [`unfollowList`](#unfollowlist) | `DELETE /2/users/{id}/followed_lists/{list_id}` | Standard | Unfollow List |
| [`unfollowUser`](#unfollowuser) | `DELETE /2/users/{source_user_id}/following/{target_user_id}` | Standard | Unfollow User |
| [`unlikePost`](#unlikepost) | `DELETE /2/users/{id}/likes/{tweet_id}` | Standard | Unlike Post |
| [`unmuteUser`](#unmuteuser) | `DELETE /2/users/{source_user_id}/muting/{target_user_id}` | Standard | Unmute User |
| [`unpinList`](#unpinlist) | `DELETE /2/users/{id}/pinned_lists/{list_id}` | Standard | Unpin List |
| [`unrepostPost`](#unrepostpost) | `DELETE /2/users/{id}/retweets/{source_tweet_id}` | Standard | Unrepost Post |

## `blockDms`

POST `/2/users/{id}/dm/block`

**Block DMs**

Blocks direct messages to or from a specific User by their ID for the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().blockDms("2244994945");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Returns:** `Schemas.BlockUsersDmsResponse`

***

## `createBookmark`

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.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().createBookmark(
    "2244994945",
    new Schemas.CreateUsersBookmarkRequest().tweetId("1895000000000000000")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

The authenticated user's numeric ID, not `me`: the `id` from Get My User (`GET /2/users/me`).

**body** `Schemas.CreateUsersBookmarkRequest` *required*

At least one of `tweet_id`, `tweet_ids` is required.

**Returns:** `JsonNode`

***

## `createBookmarkFolder`

POST `/2/users/{id}/bookmarks/folders`

**Create Bookmark Folder**

Creates a new Bookmark folder for the authenticated user.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().createBookmarkFolder(
    "2244994945",
    new Schemas.CreateUsersBookmarkFolderRequest().name("My List")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

The authenticated user's numeric ID, not `me`: the `id` from Get My User (`GET /2/users/me`).

**body** `Schemas.CreateUsersBookmarkFolderRequest` *required*

Request payload.

**Returns:** `Schemas.CreateUsersBookmarkFolderResponse`

***

## `deleteBookmark`

DELETE `/2/users/{id}/bookmarks/{tweet_id}`

**Delete Bookmark**

Removes a Post from the authenticated user's Bookmarks by its ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().deleteBookmark("2244994945", "1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

The authenticated user's numeric ID, not `me`: the `id` from Get My User (`GET /2/users/me`).

**tweetId** `String` *required*

`tweet_id` (path parameter).

**Returns:** `Schemas.DeleteUsersBookmarkResponse`

***

## `followList`

POST `/2/users/{id}/followed_lists`

**Follow List**

Causes the authenticated user to follow a specific List by its ID.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().followList(
    "2244994945",
    new Schemas.FollowListRequest().listId("1450000000000000000")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Schemas.FollowListRequest` *required*

Request payload.

**Returns:** `Schemas.FollowListResponse`

***

## `followUser`

POST `/2/users/{id}/following`

**Follow User**

Causes the authenticated user to follow a specific User by their ID.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().followUser(
    "2244994945",
    new Schemas.FollowUserRequest().targetUserId("2244994945")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Schemas.FollowUserRequest` *required*

Request payload.

**Returns:** `Schemas.FollowUserResponse`

***

## `getAffiliates`

GET `/2/users/{id}/affiliates` Paginated

**Get Affiliates**

Retrieves a list of Users who are affiliated with a specific organization User by their ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().getAffiliatesPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetAffiliatesOptions — 5)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A 64-bit signed integer.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersAffiliatesResponse` (use `getAffiliatesPages(...)` for automatic `Paginator<...>` iteration)

***

## `getBlocking`

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

**Get Blocked Users**

Returns the Users that the given User is blocking.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getBlockingPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetBlockingOptions — 5)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

`pagination_token` (query parameter).

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersBlockingResponse` (use `getBlockingPages(...)` for automatic `Paginator<...>` iteration)

***

## `getBookmarkFolders`

GET `/2/users/{id}/bookmarks/folders` Paginated

**Get Bookmark Folders**

Retrieves a list of Bookmark folders created by the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getBookmarkFoldersPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

The authenticated user's numeric ID, not `me`: the `id` from Get My User (`GET /2/users/me`).

**Optional parameters (UsersClient.GetBookmarkFoldersOptions — 2)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A base32hex-encoded pagination token.

**Returns:** `Schemas.GetUsersBookmarkFoldersResponse` (use `getBookmarkFoldersPages(...)` for automatic `Paginator<...>` iteration)

***

## `getBookmarks`

GET `/2/users/{id}/bookmarks` Paginated

**Get Bookmarks**

Retrieves a list of Posts bookmarked by the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getBookmarksPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

The authenticated user's numeric ID, not `me`: the `id` from Get My User (`GET /2/users/me`).

**Optional parameters (UsersClient.GetBookmarksOptions — 8)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A base32hex-encoded pagination token.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.mediaFields** `List\<String\>`

A comma separated list of Media fields to display.

**options.pollFields** `List\<String\>`

A comma separated list of Poll fields to display.

**options.placeFields** `List\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Schemas.GetUsersBookmarksResponse` (use `getBookmarksPages(...)` for automatic `Paginator<...>` iteration)

***

## `getBookmarksByFolderId`

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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getBookmarksByFolderIdPages("2244994945", "1895000000000000000")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

The authenticated user's numeric ID, not `me`: the `id` from Get My User (`GET /2/users/me`).

**folderId** `String` *required*

`folder_id` (path parameter).

**Optional parameters (UsersClient.GetBookmarksByFolderIdOptions — 2)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A base32hex-encoded pagination token.

**Returns:** `Schemas.GetUsersBookmarksByFolderIdResponse` (use `getBookmarksByFolderIdPages(...)` for automatic `Paginator<...>` iteration)

***

## `getById`

GET `/2/users/{id}`

**Get User by ID**

Retrieves details of a specific User by their ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.users().getById("2244994945");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetByIdOptions — 3)**

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersByIdResponse`

***

## `getByIds`

GET `/2/users`

**Get Users by IDs**

Retrieves details of multiple Users by their IDs.

```java theme={null}
import com.x.xdk.XClient;
import java.util.List;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.users().getByIds(List.of("2244994945"));
System.out.println(response);
```

### Parameters

**ids** `List\<String\>` *required*

`ids` (query parameter).

**Optional parameters (UsersClient.GetByIdsOptions — 3)**

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersByIdsResponse`

***

## `getByUsername`

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

**Get User by Username**

Retrieves details of a specific User by their username.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.users().getByUsername("XDevelopers");
System.out.println(response);
```

### Parameters

**username** `String` *required*

`username` (path parameter).

**Optional parameters (UsersClient.GetByUsernameOptions — 3)**

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersByUsernameResponse`

***

## `getByUsernames`

GET `/2/users/by`

**Get Users by Usernames**

Retrieves details of multiple Users by their usernames.

```java theme={null}
import com.x.xdk.XClient;
import java.util.List;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.users().getByUsernames(List.of("XDevelopers"));
System.out.println(response);
```

### Parameters

**usernames** `List\<String\>` *required*

`usernames` (query parameter).

**Optional parameters (UsersClient.GetByUsernamesOptions — 3)**

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersByUsernamesResponse`

***

## `getFollowedLists`

GET `/2/users/{id}/followed_lists` Paginated

**Get Followed Lists**

Retrieves a list of Lists followed by a specific User by their ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().getFollowedListsPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetFollowedListsOptions — 5)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A 64-bit signed integer.

**options.listFields** `List\<String\>`

A comma separated list of List fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**Returns:** `Schemas.GetUsersFollowedListsResponse` (use `getFollowedListsPages(...)` for automatic `Paginator<...>` iteration)

***

## `getFollowers`

GET `/2/users/{id}/followers` Paginated

**Get Followers**

Retrieves a list of Users who follow a specific User by their ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().getFollowersPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetFollowersOptions — 5)**

**options.maxResults** `Integer`

The maximum number of users to return.

**options.paginationToken** `String`

The next\_token or previous\_token from a previous response, to fetch that page. A base32hex-encoded pagination token.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersFollowersResponse` (use `getFollowersPages(...)` for automatic `Paginator<...>` iteration)

***

## `getFollowing`

GET `/2/users/{id}/following` Paginated

**Get Following**

Retrieves a list of Users followed by a specific User by their ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().getFollowingPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetFollowingOptions — 5)**

**options.maxResults** `Integer`

The maximum number of users to return.

**options.paginationToken** `String`

The next\_token or previous\_token from a previous response, to fetch that page. A base32hex-encoded pagination token.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersFollowingResponse` (use `getFollowingPages(...)` for automatic `Paginator<...>` iteration)

***

## `getLikedPosts`

GET `/2/users/{id}/liked_tweets` Paginated

**Get Liked Posts**

Retrieves a list of Posts liked by a specific User by their ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getLikedPostsPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetLikedPostsOptions — 8)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A base32hex-encoded pagination token.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.mediaFields** `List\<String\>`

A comma separated list of Media fields to display.

**options.pollFields** `List\<String\>`

A comma separated list of Poll fields to display.

**options.placeFields** `List\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Schemas.GetUsersLikedPostsResponse` (use `getLikedPostsPages(...)` for automatic `Paginator<...>` iteration)

***

## `getListMemberships`

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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().getListMembershipsPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetListMembershipsOptions — 5)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

`pagination_token` (query parameter).

**options.listFields** `List\<String\>`

A comma separated list of List fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**Returns:** `Schemas.GetUsersListMembershipsResponse` (use `getListMembershipsPages(...)` for automatic `Paginator<...>` iteration)

***

## `getMe`

GET `/2/users/me`

**Get My User**

Retrieves details of the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().getMe();
System.out.println(response);
```

### Parameters

**Optional parameters (UsersClient.GetMeOptions — 3)**

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersMeResponse`

***

## `getMeFollowers`

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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getMeFollowersPages()) {
    System.out.println(page);
}
```

### Parameters

**Optional parameters (UsersClient.GetMeFollowersOptions — 5)**

**options.maxResults** `Integer`

The maximum number of users to return.

**options.paginationToken** `String`

The next\_token or previous\_token from a previous response, to fetch that page. A base32hex-encoded pagination token.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersMeFollowersResponse` (use `getMeFollowersPages(...)` for automatic `Paginator<...>` iteration)

***

## `getMeFollowing`

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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getMeFollowingPages()) {
    System.out.println(page);
}
```

### Parameters

**Optional parameters (UsersClient.GetMeFollowingOptions — 5)**

**options.maxResults** `Integer`

The maximum number of users to return.

**options.paginationToken** `String`

The next\_token or previous\_token from a previous response, to fetch that page. A base32hex-encoded pagination token.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersMeFollowingResponse` (use `getMeFollowingPages(...)` for automatic `Paginator<...>` iteration)

***

## `getMentions`

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`.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().getMentionsPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetMentionsOptions — 12)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A base32hex-encoded pagination token.

**options.startTime** `String`

Must be on or after 2010-11-06.

**options.endTime** `String`

Must be on or after 2010-11-06.

**options.sinceId** `String`

`since_id` (query parameter).

**options.untilId** `String`

`until_id` (query parameter).

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.mediaFields** `List\<String\>`

A comma separated list of Media fields to display.

**options.pollFields** `List\<String\>`

A comma separated list of Poll fields to display.

**options.placeFields** `List\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Schemas.GetUsersMentionsResponse` (use `getMentionsPages(...)` for automatic `Paginator<...>` iteration)

***

## `getMuting`

GET `/2/users/{id}/muting` Paginated

**Get Muting**

Retrieves a list of Users muted by the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getMutingPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetMutingOptions — 5)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

`pagination_token` (query parameter).

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.GetUsersMutingResponse` (use `getMutingPages(...)` for automatic `Paginator<...>` iteration)

***

## `getOwnedLists`

GET `/2/users/{id}/owned_lists` Paginated

**Get Owned Lists**

Retrieves a list of Lists owned by a specific User by their ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().getOwnedListsPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetOwnedListsOptions — 5)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A 64-bit signed integer.

**options.listFields** `List\<String\>`

A comma separated list of List fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**Returns:** `Schemas.GetUsersOwnedListsResponse` (use `getOwnedListsPages(...)` for automatic `Paginator<...>` iteration)

***

## `getPinnedLists`

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

**Get Pinned Lists**

Retrieves a list of Lists pinned by the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().getPinnedLists("2244994945");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetPinnedListsOptions — 3)**

**options.listFields** `List\<String\>`

A comma separated list of List fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**Returns:** `Schemas.GetUsersPinnedListsResponse`

***

## `getPosts`

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`.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().getPostsPages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetPostsOptions — 13)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A base32hex-encoded pagination token.

**options.startTime** `String`

Must be on or after 2010-11-06.

**options.endTime** `String`

Must be on or after 2010-11-06.

**options.sinceId** `String`

`since_id` (query parameter).

**options.untilId** `String`

`until_id` (query parameter).

**options.exclude** `List\<String\>`

`exclude` (query parameter).

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.mediaFields** `List\<String\>`

A comma separated list of Media fields to display.

**options.pollFields** `List\<String\>`

A comma separated list of Poll fields to display.

**options.placeFields** `List\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Schemas.GetUsersPostsResponse` (use `getPostsPages(...)` for automatic `Paginator<...>` iteration)

***

## `getPublicKey`

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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().getPublicKey("2244994945");
System.out.println(response);
```

### Parameters

**id** `String` *required*

Numeric user ID, not `me`. For your own keys, use the `id` from Get My User (`GET /2/users/me`).

**Optional parameters (UsersClient.GetPublicKeyOptions — 1)**

**options.publicKeyFields** `List\<String\>`

A comma separated list of PublicKey fields to display.

**Returns:** `Schemas.GetUsersPublicKeyResponse`

***

## `getPublicKeys`

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.

```java theme={null}
import com.x.xdk.XClient;
import java.util.List;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().getPublicKeys(List.of("2244994945"));
System.out.println(response);
```

### Parameters

**ids** `List\<String\>` *required*

Comma-separated numeric user IDs (1-100), not @usernames.

**Optional parameters (UsersClient.GetPublicKeysOptions — 1)**

**options.publicKeyFields** `List\<String\>`

A comma separated list of PublicKey fields to display.

**Returns:** `Schemas.GetUsersPublicKeysResponse`

***

## `getRepostsOfMe`

GET `/2/users/reposts_of_me` Paginated

**Get Reposts of Me**

Retrieves a list of Posts that repost content from the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getRepostsOfMePages()) {
    System.out.println(page);
}
```

### Parameters

**Optional parameters (UsersClient.GetRepostsOfMeOptions — 8)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A base32hex-encoded pagination token.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.mediaFields** `List\<String\>`

A comma separated list of Media fields to display.

**options.pollFields** `List\<String\>`

A comma separated list of Poll fields to display.

**options.placeFields** `List\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Schemas.GetUsersRepostsOfMeResponse` (use `getRepostsOfMePages(...)` for automatic `Paginator<...>` iteration)

***

## `getTimeline`

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`.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.users().getTimelinePages("2244994945")) {
    System.out.println(page);
}
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional parameters (UsersClient.GetTimelineOptions — 13)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

A base32hex-encoded pagination token.

**options.startTime** `String`

Must be on or after 2010-11-06.

**options.endTime** `String`

Must be on or after 2010-11-06.

**options.sinceId** `String`

`since_id` (query parameter).

**options.untilId** `String`

`until_id` (query parameter).

**options.exclude** `List\<String\>`

`exclude` (query parameter).

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.mediaFields** `List\<String\>`

A comma separated list of Media fields to display.

**options.pollFields** `List\<String\>`

A comma separated list of Poll fields to display.

**options.placeFields** `List\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Schemas.GetUsersTimelineResponse` (use `getTimelinePages(...)` for automatic `Paginator<...>` iteration)

***

## `idBlock`

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.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().idBlock(
    "2244994945",
    new Schemas.UsersIdBlockRequest().targetUserId("2244994945")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Schemas.UsersIdBlockRequest` *required*

Request payload.

**Returns:** `Schemas.UsersIdBlockResponse`

***

## `idUnblock`

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.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().idUnblock("2244994945", "2244994945");
System.out.println(response);
```

### Parameters

**sourceUserId** `String` *required*

`source_user_id` (path parameter).

**targetUserId** `String` *required*

`target_user_id` (path parameter).

**Returns:** `Schemas.UsersIdUnblockResponse`

***

## `likePost`

POST `/2/users/{id}/likes`

**Like Post**

Causes the authenticated user to like a specific Post by its ID.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().likePost(
    "2244994945",
    new Schemas.LikePostRequest().tweetId("1895000000000000000")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Schemas.LikePostRequest` *required*

Request payload.

**Returns:** `Schemas.LikePostResponse`

***

## `muteUser`

POST `/2/users/{id}/muting`

**Mute User**

Causes the authenticated user to mute a specific User by their ID.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().muteUser(
    "2244994945",
    new Schemas.MuteUserRequest().targetUserId("2244994945")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Schemas.MuteUserRequest` *required*

Request payload.

**Returns:** `Schemas.MuteUserResponse`

***

## `pinList`

POST `/2/users/{id}/pinned_lists`

**Pin List**

Causes the authenticated user to pin a specific List by its ID.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().pinList(
    "2244994945",
    new Schemas.PinListRequest().listId("1450000000000000000")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Schemas.PinListRequest` *required*

Request payload.

**Returns:** `Schemas.PinListResponse`

***

## `repostPost`

POST `/2/users/{id}/retweets`

**Repost Post**

Causes the authenticated user to repost a specific Post by its ID.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().repostPost(
    "2244994945",
    new Schemas.RepostPostRequest().tweetId("1895000000000000000")
);
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Schemas.RepostPostRequest` *required*

Request payload.

**Returns:** `Schemas.RepostPostResponse`

***

## `search`

GET `/2/users/search` Paginated

**Search Users**

Retrieves a list of Users matching a search query.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

for (var page : client.users().searchPages("from:XDevelopers")) {
    System.out.println(page);
}
```

### Parameters

**query** `String` *required*

A name or @username (1-50 chars): letters and digits in any language, spaces, and \_ ' . - @ & "

**Optional parameters (UsersClient.SearchOptions — 5)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.nextToken** `String`

`next_token` (query parameter).

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Schemas.SearchUsersResponse` (use `searchPages(...)` for automatic `Paginator<...>` iteration)

***

## `unblockDms`

POST `/2/users/{id}/dm/unblock`

**Unblock DMs**

Unblocks direct messages to or from a specific User by their ID for the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().unblockDms("2244994945");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Returns:** `Schemas.UnblockUsersDmsResponse`

***

## `unfollowList`

DELETE `/2/users/{id}/followed_lists/{list_id}`

**Unfollow List**

Causes the authenticated user to unfollow a List by its ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().unfollowList("2244994945", "1450000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**listId** `String` *required*

`list_id` (path parameter).

**Returns:** `Schemas.UnfollowListResponse`

***

## `unfollowUser`

DELETE `/2/users/{source_user_id}/following/{target_user_id}`

**Unfollow User**

Causes the authenticated user to unfollow a specific user by their ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().unfollowUser("2244994945", "2244994945");
System.out.println(response);
```

### Parameters

**sourceUserId** `String` *required*

`source_user_id` (path parameter).

**targetUserId** `String` *required*

`target_user_id` (path parameter).

**Returns:** `Schemas.UnfollowUserResponse`

***

## `unlikePost`

DELETE `/2/users/{id}/likes/{tweet_id}`

**Unlike Post**

Causes the authenticated user to unlike a specific Post by its ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().unlikePost("2244994945", "1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**tweetId** `String` *required*

`tweet_id` (path parameter).

**Returns:** `Schemas.UnlikePostResponse`

***

## `unmuteUser`

DELETE `/2/users/{source_user_id}/muting/{target_user_id}`

**Unmute User**

Causes the authenticated user to unmute the target user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().unmuteUser("2244994945", "2244994945");
System.out.println(response);
```

### Parameters

**sourceUserId** `String` *required*

`source_user_id` (path parameter).

**targetUserId** `String` *required*

`target_user_id` (path parameter).

**Returns:** `Schemas.UnmuteUserResponse`

***

## `unpinList`

DELETE `/2/users/{id}/pinned_lists/{list_id}`

**Unpin List**

Causes the authenticated user to unpin a List by its ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().unpinList("2244994945", "1450000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**listId** `String` *required*

`list_id` (path parameter).

**Returns:** `Schemas.UnpinListResponse`

***

## `unrepostPost`

DELETE `/2/users/{id}/retweets/{source_tweet_id}`

**Unrepost Post**

Causes the authenticated user to unrepost a specific Post by its ID.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.users().unrepostPost("2244994945", "1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**sourceTweetId** `String` *required*

`source_tweet_id` (path parameter).

**Returns:** `Schemas.UnrepostPostResponse`

***
