GET/api/v1/sites查询站点列表
Try it 面板需要启用 JavaScript。
全量查询已注册站点,可按域名过滤。
Request
| Name | Data Type | Required | Description |
| Authorization | string | Yes | Bearer Token 认证,格式 `Bearer <token>` |
type RequestHeaders = {
/** Bearer Token 认证,格式 `Bearer <token>` */
Authorization: string
}
{
"Authorization": "Bearer <token>"
}
Query Parameters
| Name | Data Type | Required | Description |
| domain | string | No | 按域名精确匹配过滤 |
type QueryParams = {
/** 按域名精确匹配过滤 */
domain?: string
}
{
"domain": "docs.example.com"
}
Response
Body
| Name | Data Type | Required | Description |
| name | string | Yes | 站点名,全局唯一 |
| domain | string | No | 绑定域名,缺省时站点仅可经路径前缀访问 |
| sourceKind | string | Yes | 来源类型 |
| sourceUrl | string | No | git 仓库地址,sourceKind 为 `git` 时存在 |
| ref | string | No | git 分支或标签,sourceKind 为 `git` 时存在 |
| pages | number | Yes | 站点页面总数 |
| builtAt | string | Yes | 最近一次构建完成时间,ISO 8601 格式 |
type SiteDTO = {
/** 站点名,全局唯一 */
name: string
/** 绑定域名,缺省时站点仅可经路径前缀访问 */
domain?: string
/** 来源类型 */
sourceKind: 'git' | 'artifact'
/** git 仓库地址,sourceKind 为 `git` 时存在 */
sourceUrl?: string
/** git 分支或标签,sourceKind 为 `git` 时存在 */
ref?: string
/** 站点页面总数 */
pages: number
/** 最近一次构建完成时间,ISO 8601 格式 */
builtAt: string
}
{
"name": "my-docs",
"domain": "docs.example.com",
"sourceKind": "git",
"sourceUrl": "https://github.com/acme/docs.git",
"ref": "main",
"pages": 42,
"builtAt": "2026-01-12T08:30:00.000Z"
}
HTTP Code
| HTTP Status |
Meaning |
Notes |
| 200 |
成功 |
返回匹配的站点列表 |
Response Code
响应为统一响应包装(见 响应格式),其中 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回匹配的站点列表 |
Examples
GET /api/v1/sites?domain=docs.example.com HTTP/1.1
Authorization: Bearer <token>
{
"id": "b0f2c1d4-5e6a-4b7c-8d9e-0f1a2b3c4d5e",
"code": 0,
"messages": [],
"result": [
{
"name": "my-docs",
"domain": "docs.example.com",
"sourceKind": "git",
"sourceUrl": "https://github.com/acme/docs.git",
"ref": "main",
"pages": 42,
"builtAt": "2026-01-12T08:30:00.000Z"
}
]
}
result 为数组,全量返回所有已注册站点;站点数量大时不带 domain 过滤的请求返回体量随之增大。