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

Constructors

constructor

new SpacesClient(client): SpacesClient Creates a new spaces client instance

Parameters

NameTypeDescription
clientClientThe main X API client instance

Returns

SpacesClient

Defined in

spaces/client.ts:190

Methods

getByIds

getByIds(ids, options?): Promise<Get2SpacesResponse> Get Spaces by IDs Retrieves details of multiple Spaces by their IDs.

Parameters

NameTypeDescription
idsany[]The list of Space IDs to return.
optionsGetByIdsOptions-

Returns

Promise<Get2SpacesResponse> Promise resolving to the API response

Defined in

spaces/client.ts:207
search(query, options?): Promise<Get2SpacesSearchResponse> Search Spaces Retrieves a list of Spaces matching the specified search query.

Parameters

NameTypeDescription
querystringThe search query.
optionsSearchOptions-

Returns

Promise<Get2SpacesSearchResponse> Promise resolving to the API response

Defined in

spaces/client.ts:277

getBuyers

getBuyers(id, options?): Promise<Get2SpacesIdBuyersResponse> Get Space ticket buyers Retrieves a list of Users who purchased tickets to a specific Space by its ID.

Parameters

NameTypeDescription
idstringThe ID of the Space to be retrieved.
optionsGetBuyersOptions-

Returns

Promise<Get2SpacesIdBuyersResponse> Promise resolving to the API response

Defined in

spaces/client.ts:359

getPosts

getPosts(id, options?): Promise<Get2SpacesIdTweetsResponse> Get Space Posts Retrieves a list of Posts shared in a specific Space by its ID.

Parameters

NameTypeDescription
idstringThe ID of the Space to be retrieved.
optionsGetPostsOptions-

Returns

Promise<Get2SpacesIdTweetsResponse> Promise resolving to the API response

Defined in

spaces/client.ts:433

getById

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

Parameters

NameTypeDescription
idstringThe ID of the Space to be retrieved.
optionsGetByIdOptions-

Returns

Promise<Get2SpacesIdResponse> Promise resolving to the API response

Defined in

spaces/client.ts:519

getByCreatorIds

getByCreatorIds(userIds, options?): Promise<Get2SpacesByCreatorIdsResponse> Get Spaces by creator IDs Retrieves details of Spaces created by specified User IDs.

Parameters

NameTypeDescription
userIdsany[]The IDs of Users to search through.
optionsGetByCreatorIdsOptions-

Returns

Promise<Get2SpacesByCreatorIdsResponse> Promise resolving to the API response

Defined in

spaces/client.ts:587