Skip to main content
Client for lists operations This client provides methods for interacting with the lists endpoints of the X API. It handles authentication, request formatting, and response parsing for all lists related operations.

Constructors

constructor

new ListsClient(client): ListsClient Creates a new lists client instance

Parameters

NameTypeDescription
clientClientThe main X API client instance

Returns

ListsClient

Defined in

lists/client.ts:188

Methods

getFollowers

getFollowers(id, options?): Promise<Get2ListsIdFollowersResponse> Get List followers Retrieves a list of Users who follow a specific List by its ID.

Parameters

NameTypeDescription
idstringThe ID of the List.
optionsGetFollowersOptions-

Returns

Promise<Get2ListsIdFollowersResponse> Promise resolving to the API response

Defined in

lists/client.ts:205

getMembers

getMembers(id, options?): Promise<Get2ListsIdMembersResponse> Get List members Retrieves a list of Users who are members of a specific List by its ID.

Parameters

NameTypeDescription
idstringThe ID of the List.
optionsGetMembersOptions-

Returns

Promise<Get2ListsIdMembersResponse> Promise resolving to the API response

Defined in

lists/client.ts:279

addMember

addMember(id, options?): Promise<ListMutateResponse> Add List member Adds a User to a specific List by its ID.

Parameters

NameTypeDescription
idstringThe ID of the List for which to add a member.
optionsAddMemberOptions-

Returns

Promise<ListMutateResponse> Promise resolving to the API response

Defined in

lists/client.ts:353

removeMemberByUserId

removeMemberByUserId(id, userId): Promise<ListMutateResponse> Remove List member Removes a User from a specific List by its ID and the User’s ID.

Parameters

NameTypeDescription
idstringThe ID of the List to remove a member.
userIdstringThe ID of User that will be removed from the List.

Returns

Promise<ListMutateResponse> Promise resolving to the API response

Defined in

lists/client.ts:405

getPosts

getPosts(id, options?): Promise<Get2ListsIdTweetsResponse> Get List Posts Retrieves a list of Posts associated with a specific List by its ID.

Parameters

NameTypeDescription
idstringThe ID of the List.
optionsGetPostsOptions-

Returns

Promise<Get2ListsIdTweetsResponse> Promise resolving to the API response

Defined in

lists/client.ts:448

getById

getById(id, options?): Promise<Get2ListsIdResponse> Get List by ID Retrieves details of a specific List by its ID.

Parameters

NameTypeDescription
idstringThe ID of the List.
optionsGetByIdOptions-

Returns

Promise<Get2ListsIdResponse> Promise resolving to the API response

Defined in

lists/client.ts:540

update

update(id, options?): Promise<ListUpdateResponse> Update List Updates the details of a specific List owned by the authenticated user by its ID.

Parameters

NameTypeDescription
idstringThe ID of the List to modify.
optionsUpdateOptions-

Returns

Promise<ListUpdateResponse> Promise resolving to the API response

Defined in

lists/client.ts:602

delete

delete(id): Promise<ListDeleteResponse> Delete List Deletes a specific List owned by the authenticated user by its ID.

Parameters

NameTypeDescription
idstringThe ID of the List to delete.

Returns

Promise<ListDeleteResponse> Promise resolving to the API response

Defined in

lists/client.ts:650

create

create(options?): Promise<ListCreateResponse> Create List Creates a new List for the authenticated user.

Parameters

NameType
optionsCreateOptions

Returns

Promise<ListCreateResponse> Promise resolving to the API response

Defined in

lists/client.ts:684