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

# アプリケーションの外部への接続一覧

> GET /v2/apps/:app_id/network/outbound で、アプリケーションが過去 15 分間に接続した相手をホスト名ごとに確認します。プラットフォーム、接続数、リクエスト頻度、送信バイト数を含みます。

アプリケーション自身が過去 15 分間に接続した相手を、Square Shield が確認したとおりに、ホスト名ごとに 1 行で返します。エッジ経由でウェブサイトに届くリクエストを示す[ネットワークログ](https://docs.squarecloud.app/ja/api-reference/endpoint/apps/network/logs.md)とは逆方向の情報で、Bot を含むすべてのアプリケーション、すべてのプランで利用できます。

> [!NOTE]
>
> アプリケーションごとに 1 分あたり 10 回までに制限されており、超えると 60 秒間ブロックされます。

**Authorization** `string` *required*

アカウントの API キーです。これは[アカウント設定](https://squarecloud.app/ja/account/security)で確認できます。

`apps:read` [スコープ](https://docs.squarecloud.app/ja/api-reference/authentication.md#スコープ)を持つ API キーが必要です。workspace で共有されているアプリケーションでは、呼び出し元に `manager` または `admin` の[ロール](https://docs.squarecloud.app/ja/api-reference/endpoint/workspace/members/invite.md#ロール)が必要です。

Bot がどこと通信しているかを確認したり、リクエストに関する Square Shield の[警告や停止](https://docs.squarecloud.app/ja/platform/limitations-and-restrictions.md#制限超過ステータス)の原因となったコードを探したりするのに使えます。表示されるホスト名は最大 64 件で、残りは `other` に集計されます。リクエスト頻度と送信バイト数がわかるのは、Discord など Square Shield が監視する外部 API だけで、それ以外では `null` になります。停止中のアプリケーションでは `hosts` が空になります。

## パラメータ

**app\_id** `string` *required*

アプリケーションのID。アプリケーションのダッシュボードのURLで確認できます。

## レスポンス

**status** `string`

呼び出しが成功したかどうかを示します。成功した場合は `success`、失敗した場合は `error` です。

**response** `object`

レスポンスの内容。

**プロパティ**

**window** `object`

対象の 15 分間。`from` と `to` (ISO 8601) で表し、どちらも `null` になることがあります。

**hosts** `object[]`

ホスト名ごとに 1 行、最大 64 件。

**プロパティ**

**host** `string`

ホスト名。`source` が `ip` のときは IP アドレスそのものです。

**platform** `string | null`

Square Shield が把握しているプラットフォーム (`discord` など)。

**source** `string | null`

名前の取得元。`sni`、`quic`、`ech` (アプリケーションが接続を開いたときに送った hello)、`dns` (アプリケーションが行った名前解決)、または `ip` (どちらもなく、`host` はアドレス) です。

**protocol** `string | null`

`tcp` または `quic`。

**connections** `integer`

期間内の新しい接続数。

**requests\_per\_second** `number | null`

1 秒あたりのリクエスト数の推定値。Square Shield が監視する API のみ。

**bytes\_out** `integer | null`

送信バイト数。Square Shield が監視する API のみ。

**first\_seen** `string | null`

期間内の最初の接続 (ISO 8601)。

**last\_seen** `string | null`

期間内の最後の接続 (ISO 8601)。

**destinations** `string[]`

接続先アドレス (`ip:port`) を最大 3 件。`squareweb.app` または `squarecloud.app` のホスト名の背後にある IPv4 アドレスは、最初と最後のオクテットだけが表示されます (`104.XXX.XXX.191:443`)。

**approx** `boolean`

集計が概算のときは `true`。

**other** `object`

`hosts` に入りきらなかった分。ほかのホスト名の数 (`hosts`) と、その新しい接続数 (`connections`) です。

**connections\_per\_minute** `object[]`

期間内の 1 分ごとの新しい接続数。`at` (ISO 8601) と `count` で表します。

```json theme={"system"}
{
  "status": "success",
  "response": {
    "window": { "from": "2026-11-25T14:05:00.000Z", "to": "2026-11-25T14:20:00.000Z" },
    "hosts": [
      {
        "host": "discord.com",
        "platform": "discord",
        "source": "sni",
        "protocol": "tcp",
        "connections": 42,
        "requests_per_second": 11.8,
        "bytes_out": 1843200,
        "first_seen": "2026-11-25T14:05:02.000Z",
        "last_seen": "2026-11-25T14:19:58.000Z",
        "destinations": ["162.159.135.232:443"],
        "approx": false
      }
    ],
    "other": { "hosts": 12, "connections": 31 },
    "connections_per_minute": [
      { "at": "2026-11-25T14:05:00.000Z", "count": 3 },
      { "at": "2026-11-25T14:06:00.000Z", "count": 5 }
    ]
  }
}
```

## 一般的なエラー

| コード | HTTP | 説明 |
| - | - | - |
| `PERMISSION_DENIED` | 403 | workspace で共有されているアプリケーションで、ロールが `manager` でも `admin` でもありません。 |
| `APP_NOT_FOUND` | 404 | アプリケーションが存在しないか、アクセスできません。 |
| `OUTBOUND_UNAVAILABLE` | 409 | 現在、アプリケーションのサーバーで Square Shield が外部への接続を記録していません。後でもう一度お試しください。 |
| `KEEP_CALM` | 429 | このアプリケーションに対する呼び出しが 1 分間に 10 回を超えました。1 分待ってから再試行してください。 |
| `OUTBOUND_FAILED` | 500 | 接続を読み取れませんでした。少し待って再試行してください。 |

## 関連項目

* [ネットワークログ](https://docs.squarecloud.app/ja/api-reference/endpoint/apps/network/logs.md): エッジ経由でウェブサイトに届くリクエスト。
* [制限超過ステータス](https://docs.squarecloud.app/ja/platform/limitations-and-restrictions.md#制限超過ステータス): Square Shield が停止または制限するものと、その修正方法。
* MCP: [`get_outbound_connections`](https://docs.squarecloud.app/ja/mcp/tools)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.