조직
이 설정 프롬프트를 설치 단계와 이 플러그인의 전체 마크다운 가이드와 함께 복사합니다.
Capgo의 최상위 엔터티는 조직입니다. 조직은 앱, 팀원, 및 자원을 단일로 그룹화할 수 있습니다. 각 조직은 다중 멤버와 역할 및 권한이 다른 멤버를 가질 수 있습니다.
일반적인 사용 사례
일반적인 사용 사례- 회사에 새로운 조직 만들기
- 조직 설정 관리
- 조직 정보 업데이트
- 조직 정보 가져오기
엔드포인트
엔드포인트GET
GEThttps://api.capgo.app/organization/
조직 정보를 가져옵니다. 만약 orgId 쿼리 매개변수
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}예시 요청
예제 요청# 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
POSThttps://api.capgo.app/organization/
새로운 조직 만들기
API 키를 사용할 때, 키는 글로벌 org.create __CAPGO_KEEP_0__ 키가 가지고 있어야 합니다. 또한 현재 조직 범위의 org_admin 또는 org_super_admin 바인딩이 필요합니다. 이는 대상 조직이 아직 존재하지 않기 때문에 일반 조직 범위의 RBAC를 대상 조직에 대해 확인할 수 없기 때문입니다.
Capgo 키가 성공적으로 요청되면 Capgo 자동으로 새 조직에 API 키를 assign합니다. 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.create그렇다면 API은:
{ "error": "permission_denied"}PUT
PUT 섹션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/__CAPGO_KEEP_0__
예시 응답{ "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 쿼리 매개변수
쿼리 매개변수
__CAPGO_KEEP_1__orgId: 삭제할 조직의 ID입니다.
예시 요청
예시 요청 섹션curl -X DELETE \ -H "x-api-key: YOUR_API_KEY" \ https://api.capgo.app/organization/?orgId=org_123컨텍스트: Capgo 마케팅 웹사이트. 역할: UI 레이블. 위치: 페이지 agent/[slug].astro. 메시지 키 `agents_page_copy_label` (Agent Page Copy Label).
예시 응답{ "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"}최선의 관행
Section titled “최선의 관행”- 이름context
- Roles: 조직에 대한 명확하고 설명적인 이름을 사용하십시오
- 역할context
- Logo: 팀원에게 적절한 역할을 할당하십시오
이메일
context만약에 조직 계획 대시보드와 API 운영을 계획하고 연결하려면 API API 개요 소개 구현 세부 정보를 확인하려면 API 키 API 키 구현 세부 사항에 대해 장치 구현 세부 정보를 확인하려면 장치, 그리고 구현 세부 사항에 대한 정보입니다.