メンバー
組織メンバーは、Capgo組織へのアクセス権を持つユーザーです。各メンバーには、組織内での権限を決定する特定のロールがあります。メンバーを効果的に管理することは、チームのセキュリティとコラボレーションを維持するために重要です。
メンバーロール
Section titled “メンバーロール”通常のロール
Section titled “通常のロール”- read: リソースを表示できますが、変更はできません
- upload: 新しいバンドルをアップロードし、リソースを表示できます
- write: リソースを変更し、バンドルをアップロードできます
- admin: 組織の設定とメンバーを管理できます
- super_admin: 組織を完全に制御できます
- invite_read: 読み取りアクセスの保留中の招待
- invite_upload: アップロードアクセスの保留中の招待
- invite_write: 書き込みアクセスの保留中の招待
- invite_admin: 管理者アクセスの保留中の招待
- invite_super_admin: スーパー管理者アクセスの保留中の招待
ベストプラクティス
Section titled “ベストプラクティス”- ロールの割り当て: ロールを割り当てる際は最小権限の原則に従う
- 定期的な監査: メンバーアクセスを定期的に確認し、使用されていないアカウントを削除する
- オンボーディング: 新しいメンバーを追加し、ロールを割り当てるための明確なプロセスを持つ
- オフボーディング: 組織を離れるメンバーのアクセスを速やかに削除する
エンドポイント
Section titled “エンドポイント”https://api.capgo.app/organization/members/
組織に新しいメンバーを追加するか、既存のメンバーのロールを更新します。既にCapgoアカウントを持っているユーザーのみを招待できることに注意してください - メールアドレスは既存のCapgoユーザーに対応している必要があります。
リクエストボディ
Section titled “リクエストボディ”interface MemberCreate { orgId: string email: string role: "read" | "upload" | "write" | "admin" | "super_admin"}リクエスト例
Section titled “リクエスト例”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/成功レスポンス
Section titled “成功レスポンス”{ "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/
組織のすべてのメンバーを取得します。
クエリパラメータ
Section titled “クエリパラメータ”interface MemberQuery { orgId: string}レスポンスタイプ
Section titled “レスポンスタイプ”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";}リクエスト例
Section titled “リクエスト例”curl -H "authorization: your-api-key" \ "https://api.capgo.app/organization/members/?orgId=org_123"レスポンス例
Section titled “レスポンス例”{ "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" } ]}DELETE
Section titled “DELETE”https://api.capgo.app/organization/members/
組織からメンバーを削除します。これにより、そのアクセス権が直ちに取り消されます。
リクエストボディ
Section titled “リクエストボディ”interface MemberDelete { orgId: string email: string}リクエスト例
Section titled “リクエスト例”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/成功レスポンス
Section titled “成功レスポンス”{ "status": "OK"}一般的なエラーシナリオとそのレスポンス:
// メンバーが見つかりません{ "error": "Member not found", "status": "KO"}
// 無効なロール{ "error": "Invalid role specified", "status": "KO"}
// 権限が拒否されました{ "error": "Insufficient permissions to manage members", "status": "KO"}
// 最後の管理者を削除できません{ "error": "Cannot remove the last admin from the organization", "status": "KO"}
// 無効なメールアドレス{ "error": "Invalid email format", "status": "KO"}
// メンバーが既に存在します{ "error": "Member already exists in organization", "status": "KO"}一般的な使用例
Section titled “一般的な使用例”- チームの拡大: 適切なロールで新しいチームメンバーを追加
- アクセス制御: 責任が変わる際のメンバー権限の管理
- セキュリティ監査: メンバーリストとロールの定期的な確認
- チームの再編成: 組織変更時のロールの更新