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

# ストリーム接続

> Stream Connections エンドポイントを使用すると、アプリケーションのストリーミング履歴を取得できます。X API v2 standard tier の connections に関するリファレンスです。

Stream Connections エンドポイントを使用すると、アプリケーションのストリーミング接続履歴を取得し、アクティブな接続や複数の接続を終了できます。これらを使って接続状態を監視したり、重複接続などの問題を解決したり、Filtered Stream や Sampled Stream などのエンドポイントのストリーミングセッションを管理したりできます。

<Note>
  これらのエンドポイントは [Bearer Token 認証](/fundamentals/authentication/oauth-2-0/application-only)を必要とし、ストリーミングエンドポイントへのアクセスを持つアプリで利用できます。
</Note>

## 概要

<CardGroup cols={2}>
  <Card title="接続履歴" icon="history">
    アクティブおよび過去の接続を表示
  </Card>

  <Card title="すべて終了" icon="power-off">
    アクティブなすべてのストリーミング接続を終了
  </Card>

  <Card title="エンドポイントで終了" icon="https://mintcdn.com/x-preview/szd6PKNMlRQoyyAo/icons/xds/icon-filter.svg?fit=max&auto=format&n=szd6PKNMlRQoyyAo&q=85&s=5d59aff402c1f2aeae0e9e44bb23400e" width="24" height="24" data-path="icons/xds/icon-filter.svg">
    特定のストリームの接続を停止
  </Card>

  <Card title="複数を終了" icon="list-check">
    UUID で特定の接続を終了
  </Card>
</CardGroup>

***

## エンドポイント

| Method | Endpoint                                                                               | 説明                      |
| :----- | :------------------------------------------------------------------------------------- | :---------------------- |
| GET    | [`/2/connections`](/x-api/connections/get-connection-history)                          | アクティブおよび履歴のストリーミング接続を取得 |
| DELETE | [`/2/connections/all`](/x-api/connections/terminate-all-connections)                   | アクティブなすべての接続を終了         |
| DELETE | [`/2/connections/{endpoint_id}`](/x-api/connections/terminate-connections-by-endpoint) | 特定のエンドポイントの接続を終了        |
| DELETE | [`/2/connections`](/x-api/connections/terminate-multiple-connections)                  | UUID で複数の接続を終了          |

***

## ユースケース

* **切断のトラブルシューティング** — 履歴を確認して問題を診断 ([切断処理を参照](/x-api/fundamentals/handling-disconnections))
* **接続数制限の順守** — 重複または過剰な接続を終了
* **セッションのクリーンアップ** — メンテナンスや再デプロイの前にすべてのストリームを停止
* **使用状況の監視** — filtered\_stream、sample\_stream などのエンドポイントにわたる接続パターンを追跡

***

## はじめに

<Note>
  **前提条件**

  * 承認済みの[開発者アカウント](https://developer.x.com/en/portal/petition/essential/basic-info)
  * ストリーミングアクセスを持つ Developer Console の[プロジェクトとアプリ](/fundamentals/developer-apps)
  * アプリの [Bearer Token](/fundamentals/authentication/oauth-2-0/application-only)
</Note>

<CardGroup cols={2}>
  <Card title="API リファレンス" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-code.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=488e23401b19225b89acc0136d242219" href="/x-api/connections/get-connection-history" width="24" height="24" data-path="icons/xds/icon-code.svg">
    完全なエンドポイントドキュメント
  </Card>

  <Card title="ストリーミングの基礎" icon="stream" href="/x-api/fundamentals/consuming-streaming-data">
    ストリーミングについて学ぶ
  </Card>
</CardGroup>
