跳到内容

成员

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

成员角色

成员角色

常规角色

常规角色
  • read: 可以查看资源,但不能进行修改
  • : 可以上传新包并查看资源upload
  • 写入: 可以修改资源并上传捆绑包
  • 管理员: 可以管理组织设置和成员
  • 超级管理员完全控制组织

邀请角色

邀请角色
  • 邀请阅读: 等待邀请获取读取权限
  • 邀请上传等待上传权限邀请
  • 邀请写入: 等待写入访问邀请
  • 邀请管理员: 等待管理员访问邀请
  • 邀请超级管理员: 等待超级管理员访问邀请
  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/

GET

GET

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"
}

错误处理

错误处理

常见错误场景和响应:

// 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. 安全审计: 定期检查成员列表和角色
  4. 团队重构: 在组织更改时更新角色