Constructors
constructor
• new AccountActivityClient(client): AccountActivityClient
Creates a new account activity client instance
Parameters
| Name | Type | Description | 
|---|---|---|
client | Client | The main X API client instance | 
Returns
AccountActivityClient
Defined in
account_activity/client.ts:54Methods
getSubscriptions
▸ getSubscriptions(webhookId): Promise<SubscriptionsListGetResponse>
Get subscriptions
Retrieves a list of all active subscriptions for a given webhook.
Parameters
| Name | Type | Description | 
|---|---|---|
webhookId | string | The webhook ID to pull subscriptions for. | 
Returns
Promise<SubscriptionsListGetResponse>
Promise resolving to the API response
Defined in
account_activity/client.ts:71createReplayJob
▸ 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
| Name | Type | Description | 
|---|---|---|
webhookId | string | The unique identifier for the webhook configuration. | 
fromDate | string | The oldest (starting) UTC timestamp (inclusive) from which events will be provided, in yyyymmddhhmm format. | 
toDate | string | The 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:118validateSubscription
▸ validateSubscription(webhookId): Promise<SubscriptionsGetResponse>
Validate subscription
Checks a user’s Account Activity subscription for a given webhook.
Parameters
| Name | Type | Description | 
|---|---|---|
webhookId | string | The webhook ID to check subscription against. | 
Returns
Promise<SubscriptionsGetResponse>
Promise resolving to the API response
Defined in
account_activity/client.ts:169createSubscription
▸ createSubscription(webhookId, options?): Promise<SubscriptionsCreateResponse>
Create subscription
Creates an Account Activity subscription for the user and the given webhook.
Parameters
| Name | Type | Description | 
|---|---|---|
webhookId | string | The webhook ID to check subscription against. | 
options | CreateSubscriptionOptions | - | 
Returns
Promise<SubscriptionsCreateResponse>
Promise resolving to the API response
Defined in
account_activity/client.ts:209deleteSubscription
▸ deleteSubscription(webhookId, userId): Promise<SubscriptionsDeleteResponse>
Delete subscription
Deletes an Account Activity subscription for the given webhook and user ID.
Parameters
| Name | Type | Description | 
|---|---|---|
webhookId | string | The webhook ID to check subscription against. | 
userId | string | User ID to unsubscribe from. | 
Returns
Promise<SubscriptionsDeleteResponse>
Promise resolving to the API response
Defined in
account_activity/client.ts:261getSubscriptionCount
▸ getSubscriptionCount():Promise<SubscriptionsCountGetResponse>
Get subscription count
Retrieves a count of currently active Account Activity subscriptions.
Returns
Promise<SubscriptionsCountGetResponse>
Promise resolving to the API response