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

# ListsClient

> Reference for the lists.client Python module in the X API SDK. Client class and methods for calling the lists endpoints of the X API v2.

## ListsClient

Class

Bases: object

Client for lists operations

## Constructors

### `__init__`

#### Parameters

**path.client** `Client`

### `add_member`

Add List member
Adds a User to a specific List by its ID.

#### Parameters

**path.id** `Any`

The ID of the List for which to add a member.

**body.body** `AddMemberRequest`

Request body

### `create`

Create List
Creates a new List for the authenticated user.
body: Request body
:returns: Response data
:rtype: CreateResponse

#### Parameters

**body.body** `CreateRequest`

### `delete`

Delete List
Deletes a specific List owned by the authenticated user by its ID.

#### Parameters

**path.id** `Any`

The ID of the List to delete.

#### Returns

`DeleteResponse` - Response data

### `get_by_id`

Get List by ID
Retrieves details of a specific List by its ID.

#### Parameters

**path.id** `Any`

The ID of the List.

**path.list\_fields** `List or None` (default: None)

A comma separated list of List fields to display.

**path.expansions** `List or None` (default: None)

A comma separated list of fields to expand.

**path.user\_fields** `List or None` (default: None)

A comma separated list of User fields to display.

#### Returns

`GetByIdResponse` - Response data

### `get_followers`

Get List followers
Retrieves a list of Users who follow a specific List by its ID.

#### Parameters

**path.id** `Any`

The ID of the List.

**path.max\_results** `int or None` (default: None)

The maximum number of results.

**path.pagination\_token** `Any or None` (default: None)

This parameter is used to get a specified ‘page’ of results.

**path.user\_fields** `List or None` (default: None)

A comma separated list of User fields to display.

**path.expansions** `List or None` (default: None)

A comma separated list of fields to expand.

**path.tweet\_fields** `List or None` (default: None)

A comma separated list of Tweet fields to display.

#### Returns

`IteratorGetFollowersResponse`

### `get_members`

Get List members
Retrieves a list of Users who are members of a specific List by its ID.

#### Parameters

**path.id** `Any`

The ID of the List.

**path.max\_results** `int or None` (default: None)

The maximum number of results.

**path.pagination\_token** `Any or None` (default: None)

This parameter is used to get a specified ‘page’ of results.

**path.user\_fields** `List or None` (default: None)

A comma separated list of User fields to display.

**path.expansions** `List or None` (default: None)

A comma separated list of fields to expand.

**path.tweet\_fields** `List or None` (default: None)

A comma separated list of Tweet fields to display.

#### Returns

`IteratorGetMembersResponse`

### `get_posts`

Get List Posts
Retrieves a list of Posts associated with a specific List by its ID.

#### Parameters

**path.id** `Any`

The ID of the List.

**path.max\_results** `int or None` (default: None)

The maximum number of results.

**path.pagination\_token** `Any or None` (default: None)

This parameter is used to get the next ‘page’ of results.

**path.tweet\_fields** `List or None` (default: None)

A comma separated list of Tweet fields to display.

**path.expansions** `List or None` (default: None)

A comma separated list of fields to expand.

**path.media\_fields** `List or None` (default: None)

A comma separated list of Media fields to display.

**path.poll\_fields** `List or None` (default: None)

A comma separated list of Poll fields to display.

**path.user\_fields** `List or None` (default: None)

A comma separated list of User fields to display.

**path.place\_fields** `List or None` (default: None)

A comma separated list of Place fields to display.

#### Returns

`IteratorGetPostsResponse`

### `remove_member_by_user_id`

Remove List member
Removes a User from a specific List by its ID and the User’s ID.

#### Parameters

**path.id** `Any`

The ID of the List to remove a member.

**path.user\_id** `Any`

The ID of User that will be removed from the List.

#### Returns

`RemoveMemberByUserIdResponse` - Response data

### `update`

Update List
Updates the details of a specific List owned by the authenticated user by its ID.

#### Parameters

**path.id** `Any`

The ID of the List to modify.

**body.body** `UpdateRequest`

Request body
