# Workspace 下的 Agent

`GET` `/v1/ai/workspaces/{workspace_id}/agents`

獲取指定 Workspace 下的 Agent 列表。返回的 `uid` 即 [發起對話](/zh-HK/docs/ai/chat/conversation) 接口路徑中的 Agent 標識；只有 `is_published` 為 `true` 的 Agent 才能發起對話。

## Parameters

### Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | Yes | 工作區 ID |

### Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `page` | integer | No | 頁碼，從 1 開始，默認 1 |
| `limit` | integer | No | 每頁數量，默認 20 |

## Request Example

```bash
curl --request GET \
  --url 'https://openapi.longbridge.com/v1/ai/workspaces/<workspace_id>/agents' \
  --header 'Authorization: Bearer <access_token>'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agents` | object[] | Yes | Agent 列表 |
| `└ uid` | string | Yes | Agent UID，用於 [發起對話](/zh-HK/docs/ai/chat/conversation) 的路徑參數 |
| `└ name` | string | Yes | Agent 名稱 |
| `└ description` | string | No | Agent 描述 |
| `└ mode` | string | Yes | Agent 模式，如 `chat` |
| `└ icon` | string | No | 圖標 URL |
| `└ is_published` | boolean | Yes | 是否已發佈，僅已發佈的 Agent 可發起對話 |
| `└ published_at` | int64 | No | 發佈時間，Unix 時間戳（秒），未發佈為 0 |
| `└ created_at` | int64 | No | 創建時間，Unix 時間戳（秒） |
| `└ updated_at` | int64 | No | 最後更新時間，Unix 時間戳（秒） |
| `total` | int32 | Yes | 符合條件的 Agent 總數 |

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "agents": [
      {
        "uid": "ag_7d3f9b2c",
        "name": "US Stock Analyst",
        "description": "Answers US stock questions with market and fundamental data",
        "mode": "chat",
        "icon": "https://cdn.longbridge.com/icons/agent.png",
        "is_published": true,
        "published_at": 1742000000,
        "created_at": 1741000000,
        "updated_at": 1742001000
      }
    ],
    "total": 12
  }
}
```
