組織
インストールステップやこのプラグインのフルマークダウンガイドまでの全てのステップが含まれたセットアップ用の質問をコピーする。
組織はCapgoのトップレベルエンティティです。組織を使用して、チームメンバー、リソースを1つの屋根の下にグループ化できます。各組織には、異なる役割と権限を持つ複数のメンバーが存在できます。
一般的な使用例
一般的な使用例- 会社の新しい組織を作成する
- 組織の設定を管理する
- 組織の情報を更新する
- 組織の詳細を取得する
エンドポイント
エンドポイントGET
GEThttps://api.capgo.app/organization/
組織情報の取得。指定されたパラメータが存在する場合、特定の組織を1つ返します。そうでない場合、すべてのアクセス可能な組織を返します。 orgId Query Parameters
パラメータ
Response TypeorgIdコピー
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}Section titled “GET”
Section titled “Query Parameters”# 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 のバインディングが必要です。この要求が成功すると、__CAPGO_KEEP_0__は__CAPGO_KEEP_1__と同じキーを自動的に割り当てます。
When the request succeeds, Capgo automatically assigns the same API key as org_super_admin 新組織に適用される。
リクエスト ボディ
セクション「リクエスト ボディ」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 キーがなければ org.createAPI が返します:
{ "error": "permission_denied"}PUT
「PUT」のセクション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
削除https://api.capgo.app/organization/
指定された組織を削除します。対象組織に対する削除権限が必要です。通常はロールを通じて取得されます。このアクションは不可逆的であり、関連するすべてのアプリ、バンドル(バージョン)、リソースを削除します。 org_super_admin グローバル権限は組織を削除することを許可しません。
Query Parameters org.create 削除する組織のID
Example Request
ターミナル画面orgIdコピー
Section titled “DELETE”
Section titled “Query Parameters”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"}ベストプラクティス
セクション「ベストプラクティス」- 名前付け: 組織の明確で説明的な名前を使用する
- 役割: チームメンバーに適切な役割を割り当ててください
- メール: 管理者メールアドレスを変更する問題を回避するために、グループメールを使用してください
- ロゴ: 可靠なCDNにロゴをホストし、HTTPS URLを使用してください
組織から続けて
組織から続けて: ダッシュボードと__CAPGO_KEEP_0__の運用を計画する場合、組織を__CAPGO_KEEP_0__と接続してください __CAPGO_KEEP_0__の概要 : APIの概要の実装詳細については、APIの概要を参照してください API Overview for the implementation detail in API Overview, Introduction for the implementation detail in Introduction, APIの実装詳細について for the implementation detail in API Keys, __CAPGO_KEEP_0__ Keysの実装詳細について for the implementation detail in Devices, and Devicesの実装詳細について、 for the implementation detail in Bundles.