콘텐츠로 건너뛰기

Organizations

조직은 Capgo의 최상위 엔터티입니다. 이를 통해 앱, 팀 구성원, 리소스를 하나의 그룹으로 그룹화할 수 있습니다. 각 조직에는 서로 다른 역할과 권한을 가진 여러 구성원이 있을 수 있습니다.

  • 회사를 위한 새로운 조직 만들기
  • 조직 설정 관리
  • 조직 정보 업데이트
  • 조직 세부 정보 검색

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

조직 정보를 검색합니다. 매개변수에 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
}
Terminal window
# 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
}
Terminal window
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
}
Terminal window
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
Terminal window
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을 사용합니다.