方案價格部落格企業版API
登入免費開始
登入免費開始

06 / 端點

Members

邀請成員加入組織

需要 API Key
POST/api/enterprise/v1/organizations/{orgId}/members/invite

邀請創作者加入組織,並寄出邀請信。

回應的 status 為 INVITED,表示對方還不是組織成員。 創作者必須透過信中的連結接受才會變成 ACTIVE,在那之前無法配置到工作區(配置時會回傳 404)。

userId 會回傳 null — 因為尚未連結帳號。若要取消這個邀請,請將回應中的 id 帶入 DELETE .../members/{userId}。

路徑參數

欄位型別必填說明
orgIdstring必填Organization ID範例: org_cuid123abc

請求內容

欄位型別必填說明
emailstring必填受邀者的電子郵件maxLength 320 · email | 範例: creator@example.com
roleenum必填組織內的角色可用值: 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
503Rate limit 服務暫時無法使用PartnerErrorResponse

回應 201

欄位型別必填說明
requestIdstring必填
idstring必填成員資格 ID。取消邀請時使用這個值。
userIdstring | null必填
emailstring必填
rolestring必填
statusstring必填範例: INVITED
回應範例
{
  "requestId": "string",
  "id": "string",
  "userId": "string",
  "email": "string",
  "role": "string",
  "status": "INVITED"
}

組織成員清單

需要 API Key
GET/api/enterprise/v1/organizations/{orgId}/members

僅回傳已完成接受的 ACTIVE 成員。 只收到邀請但尚未接受的人不會包含在內。email 是不分大小寫的部分比對篩選。

這份清單即等同於可配置到工作區的對象。

路徑參數

欄位型別必填說明
orgIdstring必填Organization ID範例: org_cuid123abc

查詢參數

欄位型別必填說明
emailstring選填電子郵件部分比對篩選(不分大小寫)範例: creator@
pagestring選填頁碼(預設 1)範例: 1
limitstring選填每頁筆數(預設 15,上限 100)範例: 15

請求內容

此端點不需要請求內容。

回應

狀態意義
200成員清單
400請求有誤(validation 失敗)PartnerErrorResponse
401驗證失敗(沒有 API Key 或無效)PartnerErrorResponse
403沒有權限(無法存取該 Organization)PartnerErrorResponse
404找不到資源PartnerErrorResponse
429超過 Rate limitPartnerErrorResponse
503Rate limit 服務暫時無法使用PartnerErrorResponse

回應 200

欄位型別必填說明
requestIdstring必填
organizationIdstring必填
members[]object[]必填
userIdstring必填
emailstring必填
namestring必填
rolestring必填
joinedAtstring必填
paginationobject必填
pagenumber必填
limitnumber必填
totalnumber必填
hasMoreboolean必填
回應範例
{
  "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 Key
PATCH/api/enterprise/v1/organizations/{orgId}/members

對象以 body 中的 userId 指定。若嘗試將最後一位 ADMIN 降為 MEMBER,將被拒絕。

路徑參數

欄位型別必填說明
orgIdstring必填Organization ID範例: org_cuid123abc

請求內容

欄位型別必填說明
userIdstring必填要變更角色的對象範例: usr_cuid789ghi
roleenum必填可用值: ADMIN · MEMBER
請求範例
{
  "userId": "usr_cuid789ghi",
  "role": "ADMIN"
}

回應

狀態意義
200已變更
400請求有誤(validation 失敗)PartnerErrorResponse
401驗證失敗(沒有 API Key 或無效)PartnerErrorResponse
403沒有權限(無法存取該 Organization)PartnerErrorResponse
404找不到資源PartnerErrorResponse
429超過 Rate limitPartnerErrorResponse
503Rate limit 服務暫時無法使用PartnerErrorResponse

回應 200

沒有內容。

從組織移除成員 / 取消邀請

需要 API Key
DELETE/api/enterprise/v1/organizations/{orgId}/members/{userId}

移除組織成員,或取消尚未被接受的邀請。所屬工作區的成員資格也會一併清理。

要取消尚未接受的邀請時,請帶入邀請回應的 id(membershipId)。在那個時點沒有 userId,無法以其他方式指定對象。

路徑參數

欄位型別必填說明
orgIdstring必填Organization ID範例: org_cuid123abc
userIdstring必填User ID。要取消尚未接受的邀請時,請填入邀請回應的 id(membershipId)。範例: usr_cuid789ghi

請求內容

此端點不需要請求內容。

回應

狀態意義
200已移除
400請求有誤(validation 失敗)PartnerErrorResponse
401驗證失敗(沒有 API Key 或無效)PartnerErrorResponse
403沒有權限(無法存取該 Organization)PartnerErrorResponse
404找不到資源PartnerErrorResponse
429超過 Rate limitPartnerErrorResponse
503Rate limit 服務暫時無法使用PartnerErrorResponse

回應 200

沒有內容。

將成員配置到工作區

需要 API Key
PUT/api/enterprise/v1/organizations/{orgId}/workspaces/{workspaceId}/members/{userId}

將成員配置到工作區。若已存在則僅變更角色(幂等)。

沒有另外的接受流程 — 呼叫後即時生效。但對象的組織成員資格必須為 ACTIVE;若尚未接受邀請,將以 404 Active organization member not found 拒絕。

路徑參數

欄位型別必填說明
orgIdstring必填Organization ID範例: org_cuid123abc
workspaceIdstring必填Workspace ID範例: ws_cuid456def
userIdstring必填User ID(組織成員資格必須為 ACTIVE)範例: usr_cuid789ghi

請求內容

欄位型別必填說明
roleenum必填可用值: ADMIN · EDITOR · VIEWER | 範例: EDITOR
請求範例
{
  "role": "EDITOR"
}

回應

狀態意義
200已配置
400請求有誤(validation 失敗)PartnerErrorResponse
401驗證失敗(沒有 API Key 或無效)PartnerErrorResponse
403沒有權限(無法存取該 Organization)PartnerErrorResponse
404找不到資源PartnerErrorResponse
429超過 Rate limitPartnerErrorResponse
503Rate limit 服務暫時無法使用PartnerErrorResponse

回應 200

沒有內容。

從工作區移除成員

需要 API Key
DELETE/api/enterprise/v1/organizations/{orgId}/workspaces/{workspaceId}/members/{userId}

僅從工作區移除。組織成員資格會保留。

路徑參數

欄位型別必填說明
orgIdstring必填Organization ID範例: org_cuid123abc
workspaceIdstring必填Workspace ID範例: ws_cuid456def
userIdstring必填User ID(組織成員資格必須為 ACTIVE)範例: usr_cuid789ghi

請求內容

此端點不需要請求內容。

回應

狀態意義
200已移除
400請求有誤(validation 失敗)PartnerErrorResponse
401驗證失敗(沒有 API Key 或無效)PartnerErrorResponse
403沒有權限(無法存取該 Organization)PartnerErrorResponse
404找不到資源PartnerErrorResponse
429超過 Rate limitPartnerErrorResponse
503Rate limit 服務暫時無法使用PartnerErrorResponse

回應 200

沒有內容。