コンテンツにジャンプ

組織

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.

  • 会社のために新しい組織を作成する
  • 組織の設定を管理する
  • 組織の情報を更新する
  • 組織の詳細を取得する

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

組織の情報を取得します。パラメータが指定されている場合、1 つの組織を返します。そうでない場合は、すべてのアクセス可能な組織を返します。 orgId パラメータ

  • 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 organizations
curl -H "x-api-key: YOUR_API_KEY" https://api.capgo.app/organization/
# Get specific organization
curl -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"
}
}

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

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"
}
  1. ネーミング: 組織名に明確で説明的な名前を使用する
  2. ロール: チームメンバーに適切なロールを割り当てる
  3. メール: 管理メールアドレスにグループメールを使用して、個人メールアドレスの変更による問題を回避する
  4. ロゴ:

Host logos on a reliable CDN and use HTTPS URLs

Keep going from Organizations

Section 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, デバイス デバイスの実装詳細については、 バンドル バンドルの実装詳細については、