# 取得單一知識版本資料

此 API 用於取得指定 Fileset 的詳細資訊。  
透過 `fileset_id`，你可以查詢該 Fileset 的基本屬性、包含的檔案數量、建立時間、更新時間，以及是否已被提交（commit）成知識版本。Commit 後可輪詢此 API 的 `state` 與 `file_counts` 追蹤處理進度。

```bash
curl -X 'GET' \
  'http://127.0.0.1:8000/v1/filesets/{fileset_id}' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer $PRIVAI_API_KEY"
```

#### Request Headers

| Key | Value |
| --- | --- |
| Request Method | GET |
| accept | application/json |
| Authorization | `Bearer $PRIVAI_API_KEY` |

#### Path Parameters

| Field | Type | Note | Required |
| --- | --- | --- | --- |
| fileset_id | string | uuid | true |

#### Response Body

```json
{
  "object": "fileset",
  "id": "af8877f9-25ec-41db-8872-c872cd5c34b2",
  "name": "test1",
  "metadata": {
    "tag": ["policy", "operation"],
    "embedding_model": "apmic-embedding-v1",
    "parsing_mode": "HQ"
  },
  "state": "partial_failed",
  "created_at": "2025-12-02T03:18:11.333632Z",
  "committed_at": "2025-12-02T06:02:58.964148Z",
  "updated_at": "2025-12-02T06:03:16.573779Z",
  "file_counts": {
    "draft": 0,
    "queued": 0,
    "processing": 0,
    "completed": 4,
    "failed": 2,
    "total": 6
  }
}
```

**Field Explanation**  
回傳「[知識版本物件](https://privstation-docs.apmic.ai/latest/privai-400/知識版本物件.md)」章節列表內容。

#### 常見錯誤代碼

| Error Code | HTTP Status | 情境 |
| --- | --- | --- |
| FILESET_001 | 404 | 指定的 Fileset 不存在 |

身份驗證錯誤（`AUTH_001`～`AUTH_003`）詳見「錯誤代碼說明-身份驗證類」章節；知識版本相關錯誤碼完整說明請參考 [錯誤代碼說明-知識版本管理類](https://privstation-docs.apmic.ai/latest/privai-400/錯誤代碼說明-知識版本管理類.md)。
