06 / 端點
Members
邀請成員加入組織
需要 API KeyPOST/api/enterprise/v1/organizations/{orgId}/members/invite
邀請創作者加入組織,並寄出邀請信。
回應的 status 為 INVITED,表示對方還不是組織成員。 創作者必須透過信中的連結接受才會變成 ACTIVE,在那之前無法配置到工作區(配置時會回傳 404)。
userId 會回傳 null — 因為尚未連結帳號。若要取消這個邀請,請將回應中的 id 帶入 DELETE .../members/{userId}。
路徑參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| orgId | string | 必填 | Organization ID範例: org_cuid123abc |
請求內容
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| string | 必填 | 受邀者的電子郵件maxLength 320 · email | 範例: creator@example.com | |
| role | enum | 必填 | 組織內的角色可用值: ADMIN · MEMBER | 範例: MEMBER |
請求範例
{
"email": "creator@example.com",
"role": "MEMBER"
}回應
| 狀態 | 意義 |
|---|---|
| 201 | 已建立邀請(尚未接受) |
| 400 | 請求有誤(validation 失敗)PartnerErrorResponse |
| 401 | 驗證失敗(沒有 API Key 或無效)PartnerErrorResponse |
| 403 | 沒有權限(無法存取該 Organization)PartnerErrorResponse |
| 404 | 找不到資源PartnerErrorResponse |
| 429 | 超過 Rate limitPartnerErrorResponse |
| 503 | Rate limit 服務暫時無法使用PartnerErrorResponse |
回應 201
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| requestId | string | 必填 | |
| id | string | 必填 | 成員資格 ID。取消邀請時使用這個值。 |
| userId | string | null | 必填 | |
| string | 必填 | ||
| role | string | 必填 | |
| status | string | 必填 | 範例: INVITED |
回應範例
{
"requestId": "string",
"id": "string",
"userId": "string",
"email": "string",
"role": "string",
"status": "INVITED"
}組織成員清單
需要 API KeyGET/api/enterprise/v1/organizations/{orgId}/members
僅回傳已完成接受的 ACTIVE 成員。 只收到邀請但尚未接受的人不會包含在內。email 是不分大小寫的部分比對篩選。
這份清單即等同於可配置到工作區的對象。
路徑參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| orgId | string | 必填 | Organization ID範例: org_cuid123abc |
查詢參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| string | 選填 | 電子郵件部分比對篩選(不分大小寫)範例: creator@ | |
| page | string | 選填 | 頁碼(預設 1)範例: 1 |
| limit | string | 選填 | 每頁筆數(預設 15,上限 100)範例: 15 |
請求內容
此端點不需要請求內容。
回應
| 狀態 | 意義 |
|---|---|
| 200 | 成員清單 |
| 400 | 請求有誤(validation 失敗)PartnerErrorResponse |
| 401 | 驗證失敗(沒有 API Key 或無效)PartnerErrorResponse |
| 403 | 沒有權限(無法存取該 Organization)PartnerErrorResponse |
| 404 | 找不到資源PartnerErrorResponse |
| 429 | 超過 Rate limitPartnerErrorResponse |
| 503 | Rate limit 服務暫時無法使用PartnerErrorResponse |
回應 200
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| requestId | string | 必填 | |
| organizationId | string | 必填 | |
| members[] | object[] | 必填 | |
| userId | string | 必填 | |
| string | 必填 | ||
| name | string | 必填 | |
| role | string | 必填 | |
| joinedAt | string | 必填 | |
| pagination | object | 必填 | |
| page | number | 必填 | |
| limit | number | 必填 | |
| total | number | 必填 | |
| hasMore | boolean | 必填 |
回應範例
{
"requestId": "string",
"organizationId": "string",
"members": [
{
"userId": "string",
"email": "string",
"name": "string",
"role": "string",
"joinedAt": "string"
}
],
"pagination": {
"page": 0,
"limit": 0,
"total": 0,
"hasMore": false
}
}變更組織成員角色
需要 API KeyPATCH/api/enterprise/v1/organizations/{orgId}/members
對象以 body 中的 userId 指定。若嘗試將最後一位 ADMIN 降為 MEMBER,將被拒絕。
路徑參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| orgId | string | 必填 | Organization ID範例: org_cuid123abc |
請求內容
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| userId | string | 必填 | 要變更角色的對象範例: usr_cuid789ghi |
| role | enum | 必填 | 可用值: ADMIN · MEMBER |
請求範例
{
"userId": "usr_cuid789ghi",
"role": "ADMIN"
}回應
| 狀態 | 意義 |
|---|---|
| 200 | 已變更 |
| 400 | 請求有誤(validation 失敗)PartnerErrorResponse |
| 401 | 驗證失敗(沒有 API Key 或無效)PartnerErrorResponse |
| 403 | 沒有權限(無法存取該 Organization)PartnerErrorResponse |
| 404 | 找不到資源PartnerErrorResponse |
| 429 | 超過 Rate limitPartnerErrorResponse |
| 503 | Rate limit 服務暫時無法使用PartnerErrorResponse |
回應 200
沒有內容。
從組織移除成員 / 取消邀請
需要 API KeyDELETE/api/enterprise/v1/organizations/{orgId}/members/{userId}
移除組織成員,或取消尚未被接受的邀請。所屬工作區的成員資格也會一併清理。
要取消尚未接受的邀請時,請帶入邀請回應的 id(membershipId)。在那個時點沒有 userId,無法以其他方式指定對象。
路徑參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| orgId | string | 必填 | Organization ID範例: org_cuid123abc |
| userId | string | 必填 | User ID。要取消尚未接受的邀請時,請填入邀請回應的 id(membershipId)。範例: usr_cuid789ghi |
請求內容
此端點不需要請求內容。
回應
| 狀態 | 意義 |
|---|---|
| 200 | 已移除 |
| 400 | 請求有誤(validation 失敗)PartnerErrorResponse |
| 401 | 驗證失敗(沒有 API Key 或無效)PartnerErrorResponse |
| 403 | 沒有權限(無法存取該 Organization)PartnerErrorResponse |
| 404 | 找不到資源PartnerErrorResponse |
| 429 | 超過 Rate limitPartnerErrorResponse |
| 503 | Rate limit 服務暫時無法使用PartnerErrorResponse |
回應 200
沒有內容。
將成員配置到工作區
需要 API KeyPUT/api/enterprise/v1/organizations/{orgId}/workspaces/{workspaceId}/members/{userId}
將成員配置到工作區。若已存在則僅變更角色(幂等)。
沒有另外的接受流程 — 呼叫後即時生效。但對象的組織成員資格必須為 ACTIVE;若尚未接受邀請,將以 404 Active organization member not found 拒絕。
路徑參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| orgId | string | 必填 | Organization ID範例: org_cuid123abc |
| workspaceId | string | 必填 | Workspace ID範例: ws_cuid456def |
| userId | string | 必填 | User ID(組織成員資格必須為 ACTIVE)範例: usr_cuid789ghi |
請求內容
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| role | enum | 必填 | 可用值: ADMIN · EDITOR · VIEWER | 範例: EDITOR |
請求範例
{
"role": "EDITOR"
}回應
| 狀態 | 意義 |
|---|---|
| 200 | 已配置 |
| 400 | 請求有誤(validation 失敗)PartnerErrorResponse |
| 401 | 驗證失敗(沒有 API Key 或無效)PartnerErrorResponse |
| 403 | 沒有權限(無法存取該 Organization)PartnerErrorResponse |
| 404 | 找不到資源PartnerErrorResponse |
| 429 | 超過 Rate limitPartnerErrorResponse |
| 503 | Rate limit 服務暫時無法使用PartnerErrorResponse |
回應 200
沒有內容。
從工作區移除成員
需要 API KeyDELETE/api/enterprise/v1/organizations/{orgId}/workspaces/{workspaceId}/members/{userId}
僅從工作區移除。組織成員資格會保留。
路徑參數
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| orgId | string | 必填 | Organization ID範例: org_cuid123abc |
| workspaceId | string | 必填 | Workspace ID範例: ws_cuid456def |
| userId | string | 必填 | User ID(組織成員資格必須為 ACTIVE)範例: usr_cuid789ghi |
請求內容
此端點不需要請求內容。
回應
| 狀態 | 意義 |
|---|---|
| 200 | 已移除 |
| 400 | 請求有誤(validation 失敗)PartnerErrorResponse |
| 401 | 驗證失敗(沒有 API Key 或無效)PartnerErrorResponse |
| 403 | 沒有權限(無法存取該 Organization)PartnerErrorResponse |
| 404 | 找不到資源PartnerErrorResponse |
| 429 | 超過 Rate limitPartnerErrorResponse |
| 503 | Rate limit 服務暫時無法使用PartnerErrorResponse |
回應 200
沒有內容。



