내용으로 건너뛰기

단체

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.

  • __CAPGO_KEEP_0__를 위한 새로운 회사에 대한 조직을 생성합니다.
  • __CAPGO_KEEP_0__의 설정을 관리합니다.
  • __CAPGO_KEEP_0__의 정보를 업데이트합니다.
  • __CAPGO_KEEP_0__의 세부 정보를 가져옵니다.

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

__CAPGO_KEEP_3__의 정보를 가져옵니다. __CAPGO_KEEP_4__이 매개 변수에 제공된 경우, 단일 조직을 반환합니다. 그렇지 않으면, 접근 가능한 모든 조직을 반환합니다. orgId __CAPGO_KEEP_4__ 매개 변수입니다.

  • 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 "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 권한이 있어야 합니다. 이는 대상 조직이 아직 존재하지 않기 때문에 일반 조직 범위의 RBAC를 대상 조직에 대해 확인할 수 없기 때문입니다. 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
}

__CAPGO_KEEP_2__

터미널 창
__CAPGO_KEEP_3__
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/

예시 응답

__CAPGO_KEEP_4__
{
"id": "org_456"
}

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/

기존 조직을 삭제합니다. 대상 조직에 대한 삭제 권한이 필요하며, 일반적으로 역할을 통해 얻을 수 있습니다. 이 작업은 irreversible하고 모든 관련 앱, 버전, 및 리소스를 삭제합니다. org_super_admin The

역할을 통해 얻을 수 있습니다. org.create 전역 권한이 조직 삭제를 허용하지 않습니다.

Query Parameters

Query Parameters 섹션
  • 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. 로고:

조직에서 계속 진행하세요

조직에서 계속 진행하세요 섹션 제목

만약에 조직 계획 대시보드와 API 운영을 위해 API 개요 API 개요에서 구현 세부 정보를 참조하세요 소개 소개에서 구현 세부 정보를 참조하세요 API 키 API 키에서 구현 세부 정보를 참조하세요 기기 기기 구현 세부 정보에 대해 패키지 패키지 구현 세부 정보에 대해