Skip to content

Workspaces API

Workspace endpoints 用于管理 workspaces、members 和 workspace avatar。

GET /api/v2/workspaces

返回当前 account 可访问的 workspaces 列表。

参数:无。

Payload: 无。

响应:WorkspaceViewShort[]

GET /api/v2/workspaces/:fullname

返回一个 workspace。

参数:

参数位置说明
fullnamePathWorkspace fullname.

Payload: 无。

响应:WorkspaceView

PUT /api/v2/workspaces/:fullname

创建新 workspace 或更新已有 workspace。

参数:

参数位置说明
fullnamePathWorkspace fullname. 必须与 payload.fullname 一致。

Payload:

字段必填说明
fullnameWorkspace fullname.
createOnly如果为 true,当 workspace 已存在时 endpoint 会返回错误。
resetInvite重新生成 invite state。
tagsTags 数组。
labelsString labels 对象。
meta.titleworkspace 的可见名称。
meta.avatarAvatar URL。

响应:WorkspaceView

DELETE /api/v2/workspaces/:fullname

删除 workspace。

参数:

参数位置说明
fullnamePathWorkspace fullname.

Payload: 无。

响应:OperationResult

POST /api/v2/workspaces/:fullname/avatar

上传 workspace avatar。

参数:

参数位置说明
fullnamePathWorkspace fullname.

Payload:

字段必填说明
filename原始文件名。
contentType图片 MIME type。
dataBase64 图片数据。

响应:AvatarUploadResult

GET /api/v2/workspaces/:workspace/acl

返回 workspace members/ACL entries 列表。

参数:

参数位置说明
workspacePathWorkspace fullname.

Payload: 无。

响应:WorkspaceAclEntry[]

POST /api/v2/workspaces/:workspace/acl

创建 invite 或 ACL entry。

参数:

参数位置说明
workspacePathWorkspace fullname.

Payload:

字段必填说明
inviteInvite id/token.

响应:WorkspaceAclEntry

PUT /api/v2/workspaces/:workspace/acl/:entryId

修改 member role。

参数:

参数位置说明
workspacePathWorkspace fullname.
entryIdPathACL entry id.

Payload:

字段必填说明
levelowneradmindeveloperuser 之一。

响应:WorkspaceAclEntry

DELETE /api/v2/workspaces/:workspace/acl/:entryId

删除 member/ACL entry。

参数:

参数位置说明
workspacePathWorkspace fullname.
entryIdPathACL entry id.

Payload: 无。

响应:OperationResult