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:316

Methods

getByIds

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

Parameters

NameTypeDescription
idsany[]The list of Space IDs to return.
optionsGetByIdsOptions & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

spaces/client.ts:361 getByIds(ids, options?): Promise<Get2SpacesResponse>

Parameters

NameType
idsany[]
options?GetByIdsOptions

Returns

Promise<Get2SpacesResponse>

Defined in

spaces/client.ts:374

getPosts

getPosts(id, options): Promise<Response> 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 & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

spaces/client.ts:572 getPosts(id, options?): Promise<Get2SpacesIdTweetsResponse>

Parameters

NameType
idstring
options?GetPostsOptions

Returns

Promise<Get2SpacesIdTweetsResponse>

Defined in

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

Parameters

NameTypeDescription
querystringThe search query.
optionsSearchOptions & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

spaces/client.ts:835 search(query, options?): Promise<Get2SpacesSearchResponse>

Parameters

NameType
querystring
options?SearchOptions

Returns

Promise<Get2SpacesSearchResponse>

Defined in

spaces/client.ts:848

getBuyers

getBuyers(id, options): Promise<Response> 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 & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

spaces/client.ts:1080 getBuyers(id, options?): Promise<Get2SpacesIdBuyersResponse>

Parameters

NameType
idstring
options?GetBuyersOptions

Returns

Promise<Get2SpacesIdBuyersResponse>

Defined in

spaces/client.ts:1093

getById

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

Parameters

NameTypeDescription
idstringThe ID of the Space to be retrieved.
optionsGetByIdOptions & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

spaces/client.ts:1293 getById(id, options?): Promise<Get2SpacesIdResponse>

Parameters

NameType
idstring
options?GetByIdOptions

Returns

Promise<Get2SpacesIdResponse>

Defined in

spaces/client.ts:1306

getByCreatorIds

getByCreatorIds(userIds, options): Promise<Response> 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 & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

spaces/client.ts:1495 getByCreatorIds(userIds, options?): Promise<Get2SpacesByCreatorIdsResponse>

Parameters

NameType
userIdsany[]
options?GetByCreatorIdsOptions

Returns

Promise<Get2SpacesByCreatorIdsResponse>

Defined in

spaces/client.ts:1508