コンテンツにスキップ

組織

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.

「一般的な使用例」

Section titled “Common Use Cases”
  • 会社用の新しい組織を作成する
  • 組織の設定を管理する
  • 組織の情報を更新する
  • 組織の詳細を取得する

エンドポイント

エンドポイント

GET

GET

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

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

クエリ パラメータ

__CAPGO_KEEP_0__
  • orgId (optional): __CAPGO_KEEP_0__の特定の組織の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 "authorization: your-api-key" https://api.capgo.app/organization/
# Get specific organization
curl -H "authorization: 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/

新しい組織を作成します。

interface OrganizationCreate {
name: string
}
ターミナル画面
curl -X POST \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "New Organization"
}' \
https://api.capgo.app/organization/
{
"status": "Organization created",
"id": "org_456"
}

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

既存の組織を更新します。管理者ロールが必要です。

interface OrganizationUpdate {
orgId: string
logo?: string
name?: string
management_email?: string
}
ターミナル画面
curl -X PUT \
-H "authorization: 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/

既存の組織を削除します。管理者ロールが必要です。このアクションは不可逆であり、すべての関連アプリ、バンドル (バージョン)、リソースを削除します。

  • orgId削除する組織の ID
クリップボードにコピー
curl -X DELETE \
-H "authorization: your-api-key" \
https://api.capgo.app/organization/?orgId=org_123
{
"status": "Organization deleted",
"id": "org_123"
}

一般的なエラーのシナリオとその応答:

// 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を使用します。

組織から続ける

: 組織から続ける

組織を使用している場合 組織 ダッシュボードとAPIの運用を計画するために使用している場合、組織をAPIの概要と接続してください。 APIの概要 APIの概要の実装詳細については、APIの概要を参照してください。 導入 導入の実装詳細について API キー API キーの実装詳細について デバイス デバイスの実装詳細について バンドル バンドルの実装詳細について