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

Constructors

constructor

new AccountActivityClient(client): AccountActivityClient Creates a new account activity client instance

Parameters

NameTypeDescription
clientClientThe main X API client instance

Returns

AccountActivityClient

Defined in

account_activity/client.ts:54

Methods

getSubscriptions

getSubscriptions(webhookId): Promise<SubscriptionsListGetResponse> Get subscriptions Retrieves a list of all active subscriptions for a given webhook.

Parameters

NameTypeDescription
webhookIdstringThe webhook ID to pull subscriptions for.

Returns

Promise<SubscriptionsListGetResponse> Promise resolving to the API response

Defined in

account_activity/client.ts:71

createReplayJob

createReplayJob(webhookId, fromDate, toDate): Promise<ReplayJobCreateResponse> Create replay job Creates a replay job to retrieve activities from up to the past 5 days for all subscriptions associated with a given webhook.

Parameters

NameTypeDescription
webhookIdstringThe unique identifier for the webhook configuration.
fromDatestringThe oldest (starting) UTC timestamp (inclusive) from which events will be provided, in yyyymmddhhmm format.
toDatestringThe latest (ending) UTC timestamp (exclusive) up to which events will be provided, in yyyymmddhhmm format.

Returns

Promise<ReplayJobCreateResponse> Promise resolving to the API response

Defined in

account_activity/client.ts:118

validateSubscription

validateSubscription(webhookId): Promise<SubscriptionsGetResponse> Validate subscription Checks a user’s Account Activity subscription for a given webhook.

Parameters

NameTypeDescription
webhookIdstringThe webhook ID to check subscription against.

Returns

Promise<SubscriptionsGetResponse> Promise resolving to the API response

Defined in

account_activity/client.ts:169

createSubscription

createSubscription(webhookId, options?): Promise<SubscriptionsCreateResponse> Create subscription Creates an Account Activity subscription for the user and the given webhook.

Parameters

NameTypeDescription
webhookIdstringThe webhook ID to check subscription against.
optionsCreateSubscriptionOptions-

Returns

Promise<SubscriptionsCreateResponse> Promise resolving to the API response

Defined in

account_activity/client.ts:209

deleteSubscription

deleteSubscription(webhookId, userId): Promise<SubscriptionsDeleteResponse> Delete subscription Deletes an Account Activity subscription for the given webhook and user ID.

Parameters

NameTypeDescription
webhookIdstringThe webhook ID to check subscription against.
userIdstringUser ID to unsubscribe from.

Returns

Promise<SubscriptionsDeleteResponse> Promise resolving to the API response

Defined in

account_activity/client.ts:261

getSubscriptionCount

getSubscriptionCount(): Promise<SubscriptionsCountGetResponse> Get subscription count Retrieves a count of currently active Account Activity subscriptions.

Returns

Promise<SubscriptionsCountGetResponse> Promise resolving to the API response

Defined in

account_activity/client.ts:301