POST管理接口
创建版本
为指定项目新增版本。
URL
/api/v1/admin/projects/{projectKey}/versions鉴权方式
需要管理员 JWT 或 API Key,二者等价(Authorization: Bearer <token>)
请求参数
Path 参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| projectKey | string | 是 | 项目主键 project_key(大小写不敏感) |
Header 参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| Authorization | string | 是 | Bearer <管理员 JWT 或 API Key> |
请求体
{
"version": "1.2.0",
"comparable_version": "1.2.0",
"title": "稳定版",
"content": "修复若干问题并优化更新检查。",
"download_links": [
{
"url": "https://example.com/download/verhub-1.2.0.zip",
"name": "Windows 包",
"platform": "windows"
}
],
"is_latest": true,
"is_preview": false,
"is_milestone": false,
"is_deprecated": false,
"published_at": 1760000000,
"platforms": [
"windows",
"mac"
]
}响应示例
201 响应
{
"id": "ver-001",
"version": "1.0.0",
"comparable_version": "1.0.0",
"title": "首发版本",
"content": "首个正式版本,支持版本发布与公告推送。",
"download_url": "https://example.com/download/verhub-1.0.0.zip",
"download_links": [
{
"url": "https://example.com/download/verhub-1.0.0.zip",
"name": "Windows 包",
"platform": "windows"
}
],
"forced": false,
"is_latest": true,
"is_preview": false,
"is_milestone": true,
"is_deprecated": false,
"platform": "windows",
"platforms": [
"windows",
"mac"
],
"custom_data": {
"channel": "stable"
},
"created_at": 1760000000,
"published_at": 1760000000
}POST
