> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ConnectionsClient

> Reference for the ConnectionsClient class in the X API TypeScript SDK. Methods, parameters, and return types for the X API v2 connections endpoints.

Client for connections operations

This client provides methods for interacting with the connections endpoints
of the X API. It handles authentication, request formatting, and response
parsing for all connections related operations.

## Constructors

### constructor

• **new ConnectionsClient**(`client`): [`ConnectionsClient`](/xdks/typescript/reference/classes/ConnectionsClient)

Creates a new connections client instance

#### Parameters

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

#### Returns

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

#### Defined in

[connections/client.ts:88](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/connections/client.ts#L88)

## Methods

### getConnectionHistory

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

Get Connection History
Returns active and historical streaming connections with disconnect reasons for the authenticated application.

#### Parameters

| Name      | Type                                                                        |
| :-------- | :-------------------------------------------------------------------------- |
| `options` | `GetConnectionHistoryOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } |

#### Returns

`Promise`\<`Response`>

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

#### Defined in

[connections/client.ts:129](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/connections/client.ts#L129)

▸ **getConnectionHistory**(`options?`): `Promise`\<[`Get2ConnectionsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2ConnectionsResponse)>

#### Parameters

| Name       | Type                          |
| :--------- | :---------------------------- |
| `options?` | `GetConnectionHistoryOptions` |

#### Returns

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

#### Defined in

[connections/client.ts:138](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/connections/client.ts#L138)

***

### deleteAll

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

Terminate all connections
Terminates all active streaming connections for the authenticated application.

#### 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

[connections/client.ts:318](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/connections/client.ts#L318)

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

#### Returns

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

#### Defined in

[connections/client.ts:327](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/connections/client.ts#L327)
