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

# ソース詳細取得

> 指定したソースの詳細情報（本文テキスト、抽出されたリンク、リンクされたエンティティを含む）を取得します

# ソース詳細取得

指定したソース（public または private）の詳細情報を返します。本文テキスト全体、本文から抽出されたリンク、リンクされたエージェント実行、リンクされたエンティティを含みます。

## リクエスト

```
GET /api/v1/graph/source/{sourceId}?sourceType=public
```

### パスパラメータ

| パラメータ      | 型        | 説明     |
| ---------- | -------- | ------ |
| `sourceId` | `string` | ソース ID |

### クエリパラメータ

| パラメータ        | 型        | 必須 | 説明                            |
| ------------ | -------- | -- | ----------------------------- |
| `sourceType` | `string` | はい | ソース種別: `public` または `private` |

### ヘッダー

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

<Note>
  ワークスペースは API キーに紐づくものが自動的に使用されます。`workspaceId` パラメータは不要です。
</Note>

## レスポンス

```json theme={null}
{
  "id": "clsrc001",
  "url": "https://example.com/research-paper",
  "title": "Advances in Solid-State Battery Technology",
  "description": "A comprehensive review of recent developments...",
  "body": "Solid-state batteries have emerged as a promising alternative...",
  "bodyLinks": [
    {
      "title": "Related Study",
      "url": "https://example.com/related-study",
      "type": "external"
    }
  ],
  "sourceType": "public",
  "createdAt": "2026-03-10T08:00:00.000Z",
  "agentRuns": [
    {
      "id": "clrun001",
      "status": "completed",
      "createdAt": "2026-04-01T09:00:00.000Z",
      "linkedEntityIds": ["clxxx001", "clxxx002"],
      "turnId": "clturn001"
    }
  ],
  "linkedEntities": [
    {
      "id": "clxxx001",
      "label": "Solid-State Battery",
      "category": "technology",
      "kind": "entity"
    }
  ]
}
```

ソースがワークスペースに存在しない場合は `null` を返します。

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

| フィールド                         | 型                | 説明                                         |
| ----------------------------- | ---------------- | ------------------------------------------ |
| `id`                          | `string`         | ソース ID                                     |
| `url`                         | `string`         | ソース URL                                    |
| `title`                       | `string`         | ソースタイトル                                    |
| `description`                 | `string`         | ソースの説明                                     |
| `body`                        | `string`         | ソースの本文テキスト全文                               |
| `bodyLinks`                   | `object[]`       | 本文から抽出されたリンク                               |
| `bodyLinks[].title`           | `string`         | リンクタイトル                                    |
| `bodyLinks[].url`             | `string`         | リンク URL                                    |
| `bodyLinks[].type`            | `string`         | リンクタイプ（例: `external`）                      |
| `sourceType`                  | `string`         | ソース種別（`public` または `private`）              |
| `createdAt`                   | `string`         | 作成日時（ISO 8601）                             |
| `agentRuns`                   | `object[]`       | このソースを使用したエージェント実行                         |
| `agentRuns[].id`              | `string`         | エージェント実行 ID                                |
| `agentRuns[].status`          | `string`         | 実行ステータス（`completed`, `running`, `error` 等） |
| `agentRuns[].createdAt`       | `string`         | 実行の作成日時（ISO 8601）                          |
| `agentRuns[].linkedEntityIds` | `string[]`       | このエージェント実行にリンクされたエンティティ ID                 |
| `agentRuns[].turnId`          | `string \| null` | このエージェント実行に紐づくターン ID                       |
| `linkedEntities`              | `object[]`       | このソースから抽出またはリンクされたエンティティ                   |
| `linkedEntities[].id`         | `string`         | エンティティ ID                                  |
| `linkedEntities[].label`      | `string`         | エンティティ名                                    |
| `linkedEntities[].category`   | `string`         | エンティティカテゴリ                                 |
| `linkedEntities[].kind`       | `string`         | エンティティ種別                                   |

## 使用例

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://app.snorbe.deskrex.ai/api/v1/graph/source/clsrc001?sourceType=public" \
    -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/source/clsrc001",
      params={"sourceType": "public"},
      headers={"Authorization": "Bearer snorbe_your_api_key_here"},
  )
  data = resp.json()
  if data:
      print(f"Source: {data['title']}")
      print(f"URL: {data['url']}")
      print(f"Body length: {len(data['body'])} chars")
      print(f"Links: {len(data['bodyLinks'])}")
      print(f"Agent Runs: {len(data['agentRuns'])}")
      print(f"Entities: {len(data['linkedEntities'])}")
  else:
      print("Source not found")
  ```

  ```typescript TypeScript theme={null}
  const params = new URLSearchParams({ sourceType: "public" });
  const resp = await fetch(
    `https://app.snorbe.deskrex.ai/api/v1/graph/source/clsrc001?${params}`,
    { headers: { Authorization: "Bearer snorbe_your_api_key_here" } },
  );
  const data = await resp.json();
  if (data) {
    console.log(`Source: ${data.title}`);
    console.log(`URL: ${data.url}`);
    console.log(`Body length: ${data.body.length} chars`);
    console.log(`Links: ${data.bodyLinks.length}`);
    console.log(`Agent Runs: ${data.agentRuns.length}`);
    console.log(`Entities: ${data.linkedEntities.length}`);
  }
  ```
</CodeGroup>

## エラーレスポンス

| HTTP ステータス | 説明                                        |
| ---------- | ----------------------------------------- |
| 401        | API キーが無効、期限切れ、または未指定                     |
| 403        | アクセス権限がありません（ソースが別のワークスペースまたはユーザーに属しています） |
| 404        | ソースが見つかりません（`null` ボディを返します）              |
