コンテンツにジャンプ

組織

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

一般的な使用例

一般的な使用例
  • 会社の新しい組織を作成する
  • 組織の設定を管理する
  • 組織の情報を更新する
  • 組織の詳細を取得する

エンドポイント

エンドポイント

GET

GET

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

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

パラメータ

Response Type
  • orgId コピー
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 “Response Type”
# 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 のバインディングが必要です。この要求が成功すると、__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"
}

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”
Section titled “Example Request”
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. ロゴ: 可靠な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.