跳转到正文

成员

组织成员是指拥有 Capgo 组织访问权限的用户。每位成员都拥有特定的角色,决定了其在组织内的权限。高效管理成员对于维护团队的安全与协作至关重要。

  • 读取权限:可以查看资源,但无法进行更改
  • upload:可以 upload 新的 bundle 并查看资源
  • 写入:可修改资源并上传 bundle
  • 管理员:可管理组织设置及成员
  • 超级管理员:拥有组织的完整控制权
  • 读取邀请:待处理的只读权限邀请
  • 邀请上传:待处理的上传权限邀请
  • 写入邀请权限: 待处理的写入权限邀请
  • 邀请管理员: 待处理的管理员权限邀请
  • 邀请超级管理员: 待处理的超级管理员权限邀请
  1. 角色分配: 分配角色时请遵循最小权限原则
  2. 定期审计: 定期审查成员访问权限并移除未使用的账号
  3. Onboarding:建立清晰的新成员添加和角色分配流程
  4. Offboarding:及时移除离开组织成员的访问权限

https://api.capgo.app/organization/members/

向组织添加新成员或更新现有成员的角色。请注意,您只能邀请已拥有 Capgo 账号的用户——邮箱必须对应现有的 Capgo 用户。

interface MemberCreate {
orgId: string
email: string
role: "read" | "upload" | "write" | "admin" | "super_admin"
}
终端窗口
curl -X POST \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"orgId": "org_123",
"email": "newmember@example.com",
"role": "write"
}' \
https://api.capgo.app/organization/members/
{
"status": "OK",
"data": {
"uid": "user_789",
"email": "newmember@example.com",
"role": "invite_write",
"image_url": null
}
}

注意:

  • 添加新成员时,系统会向其发送一封邀请邮件。在接受邀请之前,其角色前缀将显示为 “invite_”。
  • 用户必须先拥有 Capgo 账号才能接受邀请。如果尚未注册,请先前往以下地址创建账号: https://capgo.app/register/

https://api.capgo.app/organization/members/

获取组织下的所有成员。

interface MemberQuery {
orgId: string
}
interface Member {
uid: string;
email: string;
image_url: string;
role: "invite_read" | "invite_upload" | "invite_write" | "invite_admin" | "invite_super_admin" | "read" | "upload" | "write" | "admin" | "super_admin";
}
终端窗口
curl -H "authorization: your-api-key" \
"https://api.capgo.app/organization/members/?orgId=org_123"
{
"data": [
{
"uid": "user_123",
"email": "john@example.com",
"image_url": "https://example.com/avatar.png",
"role": "admin"
},
{
"uid": "user_456",
"email": "jane@example.com",
"image_url": "https://example.com/avatar2.png",
"role": "write"
},
{
"uid": "user_789",
"email": "bob@example.com",
"image_url": null,
"role": "invite_read"
}
]
}

https://api.capgo.app/organization/members/

从组织中移除成员。这将立即撤销其访问权限。

interface MemberDelete {
orgId: string
email: string
}
终端窗口
curl -X DELETE \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"orgId": "org_123",
"email": "user@example.com"
}' \
https://api.capgo.app/organization/members/
{
"status": "OK"
}

所有错误均采用以下文档中描述的标准错误格式: API 概览.

常见的错误场景及其响应:

// The API key has no access to the organization
{
"error": "cannot_access_organization",
"message": "You can't access this organization",
"moreInfo": { "orgId": "046a36ac-e03c-4590-9257-bd6c9dba9ee8" }
}
// Unknown role on update
{
"error": "invalid_role",
"message": "Invalid role",
"moreInfo": { "role": "owner" }
}
// Changing the role of the user who owns the API key
{
"error": "cannot_change_own_role",
"message": "You cannot change your own role",
"moreInfo": {}
}
// Removing a user who is not a member (HTTP 404)
{
"error": "organization_member_not_found",
"message": "User is not a member of this organization",
"moreInfo": { "orgId": "046a36ac-e03c-4590-9257-bd6c9dba9ee8", "email": "user@example.com" }
}
// Removing the last super admin
{
"error": "CANNOT_REMOVE_LAST_SUPER_ADMIN",
"message": "Cannot remove the last super admin from the organization",
"moreInfo": { "orgId": "046a36ac-e03c-4590-9257-bd6c9dba9ee8" }
}
  1. 团队扩充: 添加新团队成员并分配合适的角色
  2. 访问控制: 在职责变化时管理成员权限
  3. 安全审计: 定期审查成员列表和角色
  4. 团队重组: 在组织架构调整时更新角色

如果你正在使用 成员 来规划安全与合规,请结合 加密 了解 Encryption 的实现细节, 合规性 了解合规部分的实现细节, Capgo 安全扫描器 了解 Capgo Security Scanner 的产品工作流, Capgo 安全 用于 Capgo 安全的产品工作流,以及 Capgo 信任中心 用于 Capgo 信任中心的产品工作流。