コンテンツにスキップ

組織

Capgoのトップレベルエンティティは組織です。組織を使用して、アプリ、チームメンバー、リソースを単一のカバー下にグループ化できます。各組織には、異なる役割と権限を持つ複数のメンバーが存在できます。

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

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

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

Section titled “Query Parameters”

(省略可能): 取得したい組織のID
  • orgId Response Type

Section titled “Response Type”

コピー
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 新しい__CAPGO_KEEP_0__キーに

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

PUT

PUT

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

PUTを使用して既存の組織を更新します。対象の組織に管理者ロールが必要です。

Request Body

Request Body
interface OrganizationUpdate {
orgId: string
logo?: string
name?: string
management_email?: string
}

ターミナル画面

コピー
Example Response
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/

PUTを使用して既存の組織を更新します。対象の組織に管理者ロールが必要です。

PUTを使用して既存の組織を更新します。対象の組織に管理者ロールが必要です。
{
"status": "Organization updated",
"data": {
"id": "org_123",
"name": "New Company Name",
"management_email": "newemail@example.com"
}
}

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

既存の組織を削除します。対象の組織に削除権限が必要であり、通常はロールを通じて提供されます。このアクションは不可逆であり、関連するすべてのアプリ、バンドル(バージョン)、およびリソースを削除します。 org_super_admin 削除する組織のID

グローバルな権限では組織を削除することはできません。 org.create クエリ パラメーター

「クエリ パラメーター」のセクション

: 削除する組織のID
  • 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. メールアドレスページ/エリア: Capgo マーケティング ウェブサイト。役割: UI ラベル。表示場所: page register.astro。メッセージキー `email_label` (メールラベル)。| ページ/エリア: ライブアップデート製品ページ。役割: UI ラベル。メッセージキー `live_update_guidance_email_label` (ライブアップデートガイドメールラベル)。
  4. : 管理メールアドレスのグループメールを使用して、個人メールの変更による問題を回避してください。ロゴ

: 可靠なCDNでロゴをホストし、HTTPS URLを使用してください。

組織から続けてください。

組織から続けてください。 : 組織名を明確で記述的な名前で設定してください。 to plan dashboard and API operations, connect it with API まとめ API まとめの実装詳細については 導入 導入の実装詳細については API キー API キーの実装詳細については デバイス デバイスの実装詳細については、 バンドル バンドルの実装詳細については。