> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-24fef6d1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AccountActivityClient

> Reference for the AccountActivityClient class in the X API TypeScript SDK. Methods, parameters, and return types for the X API v2 account activity endpoints.

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`](/xdks/typescript/reference/classes/AccountActivityClient)

Creates a new account activity client instance

#### Parameters

| Name | Type | Description |
| :- | :- | :- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | The main X API client instance |

#### Returns

[`AccountActivityClient`](/xdks/typescript/reference/classes/AccountActivityClient)

#### Defined in

[account\_activity/client.ts:70](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L70)

## Methods

### getSubscriptions

▸ **getSubscriptions**(`webhookId`, `options`): `Promise`\<`Response`>

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. |
| `options` | `Object` | - |
| `options.requestOptions` | `Object` | - |
| `options.requestOptions.raw` | `true` | - |

#### Returns

`Promise`\<`Response`>

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

#### Defined in

[account\_activity/client.ts:115](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L115)

▸ **getSubscriptions**(`webhookId`): `Promise`\<[`SubscriptionsListGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsListGetResponse)>

#### Parameters

| Name | Type |
| :- | :- |
| `webhookId` | `string` |

#### Returns

`Promise`\<[`SubscriptionsListGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsListGetResponse)>

#### Defined in

[account\_activity/client.ts:128](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L128)

***

### deleteSubscription

▸ **deleteSubscription**(`webhookId`, `userId`, `options`): `Promise`\<`Response`>

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. |
| `options` | `Object` | - |
| `options.requestOptions` | `Object` | - |
| `options.requestOptions.raw` | `true` | - |

#### Returns

`Promise`\<`Response`>

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

#### Defined in

[account\_activity/client.ts:217](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L217)

▸ **deleteSubscription**(`webhookId`, `userId`): `Promise`\<[`SubscriptionsDeleteResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsDeleteResponse)>

#### Parameters

| Name | Type |
| :- | :- |
| `webhookId` | `string` |
| `userId` | `string` |

#### Returns

`Promise`\<[`SubscriptionsDeleteResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsDeleteResponse)>

#### Defined in

[account\_activity/client.ts:234](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L234)

***

### validateSubscription

▸ **validateSubscription**(`webhookId`, `options`): `Promise`\<`Response`>

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. |
| `options` | `Object` | - |
| `options.requestOptions` | `Object` | - |
| `options.requestOptions.raw` | `true` | - |

#### Returns

`Promise`\<`Response`>

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

#### Defined in

[account\_activity/client.ts:331](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L331)

▸ **validateSubscription**(`webhookId`): `Promise`\<[`SubscriptionsGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsGetResponse)>

#### Parameters

| Name | Type |
| :- | :- |
| `webhookId` | `string` |

#### Returns

`Promise`\<[`SubscriptionsGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsGetResponse)>

#### Defined in

[account\_activity/client.ts:344](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L344)

***

### createSubscription

▸ **createSubscription**(`webhookId`, `options`): `Promise`\<`Response`>

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` & \{ `requestOptions`: \{ `raw`: `true`  }  } | - |

#### Returns

`Promise`\<`Response`>

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

#### Defined in

[account\_activity/client.ts:435](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L435)

▸ **createSubscription**(`webhookId`, `options?`): `Promise`\<[`SubscriptionsCreateResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsCreateResponse)>

#### Parameters

| Name | Type |
| :- | :- |
| `webhookId` | `string` |
| `options?` | `CreateSubscriptionOptions` |

#### Returns

`Promise`\<[`SubscriptionsCreateResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsCreateResponse)>

#### Defined in

[account\_activity/client.ts:448](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L448)

***

### createReplayJob

▸ **createReplayJob**(`webhookId`, `fromDate`, `toDate`, `options`): `Promise`\<`Response`>

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. |
| `options` | `Object` | - |
| `options.requestOptions` | `Object` | - |
| `options.requestOptions.raw` | `true` | - |

#### Returns

`Promise`\<`Response`>

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

#### Defined in

[account\_activity/client.ts:564](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L564)

▸ **createReplayJob**(`webhookId`, `fromDate`, `toDate`): `Promise`\<[`ReplayJobCreateResponse`](/xdks/typescript/reference/interfaces/Schemas.ReplayJobCreateResponse)>

#### Parameters

| Name | Type |
| :- | :- |
| `webhookId` | `string` |
| `fromDate` | `string` |
| `toDate` | `string` |

#### Returns

`Promise`\<[`ReplayJobCreateResponse`](/xdks/typescript/reference/interfaces/Schemas.ReplayJobCreateResponse)>

#### Defined in

[account\_activity/client.ts:585](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L585)

***

### getSubscriptionCount

▸ **getSubscriptionCount**(`options`): `Promise`\<`Response`>

Get subscription count
Retrieves a count of currently active Account Activity subscriptions.

#### Parameters

| Name | Type |
| :- | :- |
| `options` | `Object` |
| `options.requestOptions` | `Object` |
| `options.requestOptions.raw` | `true` |

#### Returns

`Promise`\<`Response`>

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

#### Defined in

[account\_activity/client.ts:704](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L704)

▸ **getSubscriptionCount**(): `Promise`\<[`SubscriptionsCountGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsCountGetResponse)>

#### Returns

`Promise`\<[`SubscriptionsCountGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsCountGetResponse)>

#### Defined in

[account\_activity/client.ts:713](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L713)
