組織
このプラグインのインストール手順とフルマークダウンガイドを含むセットアッププロンプトをコピーできます。
Organizations are the top-level entities in Capgo. They allow you to group apps, team members, and resources under a single umbrella. Each organization can have multiple members with different roles and permissions.
protectedTokens
Section titled “Common Use Cases”- 会社のために新しい組織を作成する
- 組織の設定を管理する
- 組織の情報を更新する
- 組織の詳細を取得する
エンドポイント
Section titled “エンドポイント”https://api.capgo.app/organization/
組織の情報を取得します。パラメータが指定されている場合、1 つの組織を返します。そうでない場合は、すべてのアクセス可能な組織を返します。 orgId パラメータ
Query Parameters
クエリ パラメータorgId(省略可能): 特定の組織の ID を取得する
レスポンス タイプ
レスポンス タイプinterface Organization { id: string created_by: string created_at: string updated_at: string logo: string | null name: string management_email: string customer_id: string | null}例: リクエスト
例: リクエスト# Get all organizationscurl -H "x-api-key: YOUR_API_KEY" https://api.capgo.app/organization/
# Get specific organizationcurl -H "x-api-key: YOUR_API_KEY" https://api.capgo.app/organization/?orgId=org_123例: レスポンス
例: レスポンス{ "data": { "id": "org_123", "name": "My Company", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z", "logo": "https://example.com/logo.png", "management_email": "admin@example.com", "customer_id": "cus_123" }}POST
セクション「POST」https://api.capgo.app/organization/
新しい組織を作成します。
API キーを使用する場合、キーにはグローバル org.create 許可と現在の組織スコープ org_admin または org_super_admin バインディングが必要です。この機能は、ターゲットの組織がまだ存在しないため、通常の組織スコープのRBACをターゲットの組織に対してチェックすることができません。
Capgo がリクエストに成功すると、API キーを新しい組織に自動的に割り当てることができます。 org_super_admin Note
リクエスト ボディ
「リクエスト ボディ」のセクションinterface OrganizationCreate { name: string email?: string estimatedMau?: number website?: string}例: リクエスト
「例: リクエスト」のセクションcurl -X POST \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "New Organization", "email": "admin@example.com", "website": "https://example.com" }' \ https://api.capgo.app/organization/例: レスポンス
「例: レスポンス」のセクション{ "id": "org_456"}権限エラー
「権限エラー」のセクションAPI キーがなければ、API は org.create「API」が返されます。
{ "error": "permission_denied"}https://api.capgo.app/organization/
リクエストボディ
「リクエストボディ」のセクション
クリップボードにコピーinterface OrganizationUpdate { orgId: string logo?: string name?: string management_email?: string}例のリクエスト
「例のリクエスト」のセクションcurl -X PUT \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "orgId": "org_123", "name": "New Company Name", "management_email": "newemail@example.com" }' \ https://api.capgo.app/organization/例のレスポンス
「例のレスポンス」のセクション{ "status": "Organization updated", "data": { "id": "org_123", "name": "New Company Name", "management_email": "newemail@example.com" }}DELETE
「DELETE」のセクションhttps://api.capgo.app/organization/
指定された組織を削除します。削除権限が必要です。通常はロールを通じて。 このアクションは不可逆であり、すべての関連アプリ、バンドル (バージョン)、リソースを削除します。 org_super_admin 削除する組織が存在する場合
削除する組織が存在する場合 org.create グローバル権限が組織の削除を許可していません。
クエリ パラメータ
セクション「クエリ パラメータ」orgId: 削除する組織の ID
例: リクエスト
セクション「例: リクエスト」curl -X DELETE \ -H "x-api-key: YOUR_API_KEY" \ https://api.capgo.app/organization/?orgId=org_123例: レスポンス
セクション「例: レスポンス」{ "status": "ok"}エラー処理
エラー処理に関するセクション一般的なエラーシナリオとその応答:
// Invalid API key{ "error": "Invalid API key", "status": "KO"}
// Missing required field{ "error": "Name is required", "status": "KO"}
// Insufficient permissions{ "error": "Admin role required", "status": "KO"}ベストプラクティス
セクション “ベストプラクティス”- ネーミング: 組織名に明確で説明的な名前を使用する
- ロール: チームメンバーに適切なロールを割り当てる
- メール: 管理メールアドレスにグループメールを使用して、個人メールアドレスの変更による問題を回避する
- ロゴ:
Host logos on a reliable CDN and use HTTPS URLs
Keep going from OrganizationsSection titled “ If you are using to plan dashboard and API operations, connect it with API Overview for the implementation detail in API Overview, for the implementation detail in for the implementation detail in API Keys for the implementation detail in API Keys, デバイス デバイスの実装詳細については、 バンドル バンドルの実装詳細については、