跳过内容

__CAPGO_KEEP_0__

组织成员是有权访问您的Capgo组织的用户。每个成员都有一个特定的角色,决定了他们在组织中的权限。有效地管理成员对于维护团队的安全和协作至关重要。

  • 读取: 可以查看资源,但不能进行修改
  • : 可以上传新包并查看资源: 可以上传新包并修改资源
  • read: Can modify resources and upload bundles
  • : 管理员: 可管理组织设置和成员
  • : 可以对组织拥有完全控制权: 邀请角色

Section titled “Invite Roles”

: 等待读取访问邀请
  • : 等待上传访问邀请: 等待写入访问邀请
  • : 等待写入访问邀请: 等待写入访问邀请
  • : 等待写入访问邀请: 等待邀请管理员写入权限
  • invite_admin: 等待邀请管理员访问权限
  • invite_super_admin: 等待邀请超级管理员访问权限
  1. 角色分配: 分配角色时遵循最小特权原则
  2. 定期审计: 定期审计成员访问并删除未使用的账户
  3. 入职流程: 有明确的流程添加新成员并分配角色
  4. 离职: 及时移除离开组织的成员的访问权限

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://console.capgo.app/register/

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

Retrieve all members of an organization.

组织成员

参数
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";
}

复制到剪贴板

示例响应
Terminal window
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"
}

错误处理

错误处理

常见错误场景和响应:

// Member not found
{
"error": "Member not found",
"status": "KO"
}
// Invalid role
{
"error": "Invalid role specified",
"status": "KO"
}
// Permission denied
{
"error": "Insufficient permissions to manage members",
"status": "KO"
}
// Cannot remove last admin
{
"error": "Cannot remove the last admin from the organization",
"status": "KO"
}
// Invalid email
{
"error": "Invalid email format",
"status": "KO"
}
// Member already exists
{
"error": "Member already exists in organization",
"status": "KO"
}

常见用例

常见用例
  1. 团队扩张添加具有适当角色权限的新团队成员
  2. 访问控制: 管理成员权限随着责任变化
  3. Security Audit: 定期审查成员列表和角色
  4. Team Restructuring: 在组织结构变化时更新角色

Keep going from Members

成员列表

If you are using 成员 to plan security and compliance, connect it with 加密 for the implementation detail in Encryption, Compliance for the implementation detail in Compliance, Capgo 安全扫描器 for the product workflow in Capgo Security Scanner, Capgo 安全 for the product workflow in Capgo Security, and Capgo 信任中心 for the product workflow in Capgo Trust Center.