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

# エッジ一覧取得

> 指定したエンティティに接続するエッジ（リレーション）を取得します

# エッジ一覧取得

指定したエンティティIDに接続するエッジ（リレーションシップ）を返します。`/graph/entities` で取得したIDを指定してください。

## リクエスト

```
GET /api/v1/graph/edges?entityIds=id1,id2,id3
```

### ヘッダー

| ヘッダー            | 必須 | 説明                             |
| --------------- | -- | ------------------------------ |
| `Authorization` | はい | `Bearer snorbe_...` 形式の API キー |

### クエリパラメータ

| パラメータ       | 型        | 必須  | 説明                      |
| ----------- | -------- | --- | ----------------------- |
| `entityIds` | `string` | はい  | エンティティIDのカンマ区切り（1〜100個） |
| `type`      | `string` | いいえ | リレーションタイプでフィルタ          |

## レスポンス

```json theme={null}
{
  "edges": [
    {
      "id": "clxxx001",
      "sourceEntityId": "claaa001",
      "targetEntityId": "clbbb001",
      "type": "RELATED_TO",
      "weight": 0.85,
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-03-20T14:22:00.000Z"
    }
  ]
}
```

### レスポンスフィールド

| フィールド                    | 型          | 説明              |
| ------------------------ | ---------- | --------------- |
| `edges`                  | `object[]` | エッジ配列（weight降順） |
| `edges[].id`             | `string`   | エッジ ID          |
| `edges[].sourceEntityId` | `string`   | 始点エンティティ ID     |
| `edges[].targetEntityId` | `string`   | 終点エンティティ ID     |
| `edges[].type`           | `string`   | リレーションタイプ       |
| `edges[].weight`         | `number`   | 重みスコア           |
| `edges[].createdAt`      | `string`   | 作成日時            |
| `edges[].updatedAt`      | `string`   | 更新日時            |

## 使用例

<CodeGroup>
  ```bash cURL theme={null}
  # 指定エンティティに接続するエッジを取得
  curl "https://app.snorbe.deskrex.ai/api/v1/graph/edges?entityIds=claaa001,clbbb001" \
    -H "Authorization: Bearer snorbe_your_api_key_here"

  # リレーションタイプでフィルタ
  curl "https://app.snorbe.deskrex.ai/api/v1/graph/edges?entityIds=claaa001&type=RELATED_TO" \
    -H "Authorization: Bearer snorbe_your_api_key_here"
  ```

  ```python Python theme={null}
  import requests

  resp = requests.get(
      "https://app.snorbe.deskrex.ai/api/v1/graph/edges",
      params={"entityIds": "claaa001,clbbb001"},
      headers={"Authorization": "Bearer snorbe_your_api_key_here"},
  )
  data = resp.json()
  for edge in data["edges"]:
      print(f"{edge['sourceEntityId']} --[{edge['type']}]--> {edge['targetEntityId']} (w={edge['weight']})")
  ```

  ```typescript TypeScript theme={null}
  const params = new URLSearchParams({ entityIds: "claaa001,clbbb001" });
  const resp = await fetch(
    `https://app.snorbe.deskrex.ai/api/v1/graph/edges?${params}`,
    { headers: { Authorization: "Bearer snorbe_your_api_key_here" } },
  );
  const data = await resp.json();
  for (const edge of data.edges) {
    console.log(`${edge.sourceEntityId} --[${edge.type}]--> ${edge.targetEntityId} (w=${edge.weight})`);
  }
  ```
</CodeGroup>

## エラーレスポンス

| HTTP ステータス | コード                 | 説明                            |
| ---------- | ------------------- | ----------------------------- |
| 400        | `BAD_REQUEST`       | entityIds が空、または101個以上指定されている |
| 401        | `UNAUTHORIZED`      | API キーが無効、期限切れ、または未指定         |
| 429        | `TOO_MANY_REQUESTS` | レート制限超過                       |
