> ## 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 |
| :- | :- | :- | :- |
| [`block_dms`](#block_dms) | `POST /2/users/{id}/dm/block` | Standard | Block DMs |
| [`create_bookmark`](#create_bookmark) | `POST /2/users/{id}/bookmarks` | Standard | Create Bookmark |
| [`create_bookmark_folder`](#create_bookmark_folder) | `POST /2/users/{id}/bookmarks/folders` | Standard | Create Bookmark Folder |
| [`delete_bookmark`](#delete_bookmark) | `DELETE /2/users/{id}/bookmarks/{tweet_id}` | Standard | Delete Bookmark |
| [`follow_list`](#follow_list) | `POST /2/users/{id}/followed_lists` | Standard | Follow List |
| [`follow_user`](#follow_user) | `POST /2/users/{id}/following` | Standard | Follow User |
| [`get_affiliates`](#get_affiliates) | `GET /2/users/{id}/affiliates` | Paginated | Get Affiliates |
| [`get_blocking`](#get_blocking) | `GET /2/users/{id}/blocking` | Paginated | Get Blocked Users |
| [`get_bookmark_folders`](#get_bookmark_folders) | `GET /2/users/{id}/bookmarks/folders` | Paginated | Get Bookmark Folders |
| [`get_bookmarks`](#get_bookmarks) | `GET /2/users/{id}/bookmarks` | Paginated | Get Bookmarks |
| [`get_bookmarks_by_folder_id`](#get_bookmarks_by_folder_id) | `GET /2/users/{id}/bookmarks/folders/{folder_id}` | Paginated | Get Bookmarks by Folder ID |
| [`get_by_id`](#get_by_id) | `GET /2/users/{id}` | Standard | Get User by ID |
| [`get_by_ids`](#get_by_ids) | `GET /2/users` | Standard | Get Users by IDs |
| [`get_by_username`](#get_by_username) | `GET /2/users/by/username/{username}` | Standard | Get User by Username |
| [`get_by_usernames`](#get_by_usernames) | `GET /2/users/by` | Standard | Get Users by Usernames |
| [`get_followed_lists`](#get_followed_lists) | `GET /2/users/{id}/followed_lists` | Paginated | Get Followed Lists |
| [`get_followers`](#get_followers) | `GET /2/users/{id}/followers` | Paginated | Get Followers |
| [`get_following`](#get_following) | `GET /2/users/{id}/following` | Paginated | Get Following |
| [`get_liked_posts`](#get_liked_posts) | `GET /2/users/{id}/liked_tweets` | Paginated | Get Liked Posts |
| [`get_list_memberships`](#get_list_memberships) | `GET /2/users/{id}/list_memberships` | Paginated | Get List Memberships |
| [`get_me`](#get_me) | `GET /2/users/me` | Standard | Get My User |
| [`get_me_followers`](#get_me_followers) | `GET /2/users/me/followers` | Paginated | Get the Authenticated User's Followers |
| [`get_me_following`](#get_me_following) | `GET /2/users/me/following` | Paginated | Get the Users the Authenticated User Follows |
| [`get_mentions`](#get_mentions) | `GET /2/users/{id}/mentions` | Paginated | Get Mentions |
| [`get_muting`](#get_muting) | `GET /2/users/{id}/muting` | Paginated | Get Muting |
| [`get_owned_lists`](#get_owned_lists) | `GET /2/users/{id}/owned_lists` | Paginated | Get Owned Lists |
| [`get_pinned_lists`](#get_pinned_lists) | `GET /2/users/{id}/pinned_lists` | Standard | Get Pinned Lists |
| [`get_posts`](#get_posts) | `GET /2/users/{id}/tweets` | Paginated | Get Posts |
| [`get_public_key`](#get_public_key) | `GET /2/users/{id}/public_keys` | Standard | Get User Public Keys |
| [`get_public_keys`](#get_public_keys) | `GET /2/users/public_keys` | Standard | Get Public Keys for Multiple Users |
| [`get_reposts_of_me`](#get_reposts_of_me) | `GET /2/users/reposts_of_me` | Paginated | Get Reposts of Me |
| [`get_timeline`](#get_timeline) | `GET /2/users/{id}/timelines/reverse_chronological` | Paginated | Get Timeline |
| [`id_block`](#id_block) | `POST /2/users/{id}/blocking` | Standard | Block User |
| [`id_unblock`](#id_unblock) | `DELETE /2/users/{source_user_id}/blocking/{target_user_id}` | Standard | Unblock User |
| [`like_post`](#like_post) | `POST /2/users/{id}/likes` | Standard | Like Post |
| [`mute_user`](#mute_user) | `POST /2/users/{id}/muting` | Standard | Mute User |
| [`pin_list`](#pin_list) | `POST /2/users/{id}/pinned_lists` | Standard | Pin List |
| [`repost_post`](#repost_post) | `POST /2/users/{id}/retweets` | Standard | Repost Post |
| [`search`](#search) | `GET /2/users/search` | Paginated | Search Users |
| [`unblock_dms`](#unblock_dms) | `POST /2/users/{id}/dm/unblock` | Standard | Unblock DMs |
| [`unfollow_list`](#unfollow_list) | `DELETE /2/users/{id}/followed_lists/{list_id}` | Standard | Unfollow List |
| [`unfollow_user`](#unfollow_user) | `DELETE /2/users/{source_user_id}/following/{target_user_id}` | Standard | Unfollow User |
| [`unlike_post`](#unlike_post) | `DELETE /2/users/{id}/likes/{tweet_id}` | Standard | Unlike Post |
| [`unmute_user`](#unmute_user) | `DELETE /2/users/{source_user_id}/muting/{target_user_id}` | Standard | Unmute User |
| [`unpin_list`](#unpin_list) | `DELETE /2/users/{id}/pinned_lists/{list_id}` | Standard | Unpin List |
| [`unrepost_post`](#unrepost_post) | `DELETE /2/users/{id}/retweets/{source_tweet_id}` | Standard | Unrepost Post |

## `block_dms`

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

**Block DMs**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.block_dms(id: "2244994945")
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Returns:** `Hash`

***

## `create_bookmark`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.create_bookmark(id: "2244994945", body: { "tweet_id" => "1895000000000000000" })
puts response
```

### Parameters

**id** `String` *required*

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

**body** `Hash` *required*

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

**Returns:** `Hash`

***

## `create_bookmark_folder`

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

**Create Bookmark Folder**

Creates a new Bookmark folder for the authenticated user.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.create_bookmark_folder(id: "2244994945", body: { "name" => "My List" })
puts response
```

### Parameters

**id** `String` *required*

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

**body** `Hash` *required*

Request payload.

**Returns:** `Hash`

***

## `delete_bookmark`

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

**Delete Bookmark**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.delete_bookmark(id: "2244994945", tweet_id: "1895000000000000000")
puts response
```

### Parameters

**id** `String` *required*

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

**tweet\_id** `String` *required*

`tweet_id` (path parameter).

**Returns:** `Hash`

***

## `follow_list`

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

**Follow List**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.follow_list(id: "2244994945", body: { "list_id" => "1450000000000000000" })
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Hash` *required*

Request payload.

**Returns:** `Hash`

***

## `follow_user`

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

**Follow User**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.follow_user(id: "2244994945", body: { "target_user_id" => "2244994945" })
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Hash` *required*

Request payload.

**Returns:** `Hash`

***

## `get_affiliates`

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

**Get Affiliates**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.get_affiliates(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (5)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A 64-bit signed integer.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_blocking`

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

**Get Blocked Users**

Returns the Users that the given User is blocking.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_blocking(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (5)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

`pagination_token` (query parameter).

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_bookmark_folders`

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

**Get Bookmark Folders**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_bookmark_folders(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

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

**Optional keyword arguments (2)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A base32hex-encoded pagination token.

**Returns:** `Enumerator<Hash>`

***

## `get_bookmarks`

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

**Get Bookmarks**

Retrieves a list of Posts bookmarked by the authenticated user.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_bookmarks(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

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

**Optional keyword arguments (8)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A base32hex-encoded pagination token.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**media\_fields** `Array\<String\>`

A comma separated list of Media fields to display.

**poll\_fields** `Array\<String\>`

A comma separated list of Poll fields to display.

**place\_fields** `Array\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_bookmarks_by_folder_id`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_bookmarks_by_folder_id(id: "2244994945", folder_id: "1895000000000000000").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

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

**folder\_id** `String` *required*

`folder_id` (path parameter).

**Optional keyword arguments (2)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A base32hex-encoded pagination token.

**Returns:** `Enumerator<Hash>`

***

## `get_by_id`

GET `/2/users/{id}`

**Get User by ID**

Retrieves details of a specific User by their ID.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

response = client.users.get_by_id(id: "2244994945")
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (3)**

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Hash`

***

## `get_by_ids`

GET `/2/users`

**Get Users by IDs**

Retrieves details of multiple Users by their IDs.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

response = client.users.get_by_ids(ids: ["2244994945"])
puts response
```

### Parameters

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

`ids` (query parameter).

**Optional keyword arguments (3)**

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Hash`

***

## `get_by_username`

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

**Get User by Username**

Retrieves details of a specific User by their username.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

response = client.users.get_by_username(username: "XDevelopers")
puts response
```

### Parameters

**username** `String` *required*

`username` (path parameter).

**Optional keyword arguments (3)**

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Hash`

***

## `get_by_usernames`

GET `/2/users/by`

**Get Users by Usernames**

Retrieves details of multiple Users by their usernames.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

response = client.users.get_by_usernames(usernames: ["XDevelopers"])
puts response
```

### Parameters

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

`usernames` (query parameter).

**Optional keyword arguments (3)**

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Hash`

***

## `get_followed_lists`

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

**Get Followed Lists**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.get_followed_lists(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (5)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A 64-bit signed integer.

**list\_fields** `Array\<String\>`

A comma separated list of List fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_followers`

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

**Get Followers**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.get_followers(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (5)**

**max\_results** `Integer`

The maximum number of users to return.

**pagination\_token** `String`

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

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_following`

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

**Get Following**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.get_following(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (5)**

**max\_results** `Integer`

The maximum number of users to return.

**pagination\_token** `String`

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

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_liked_posts`

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

**Get Liked Posts**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_liked_posts(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (8)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A base32hex-encoded pagination token.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**media\_fields** `Array\<String\>`

A comma separated list of Media fields to display.

**poll\_fields** `Array\<String\>`

A comma separated list of Poll fields to display.

**place\_fields** `Array\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_list_memberships`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.get_list_memberships(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (5)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

`pagination_token` (query parameter).

**list\_fields** `Array\<String\>`

A comma separated list of List fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_me`

GET `/2/users/me`

**Get My User**

Retrieves details of the authenticated user.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.get_me
puts response
```

### Parameters

**Optional keyword arguments (3)**

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Hash`

***

## `get_me_followers`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_me_followers.each do |page|
  puts page["data"]
end
```

### Parameters

**Optional keyword arguments (5)**

**max\_results** `Integer`

The maximum number of users to return.

**pagination\_token** `String`

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

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_me_following`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_me_following.each do |page|
  puts page["data"]
end
```

### Parameters

**Optional keyword arguments (5)**

**max\_results** `Integer`

The maximum number of users to return.

**pagination\_token** `String`

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

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_mentions`

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.get_mentions(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (12)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A base32hex-encoded pagination token.

**start\_time** `String`

Must be on or after 2010-11-06.

**end\_time** `String`

Must be on or after 2010-11-06.

**since\_id** `String`

`since_id` (query parameter).

**until\_id** `String`

`until_id` (query parameter).

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**media\_fields** `Array\<String\>`

A comma separated list of Media fields to display.

**poll\_fields** `Array\<String\>`

A comma separated list of Poll fields to display.

**place\_fields** `Array\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_muting`

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

**Get Muting**

Retrieves a list of Users muted by the authenticated user.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_muting(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (5)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

`pagination_token` (query parameter).

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_owned_lists`

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

**Get Owned Lists**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.get_owned_lists(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (5)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A 64-bit signed integer.

**list\_fields** `Array\<String\>`

A comma separated list of List fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_pinned_lists`

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

**Get Pinned Lists**

Retrieves a list of Lists pinned by the authenticated user.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.get_pinned_lists(id: "2244994945")
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (3)**

**list\_fields** `Array\<String\>`

A comma separated list of List fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**Returns:** `Hash`

***

## `get_posts`

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.get_posts(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (13)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A base32hex-encoded pagination token.

**start\_time** `String`

Must be on or after 2010-11-06.

**end\_time** `String`

Must be on or after 2010-11-06.

**since\_id** `String`

`since_id` (query parameter).

**until\_id** `String`

`until_id` (query parameter).

**exclude** `Array\<String\>`

`exclude` (query parameter).

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**media\_fields** `Array\<String\>`

A comma separated list of Media fields to display.

**poll\_fields** `Array\<String\>`

A comma separated list of Poll fields to display.

**place\_fields** `Array\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_public_key`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.get_public_key(id: "2244994945")
puts 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 keyword arguments (1)**

**public\_key\_fields** `Array\<String\>`

A comma separated list of PublicKey fields to display.

**Returns:** `Hash`

***

## `get_public_keys`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.get_public_keys(ids: ["2244994945"])
puts response
```

### Parameters

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

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

**Optional keyword arguments (1)**

**public\_key\_fields** `Array\<String\>`

A comma separated list of PublicKey fields to display.

**Returns:** `Hash`

***

## `get_reposts_of_me`

GET `/2/users/reposts_of_me` Paginated

**Get Reposts of Me**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_reposts_of_me.each do |page|
  puts page["data"]
end
```

### Parameters

**Optional keyword arguments (8)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A base32hex-encoded pagination token.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**media\_fields** `Array\<String\>`

A comma separated list of Media fields to display.

**poll\_fields** `Array\<String\>`

A comma separated list of Poll fields to display.

**place\_fields** `Array\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Enumerator<Hash>`

***

## `get_timeline`

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

client.users.get_timeline(id: "2244994945").each do |page|
  puts page["data"]
end
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Optional keyword arguments (13)**

**max\_results** `Integer`

`max_results` (query parameter).

**pagination\_token** `String`

A base32hex-encoded pagination token.

**start\_time** `String`

Must be on or after 2010-11-06.

**end\_time** `String`

Must be on or after 2010-11-06.

**since\_id** `String`

`since_id` (query parameter).

**until\_id** `String`

`until_id` (query parameter).

**exclude** `Array\<String\>`

`exclude` (query parameter).

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**media\_fields** `Array\<String\>`

A comma separated list of Media fields to display.

**poll\_fields** `Array\<String\>`

A comma separated list of Poll fields to display.

**place\_fields** `Array\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Enumerator<Hash>`

***

## `id_block`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.id_block(id: "2244994945", body: { "target_user_id" => "2244994945" })
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Hash` *required*

Request payload.

**Returns:** `Hash`

***

## `id_unblock`

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.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.id_unblock(source_user_id: "2244994945", target_user_id: "2244994945")
puts response
```

### Parameters

**source\_user\_id** `String` *required*

`source_user_id` (path parameter).

**target\_user\_id** `String` *required*

`target_user_id` (path parameter).

**Returns:** `Hash`

***

## `like_post`

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

**Like Post**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.like_post(id: "2244994945", body: { "tweet_id" => "1895000000000000000" })
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Hash` *required*

Request payload.

**Returns:** `Hash`

***

## `mute_user`

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

**Mute User**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.mute_user(id: "2244994945", body: { "target_user_id" => "2244994945" })
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Hash` *required*

Request payload.

**Returns:** `Hash`

***

## `pin_list`

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

**Pin List**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.pin_list(id: "2244994945", body: { "list_id" => "1450000000000000000" })
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Hash` *required*

Request payload.

**Returns:** `Hash`

***

## `repost_post`

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

**Repost Post**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.repost_post(id: "2244994945", body: { "tweet_id" => "1895000000000000000" })
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**body** `Hash` *required*

Request payload.

**Returns:** `Hash`

***

## `search`

GET `/2/users/search` Paginated

**Search Users**

Retrieves a list of Users matching a search query.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(bearer_token: ENV.fetch("X_BEARER_TOKEN"))

client.users.search(query: "from:XDevelopers").each do |page|
  puts page["data"]
end
```

### Parameters

**query** `String` *required*

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

**Optional keyword arguments (5)**

**max\_results** `Integer`

`max_results` (query parameter).

**next\_token** `String`

`next_token` (query parameter).

**user\_fields** `Array\<String\>`

A comma separated list of User fields to display.

**expansions** `Array\<String\>`

A comma separated list of fields to expand.

**post\_fields** `Array\<String\>`

A comma separated list of Post fields to display.

**Returns:** `Enumerator<Hash>`

***

## `unblock_dms`

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

**Unblock DMs**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.unblock_dms(id: "2244994945")
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Returns:** `Hash`

***

## `unfollow_list`

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

**Unfollow List**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.unfollow_list(id: "2244994945", list_id: "1450000000000000000")
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**list\_id** `String` *required*

`list_id` (path parameter).

**Returns:** `Hash`

***

## `unfollow_user`

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

**Unfollow User**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.unfollow_user(source_user_id: "2244994945", target_user_id: "2244994945")
puts response
```

### Parameters

**source\_user\_id** `String` *required*

`source_user_id` (path parameter).

**target\_user\_id** `String` *required*

`target_user_id` (path parameter).

**Returns:** `Hash`

***

## `unlike_post`

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

**Unlike Post**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.unlike_post(id: "2244994945", tweet_id: "1895000000000000000")
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**tweet\_id** `String` *required*

`tweet_id` (path parameter).

**Returns:** `Hash`

***

## `unmute_user`

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

**Unmute User**

Causes the authenticated user to unmute the target user.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.unmute_user(source_user_id: "2244994945", target_user_id: "2244994945")
puts response
```

### Parameters

**source\_user\_id** `String` *required*

`source_user_id` (path parameter).

**target\_user\_id** `String` *required*

`target_user_id` (path parameter).

**Returns:** `Hash`

***

## `unpin_list`

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

**Unpin List**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.unpin_list(id: "2244994945", list_id: "1450000000000000000")
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**list\_id** `String` *required*

`list_id` (path parameter).

**Returns:** `Hash`

***

## `unrepost_post`

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

**Unrepost Post**

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

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.users.unrepost_post(id: "2244994945", source_tweet_id: "1895000000000000000")
puts response
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**source\_tweet\_id** `String` *required*

`source_tweet_id` (path parameter).

**Returns:** `Hash`

***
