创建工作区
OpenAPI 契约
- 方法
- POST
- 路径
/api/v1/workspaces- 认证
- jwtBearer (bearer)
- 响应状态
- 201 400 401 403 404 409 429 500
请求与响应 Schema
JSON
{
"requestBody": {
"application/json": {
"$ref": "#/components/schemas/CreateWorkspaceRequest"
}
},
"responses": {
"201": {
"description": "Workspace created",
"content": {
"application/json": {
"$ref": "#/components/schemas/WorkspaceResponse"
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"$ref": "#/components/schemas/RequestError"
}
}
},
"401": {
"description": "Authentication required or invalid",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"403": {
"description": "Authenticated but not permitted",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"404": {
"description": "Requested workspace resource was not found",
"content": {
"application/json": {
"$ref": "#/components/schemas/ApiError"
}
}
},
"409": {
"description": "Request conflicts with current workspace state",
"content": {
"application/json": {
"$ref": "#/components/schemas/ApiError"
}
}
},
"429": {
"description": "Rate limit exceeded",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"500": {
"description": "Unexpected server error",
"content": {
"application/json": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}POST /api/v1/workspaces 仅限 JWT,并且需要组织管理权限。提交非空且最多 100 个字符的 name,以及可选的 organizationId。未提供 organizationId 时,服务使用调用方的个人组织。名称会被裁剪,并且在组织内忽略大小写后必须唯一。
创建者会获得有效的 ADMIN 工作区成员资格。重复名称返回冲突;调用方无权管理的组织不会被暴露。nfy_ 自动化密钥不能创建工作区。
json
{"name":"Release engineering","organizationId":"00000000-0000-0000-0000-000000000000"}