기관
소스 가이드
조직은 Capgo의 최상위 엔터티입니다. 조직을 통해 앱, 팀원 및 리소스를 단일 천장 아래에 그룹화할 수 있습니다. 각 조직은 다중 멤버와 다른 역할 및 권한을 가질 수 있습니다.
일반적인 사용 사례
일반적인 사용 사례- 회사에 새로운 조직 만들기
- 조직 설정 관리
- 조직 정보 업데이트
- 조직 세부 정보 가져오기
엔드포인트
엔드포인트GET
GEThttps://api.capgo.app/organization/
조직 정보를 가져옵니다. 파라미터에 orgId 가 제공된 경우, 단일 조직을 반환합니다. 그렇지 않으면, 접근 가능한 모든 조직을 반환합니다.
Query Parameters
Query ParametersorgId(선택): 특정 조직을 가져올 때 사용하는 조직 ID
응답 유형
Response Typeinterface Organization { id: string created_by: string created_at: string updated_at: string logo: string | null name: string management_email: string customer_id: string | null}예시 요청
Example Request# Get all organizationscurl -H "x-api-key: YOUR_API_KEY" https://api.capgo.app/organization/
# Get specific organizationcurl -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" }}POST
‘POST’ 제목https://api.capgo.app/organization/
새로운 조직을 만들려면.
API 키를 사용할 때, 키는 글로벌 권한을 가지고 있어야 하며, 현재 조직 범위의 org.create 또는 org_admin or org_super_admin 권한이 있는 __CAPGO_KEEP_0__ 키가 필요합니다.
요청이 성공하면 Capgo은 동일한 API 키를 자동으로 할당합니다. org_super_admin __CAPGO_KEEP_0__의 새로운 키에 대한 __CAPGO_KEEP_1__ 키가 할당됩니다.
__CAPGO_KEEP_2__
요청 본문interface OrganizationCreate { name: string email?: string estimatedMau?: number website?: string}클립보드 복사하기
Section titled “예시 요청”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
PUThttps://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/응답
PUT{ "status": "Organization updated", "data": { "id": "org_123", "name": "New Company Name", "management_email": "newemail@example.com" }}DELETE
DELETEhttps://api.capgo.app/organization/
기존 조직을 삭제합니다. 대상 조직에 대한 삭제 권한이 필요하며, 일반적으로 역할을 통해 제공됩니다. org_super_admin 이 작업은 irreversible이며 모든 관련 앱, 버전, 및 리소스를 삭제합니다.
The org.create 전역 권한은 조직을 삭제할 수 없습니다.
Query Parameters
Query ParametersorgId삭제할 조직의 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"}최선의 방법
최선의 방법 섹션- 이름: 조직에 대한 명확하고 설명적인 이름을 사용하십시오
- 역할: 팀원에게 적절한 역할을 assign하세요
- 이메일: 개인 이메일 변경 문제를 피하기 위해 그룹 이메일을 관리 이메일로 사용하세요.
- Logo로고
: 신뢰할 수 있는 CDN에서 로고를 호스팅하고 HTTPS URL을 사용하세요
다음 단계로 OrganizationsSection titled “다음 단계로 Organizations” 만약 당신이 사용하고 있다면 연동하여 계획 대시보드 및 API 운영을 수행하세요. 계획 대시보드와 API 운영을 위해 Organizations을 사용하고 있다면, 그것을 API Overview와 연결하세요 implementation 세부 정보를 위한 API 개요 소개 implementation 세부 정보를 위한 소개 API 키 implementation 세부 정보를 위한 API 키 장치 implementation 세부 정보를 위한 장치, 패키지 implementation 세부 정보를 위한 패키지.